[AD] Problem with the system vtable

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]



Hi,

Well, I wasn't sure were to post this exactly, so I'm cross-posting between the AGL list and the AD list.

Currently, AGL makes it virtually impossible to create and use memory bitmaps (or so I've been lead to believe). The code I'm using is simple. First, I set up AllegroGL, then I load allegro/examples/running.dat, then convert each bitmap from the datafile to a 32bpp memory bitmap, which I then intend to use as a texture. Unfortunately, Allegro locks up because it ended up in 0x0000000 (EIP). Upon further investigation, I discovered that the memory bitmaps (of the datafile, and my own create_bitmap) had AllegroGL's GFX_VTABLE struct attached to it - a vtable that is far from completed, and simply does not work! However, this shouldn't have been an issue IMO.

Shouldn't memory->memory operations be covered by the 'default' Allegro driver? If not, then can someone recommend me something else to implement in AllegroGL (short of copying all of Allegro)?

I am using Allegro 3.9.38 CVS (from last weekend) and AllegroGL 0.0.15 CVS (which doesn't differ much from 0.0.14).

The relevant code is the following, and crashes inside the first masked_blit (I removed the error checking, since all tests pass):

#include "alleggl.h"
#include "running.h"

int main() {

	BITMAP *texture;
	DATAFILE *dat;
	GLuint tex[11];
	int i = 0, j;

	allegro_init();
	install_allegro_gl();
	install_keyboard();
	
	allegro_gl_clear_settings();
	allegro_gl_set(AGL_COLOR_DEPTH, 32);
	allegro_gl_set(AGL_DOUBLEBUFFER, 1);
	allegro_gl_set(AGL_RENDERMETHOD, 1);
allegro_gl_set(AGL_SUGGEST, AGL_COLOR_DEPTH | AGL_DOUBLEBUFFER | AGL_RENDERMETHOD);
	
	set_color_depth(32);
	set_gfx_mode(GFX_OPENGL_WINDOWED, 640, 480, 0, 0);
	dat = load_datafile("running.dat");
	select_palette(dat[PALETTE_001].dat);
	allegro_gl_use_mipmapping(TRUE);

	/* Convert running ball thingie */
	for (j = 0; j < 10; j++) {
		
		BITMAP *bmp = dat[FRAME_01 + j].dat;
		texture = create_bitmap(bmp->w, bmp->h);
		clear_to_color(texture, makecol(255, 0, 255));
		masked_blit(bmp, texture, 0, 0, 0, 0, bmp->w, bmp->h);
		tex[j] = allegro_gl_make_masked_texture(texture);
		
		destroy_bitmap(texture);
	}
	return 0;
}

--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/