Jump to content
  • Advertisement
Sign in to follow this  
dsh

OpenGL GL_TEXTURE_RECTANGLE_ARB - just black textures [SOLVED - stupid mistake]

This topic is 3715 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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()?

Share this post


Link to post
Share on other sites
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 ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!