OGL crash

BlitzMax Forums/OpenGL Module/OGL crash

Will(Posted 2006) [#1]
on one of these two lines:

glTexImage2D GL_PROXY_TEXTURE_2D,0,4,width,height,0,GL_RGBA,GL_UNSIGNED_BYTE,Null
glGetTexLevelParameteriv GL_PROXY_TEXTURE_2D,0,GL_TEXTURE_WIDTH,Varptr t

Inside function GLAdjustTexSize( width Var,height Var )

Called from function GLTexFromPixmap( pixmap:TPixmap,mipmap=True )

:( Crashes without launching debugger in debug mode. Any ideas? I'd like to be able to use textures in my game.

Ive tracked the problem to where GLTexFromPixmap calls GLAdjustTexSize(width, height). In GLTexFromPixmap width and height are correct, the moment we get into GLAdjustTexSize width and height are both 0. WTF? Passing a variable comes out 0? And just for me?


Dreamora(Posted 2006) [#2]
VAR changes the value and in this case to the smallest larger power of 2 that is found (so make sure that that one is supported by your garphics card or use directly power of 2 sized textures)


Will(Posted 2006) [#3]
The problem is that the moment width and height are passed into GLAdjustTexSize they are passed in as 0. They should be passed in as the correct dimensions and then resized to power of two dimensions later in the function.


Will(Posted 2006) [#4]
Haha, I didn't have a valid context :p! Thanks Chris C!