|
From: Milan M. <mil...@gm...> - 2007-05-16 10:06:17
|
Here is it. A patch that enables drawing to video bitmaps using FBO extension if available. Implements: blit(), masked_blit(), draw_sprite(), pivot_scaled_sprite_v_flip(). It does not change functions for drawing primitives, i'm not sure if it's wroth it atm. Except for clear_bitmap() which was easy to do. New tests added to dumbtest. Various other unrelated fixes and corrections. There are issues. This is what I wrote in bugs.txt: * Functions that do masked drawing to video bitmaps do not work correctly if EXT_framebuffer_object extension is not supported. The resulting image will not be masked. A fix would be a to write a memory -> video masked blit function. * Functions that do rotating and/or flipping to video bitmaps do not work correctly for bitmaps that have textures in segments. Bitmap is made segmented if the texture of the size of the bitmap is not supported by the GFX driver (too large or non-power-of-2). The work-around is obvious. * Functions that do rotating and/or flipping to video bitmaps do not apply rotation and scale to the memory copy. Thus reading from such bitmaps may return unexpected images. * Before any drawing to the video bitmap occurs, when using FBO feature, at least one call to allegro_gl_set_allegro_mode() must be made. This is needed in order for __allegro_gl_pool_texture texture to be created, which is used for FBO drawing. ... the good thing is plain blit() works. All the issues regard the new features. I can fix the first one by using munge_bitmap() and draw_trans_sprite() which involves a temporary bitmap and is slow. Is there a way to tell glTexSubImage2D() to skip magenta pixels maybe? -- Milan Mimica http://sparklet.sf.net |