![]() |
|
Texture mapping with allegro and opengl |
miguel meza
Member #5,447
January 2005
|
Hi, void CImageLoader::LoadBMP( char* strImageName, UINT textureArray[], int textureID ) { BITMAP* pImageBuffer1; pImageBuffer1 = load_bmp( strImageName, NULL); glGenTextures(1, &textureArray[textureID]); glBindTexture(GL_TEXTURE_2D, textureArray[textureID]); gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImageBuffer1->w, pImageBuffer1->h, GL_RGBA, GL_UNSIGNED_BYTE, pImageBuffer1->dat); // here is the problem destroy_bitmap( pImageBuffer1 ); } I did that code in my other computer, and it worked perfectly (amd64), and now, i have to program in my laptop (dell xps, intel core 2 duo), but it doesnt works in my lap!! the problem is when i use the gluBuild2Mipmaps..... this is the error the debugger throws: how is it possible that in both computers compile, but in one runs, and in the other doesnt...... thanks for any possible help |
Kitty Cat
Member #2,815
October 2002
![]() |
I notice you're not testing if load_bmp fails. You should probably also use load_bitmap instead of the format-specific load_bmp. -- |
gnolam
Member #2,030
March 2002
![]() |
Anything wrong with GLuint allegro_gl_make_texture_ex (int flags, BITMAP *bmp, GLint internal_format);? -- |
HoHo
Member #4,534
April 2004
![]() |
As gnolam said you should use allegro_gl_make_texture_ex. IIRC, .dat pointer contains more than just raw pixel data, it had line pointers in it too and that is probably what breaks things. __________ |
miguel meza
Member #5,447
January 2005
|
Hi, Gnolam: how do i use the GLuint allegro_gl_make_texture_ex (int flags, BITMAP* bmp, GLint internal_format) i read the docs, but i'm not sure what should i send in the "GLint internal_format" parameter. can you give me a little example how would it be the complete method? HoHo: then why did it worked perfectly in my other computer? i only recompiled it in my lap with the same compiler (vs2005) the code is EXACTLY the same |
HoHo
Member #4,534
April 2004
![]() |
Quote: then why did it worked perfectly in my other computer? Probably because I was wrong Note to self: __________ |
vbovio
Member #8,283
January 2007
|
unless you want to make your own function, look for: allegro_gl_make_texture --------------- |
miguel meza
Member #5,447
January 2005
|
well, i can do this.... but then... what should i do so the texture mapps with the primitive? |
vbovio
Member #8,283
January 2007
|
look around for "textured quads", and spend some time studying opengl. --------------- |
|