Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualOmarShehata

Posted 01 March 2012 - 08:28 AM

You're creating an RGB texture, so the texture doesn't even have an alpha channel. Check the third parameter to glTexImage; you're telling OpenGL that you only want three color components, the R, the G and the B channels, and to throw away the alpha channel. Pass GL_RGBA instead to make it an RGBA texture.

But on another note; don't create the texture all the time you draw like that. Create it once when you start the program, and then just save the texture ID and bind it every frame instead.


Oh my god...you, my good, sir, are brilliant! It works!!

Posted Image

It's so beautiful!

You have also saved me *another* great deal of trouble and time, because I knew the way I was adding graphics was lagging immensely, but didn't know why.

I cannot thank you enough Brother Bob!

I guess I should have read the parameters more carefully when implementing the functions.

#1OmarShehata

Posted 01 March 2012 - 08:27 AM

You're creating an RGB texture, so the texture doesn't even have an alpha channel. Check the third parameter to glTexImage; you're telling OpenGL that you only want three color components, the R, the G and the B channels, and to throw away the alpha channel. Pass GL_RGBA instead to make it an RGBA texture.

But on another note; don't create the texture all the time you draw like that. Create it once when you start the program, and then just save the texture ID and bind it every frame instead.


Oh my god...you, my good, sir, are brilliant! It works!!

Posted Image

It's so beautiful!

You have also saved me *another* great deal of trouble and time, because I knew the way I was adding graphics was lagging immensely, but didn't know why.

I cannot thank you enough Brother Bob!

PARTNERS