GL_TEXTURE_RECTANGLE_ARB - just black textures [SOLVED - stupid mistake]
I'm writing a tiny SDL 2d game. Decided to use opengl instead of SDL's software blitting - which is slow as hell when using alpha-channeled bitmaps.
I've got GF7300GS. Of course it has the NPoT extension so everything works fine - but - I've read that ATI cards don't support it so I want to implement GL_ARB_texture_rectangle as a fallback.
I've done everything according to the docs found on the net. GL_CLAMP_TO_EDGE, no mipmapping, I use the pixel coords (not normalized) when texturing. Textures remain black or sometimes white.
It's a probably silly mistake (I'm kinda tired - been solving this matter whole night).
Look at the code and tell me what's wrong.
Thanks.
code
PS The os is linux/gentoo with latest stable libs (yes, this extension is supported both by the card and the libs).
[Edited by - dsh on April 21, 2008 2:17:34 AM]
I see you glEnable(GL_TEXTURE_2D) and glEnable(GL_TEXTURE_RECTANGLE_ARB) at the same time. Maybe GL_TEXTURE_2D overrides GL_TEXTURE_RECTANGLE_ARB? Also, shouldn't your rendering below glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textureID) be surrounded by glBegin(GL_QUADS)...glEnd()?
Ive already checked that - GL_TEXTURE_RECTANGLE_ARB is stronger (overrides) GL_TEXTURE_2D.
I am so stupid. I knew it was something stupid. I forgot the glBegin() and glEnd(). I just C&P'ed the quad code from upper function and lost those two. Have spent whole night searching for it.
God knows I love programming. ;)
Thank you so, so much ;)
I am so stupid. I knew it was something stupid. I forgot the glBegin() and glEnd(). I just C&P'ed the quad code from upper function and lost those two. Have spent whole night searching for it.
God knows I love programming. ;)
Thank you so, so much ;)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement