{"id":46,"date":"2009-03-12T06:06:15","date_gmt":"2009-03-12T06:06:15","guid":{"rendered":"http:\/\/shultays.wordpress.com\/?p=46"},"modified":"2009-03-12T06:06:15","modified_gmt":"2009-03-12T06:06:15","slug":"now-you-are-thinking-with-portal","status":"publish","type":"post","link":"http:\/\/enginmercan.com\/?p=46","title":{"rendered":"Now you are thinking with portals"},"content":{"rendered":"<p>Stencil buffer&#8217;\u0131n ne oldu\u011funu \u00f6\u011frenmem ve sonras\u0131nda &#8220;Portal yap\u0131l\u0131r bunla&#8221; fikrinin gelmesi ile ba\u015flayan proje.<\/p>\n<p>Portal nedir diyenler i\u00e7in herkesin denemesini tavsiye edece\u011fim Valve&#8217;nin \u00fcretti\u011fi bir oyun. Ama\u00e7 olu\u015fturdu\u011fumuz portallar yard\u0131m\u0131yla ba\u015flang\u0131\u00e7 noktas\u0131ndan biti\u015f noktas\u0131na gitmek.<\/p>\n<p>Peki &#8220;portal&#8221; nedir derseniz, \u015f\u00f6yleki: iki tane kap\u0131 hayal edin, birinden girdi\u011fimiz de asl\u0131nda di\u011ferinden \u00e7\u0131k\u0131yoruz. T\u00fcrk\u00e7e de kurt deli\u011fi diye kullan\u0131l\u0131yor (ho\u015f asl\u0131nda oda wormhole ya neyse) diye d\u00fc\u015f\u00fcn\u00fcyorum.<\/p>\n<p>Yani bir ss ile anlatmak gerekirse:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-49 alignleft\" title=\"port11\" src=\"http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/port11.png?w=300\" alt=\"port11\" width=\"300\" height=\"300\" srcset=\"http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/port11.png 480w, http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/port11-150x150.png 150w, http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/port11-300x300.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-50\" title=\"portal21\" src=\"http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/portal21.png?w=300\" alt=\"portal21\" width=\"300\" height=\"300\" srcset=\"http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/portal21.png 480w, http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/portal21-150x150.png 150w, http:\/\/enginmercan.com\/wp-content\/uploads\/2009\/03\/portal21-300x300.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Bu dikd\u00f6rtgen pencere gibi duranlar portallar\u0131m\u0131z oluyor, pembe renkli \u015fekil sar\u0131 duvardaki portal\u0131n \u00f6n\u00fcnde, dikkat ederseniz k\u0131rm\u0131z\u0131 duvardaki portaldan bakt\u0131\u011f\u0131m\u0131zda hemen \u00f6nde onu g\u00f6r\u00fcyoruz.<\/p>\n<p>Daha iyi anlamak i\u00e7in program\u0131 deneyin =)<\/p>\n<p>\u0130ki s\u00fcr\u00fcm\u00fc var, hemen hemen ayn\u0131. Ba\u015fta windows ta yazm\u0131\u015ft\u0131m, daha sonra linux \u00fczerinde test ettim.<\/p>\n<p>Windows s\u00fcr\u00fcm\u00fc i\u00e7in glut isimli k\u00fct\u00fcphaneyi kullanman\u0131z gerekiyor. Kendisinin as\u0131l amac\u0131 opengl komutlar\u0131n\u0131 bir par\u00e7a basitle\u015ftirmek ve opengl i platformdan ba\u011f\u0131ms\u0131z olarak \u00e7al\u0131\u015ft\u0131rmak. Ama klavye fonksiyonlar\u0131 \u00e7ok zay\u0131f oldu\u011fu i\u00e7in windows.h k\u00fct\u00fcphanesinden bir fonksiyon kullanmak zorunda kald\u0131m. Bu y\u00fczdende linux s\u00fcr\u00fcm\u00fcnde glfw diye glut yerine ba\u015fka bir k\u00fct\u00fcphane kulland\u0131m.<\/p>\n<p>glut hak\u0131nda bilgi i\u00e7in<br \/>\n<a href=\"http:\/\/www.opengl.org\/resources\/libraries\/glut\/\">http:\/\/www.opengl.org\/resources\/libraries\/glut\/<\/a><br \/>\nglfw hakk\u0131nda bilgi i\u00e7in<br \/>\n<a href=\"http:\/\/glfw.sourceforge.net\/\">http:\/\/glfw.sourceforge.net\/<\/a><\/p>\n<p>glut s\u00fcr\u00fcm\u00fcnde linker a glut opengl ve glu k\u00fct\u00fcphanelerini vermelisiniz. glfw i\u00e7in biraz daha fazla \u015fu k\u00fct\u00fcphaneler laz\u0131m olaca: glfw, GLU, GL, X11, pthread, Xxf86m, m, Xrandr. Ayr\u0131c\u0131 -L ile \u015fu klas\u00f6r\u00fcde vermelisiniz: \/usr\/X11R6\/lib<\/p>\n<p>Program\u0131 yazarken hi\u00e7 comment yapmam\u0131\u015ft\u0131m =) \u015eu an biraz eklesem de hala kaynak kodu a\u00e7\u0131k olmaktan \u00e7ok uzak. \u015eu an saat sabah 7 ve uykusuzluk sayesinde hi\u00e7 \u015fevkim kalmad\u0131 do\u011frusu =D \u0130lerde projeyi geli\u015ftirmeye ba\u015flarsam daha a\u00e7\u0131k bir \u015fekilde anlatmay\u0131 d\u00fc\u015f\u00fcn\u00fcyorum.<\/p>\n<p>\u00c7al\u0131\u015ft\u0131rabilir dosyalar<\/p>\n<p><a href=\"http:\/\/www.shultays.com\/portal.zip\">Windows<br \/>\n<\/a><a href=\"http:\/\/www.shultays.com\/portal.tar.gz\">Linux<\/a><\/p>\n<p>Kaynak kodlar\u0131 (windows visual c++ da haz\u0131rland\u0131, direk olarak dsp dosyas\u0131n\u0131 a\u00e7abilirsiniz. linux eclipse ile haz\u0131rland\u0131. c eklentisini kurduktan sonra workspace ine at\u0131n)<\/p>\n<p><a href=\"http:\/\/www.shultays.com\/portal.source.zip\">Windows<\/a><\/p>\n<p><a href=\"http:\/\/www.shultays.com\/portal.source.tar.gz\">Linux<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Stencil buffer&#8217;\u0131n ne oldu\u011funu \u00f6\u011frenmem ve sonras\u0131nda &#8220;Portal yap\u0131l\u0131r bunla&#8221; fikrinin gelmesi ile ba\u015flayan proje. Portal nedir diyenler i\u00e7in herkesin denemesini tavsiye edece\u011fim Valve&#8217;nin \u00fcretti\u011fi bir oyun. Ama\u00e7 olu\u015fturdu\u011fumuz portallar yard\u0131m\u0131yla ba\u015flang\u0131\u00e7 noktas\u0131ndan biti\u015f noktas\u0131na gitmek. Peki &#8220;portal&#8221; nedir derseniz, \u015f\u00f6yleki: iki tane kap\u0131 hayal edin, birinden girdi\u011fimiz de asl\u0131nda di\u011ferinden \u00e7\u0131k\u0131yoruz. T\u00fcrk\u00e7e de kurt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,14],"tags":[],"class_list":["post-46","post","type-post","status-publish","format-standard","hentry","category-cc","category-opengl"],"_links":{"self":[{"href":"http:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=46"}],"version-history":[{"count":0,"href":"http:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts\/46\/revisions"}],"wp:attachment":[{"href":"http:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}