{"id":8,"date":"2007-10-17T01:31:20","date_gmt":"2007-10-17T06:31:20","guid":{"rendered":"http:\/\/bda.ath.cx\/blog\/projects\/"},"modified":"2008-10-10T20:49:27","modified_gmt":"2008-10-11T01:49:27","slug":"projects","status":"publish","type":"page","link":"http:\/\/bda.ath.cx\/blog\/projects\/","title":{"rendered":"Projects"},"content":{"rendered":"<h4>SDL and Windowed Fullscreen<\/h4>\n<p>The fullscreen display mode in SDL traps the mouse on one X display, which can be undesirable if you are running dual head with separate X screens and using SDL for something other than games. One way around this is to run SDL without FULLSCREEN, but maximize the window and remove the border.<\/p>\n<p>The easiest way to accomplish this in a cross platform manner is using SDL_NOFRAME and SDL_GetVideoInfo to determine the current screen resolution. This was added in 1.2.13, which is the latest version of SDL. Here&#8217;s a simple example: <a href=\"http:\/\/bda.ath.cx\/testnoframe.c\">testnoframe.c<\/a>. Use q or Esc to quit, g\/u to grab\/ungrab the mouse.<\/p>\n<p>Another approach that will work with most X11 windows managers is using the EWMH\/NetWM standard. <a href=\"http:\/\/www.sweb.cz\/tripie\/utils\/wmctrl\/\">wmctrl<\/a> can do this to any existing window from the command-line. It can also be done programatically in the SDL app itself. Here&#8217;s an example: <a href=\"http:\/\/bda.ath.cx\/testewmhfs.c\">testewmhfs.c<\/a>.<\/p>\n<p>Note: these test programs will probably not interact properly with multiple monitors, unless you&#8217;re using separate screens for each head (with X11).<\/p>\n<p>Download both programs, with Makefile: <a href=\"http:\/\/bda.ath.cx\/sdl-windowed-fs-demo.tbz2\">sdl-windowed-fs-demo.tbz2<\/a><a href=\"http:\/\/bda.ath.cx\/sdlfs.c\"><br \/>\n<\/a><\/p>\n<p>Credits: <a href=\"http:\/\/www.sweb.cz\/tripie\/utils\/wmctrl\/\">wmctrl<\/a>, <a href=\"http:\/\/fixunix.com\/xwindows\/91849-toggling-fullscreen.html\">this forum post<\/a><\/p>\n<p>See also: <a href=\"http:\/\/www.libsdl.org\/cgi\/docwiki.cgi\/SDL_GetWMInfo\">SDL_GetWMInfo<\/a>, <a href=\"http:\/\/www.libsdl.org\/cgi\/docwiki.cgi\/SDL_SysWMInfo\">SDL_SysWMInfo<\/a>, <a href=\"http:\/\/www.libsdl.org\/cgi\/docwiki.cgi\/SDL_GetVideoInfo\">SDL_GetVideoInfo<\/a><\/p>\n<h4>robotfindskittenDS mods<\/h4>\n<p>Here is a small update to GPF&#8217;s <a href=\"http:\/\/gpf.dcemu.co.uk\/robotfindskitten.shtml\">DS port<\/a> of robotfindskitten. Here are the changes I&#8217;ve made so far:<\/p>\n<ul>\n<li> Fixed missed button press bug. Now robot can move much more easily.<\/li>\n<li> Right buttons can also be used to control robot.<\/li>\n<li> If you hold down a direction button, robot will continue to move in that direction.<\/li>\n<li> The code now compiles under libnds-20070503.<\/li>\n<\/ul>\n<p>Download it here: <a href=\"\/robotfindskittenDS-20071017.zip\">robotfindskittendDS-20071017.zip<\/a><\/p>\n<p>Source code included. The code is under the GPL license, so make sure to include the source if you distribute your own modifications.<\/p>\n<p>Next I plan on adding <a href=\"http:\/\/www.crummy.com\/software\/robotfindskitten\/\">NKI file<\/a> support.<\/p>\n<p>DS port by Troy Davis(GPF) <a href=\"http:\/\/gpf.dcemu.co.uk\">http:\/\/gpf.dcemu.co.uk<\/a> based on<br \/>\nPSP port by Trevor Wilson<br \/>\nuses &#8220;pg&#8221; PSP graphics libraries from &#8220;hellopsp&#8221; by nem<br \/>\nOriginal version by Leonard Richardson<br \/>\nOfficial robotfindskitten site: <a href=\"http:\/\/robotfindskitten.org\">http:\/\/robotfindskitten.org<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SDL and Windowed Fullscreen The fullscreen display mode in SDL traps the mouse on one X display, which can be undesirable if you are running dual head with separate X screens and using SDL for something other than games. One way around this is to run SDL without FULLSCREEN, but maximize the window and remove [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-8","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/pages\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":13,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/pages\/8\/revisions"}],"predecessor-version":[{"id":36,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/pages\/8\/revisions\/36"}],"wp:attachment":[{"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/media?parent=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}