From: Milan M. <mil...@gm...> - 2007-09-18 16:39:53
|
I'm proud to announce that the Skater demo now can work with AllegroGL, using hardware acceleration if available, without a single OpenGL command in the game code. The only modification to the game code consist of: - added code for AGL initialization (mandatory) - added new gfx update driver (mandatory) - convert all bitmaps to video bitmaps on load (not mandatory, but the whole thing losses sense without this) - added support for AGL fonts support (quite extensive modification) [1] - used rectfill(buffer, 0, 0, buffer->w, fixtoi(lowy) + 1, getpixel(cloud, 0, 0)); instead of: set_clip_rect(buffer, 0, 0, buffer->w, fixtoi(lowy)); clear_to_color(buffer, getpixel(cloud, 0, 0)); set_clip_rect(buffer, 0, 0, buffer->w, buffer->h); to workaround a AGL bug. (not a big deal) - other really minor things. I think I didn't miss anything. Differences to non-AGL Skater that I can notice: - higher FPS and less CPU time used :) - the "transition" animation looks a bit broken - the grass (the surface where our hero is skating) contains pink pixels. That's because 3D polygons with masked textures are not supported by AGL and probably will never be. I am asking here if I can change the grass sprite the use sky-blue at those spots? It's all blue background anyways. With this I'm trying to show you that AGL's gfx driver is becoming mature for more serious usage. I think it is ready for 4.3 branch. To try it out: - get AllegroGL from SVN: svn co https://allegrogl.svn.sourceforge.net/svnroot/allegrogl/trunk allegro Compile & install AGL. - get Skater from SVN: svn co https://alleg.svn.sourceforge.net/svnroot/alleg/demos/skater skater - apply the attached patch to Skater. cd skater/ patch -p0 <skater_agl.diff Compile Skater using "scons" command. If you wish to build Skater with disabled AllegroGL support remove the two related defines from SConstruct file. [1] If SKATER_USE_ALLEGRO_GL_FONT is defined (default) Skater will use AGL fonts. These are faster then regular Allegro fonts but currently cannot be drawn onto video bitmaps, thus text will not display during the "transition" animation which lasts for 0.3 seconds by the way. Regular Allegro fonts could be used instead, they which can be drawn onto video bitmaps and do not require modification of the existing code... The only drawback is that they are very slow. To try it out with regular Allegro fonts undefine ALLEGRO_USE_ALLEGRO_GL_FONT in SConstruct file. -- Milan Mimica http://sparklet.sf.net |