Reputation: 1374
Two questions -
What is the best way to use a texture in OpenGL to fill the entire window?
I want to use glTexImage2D to take in an array of ints containing colour data, how would I go about doing this? (I've found a couple of pages of reference on glTexImage2D but tutorial on using it would be great)
Clarification:
I have done texturing before. I simply need help on these two specific parts.
Upvotes: 1
Views: 2828
Reputation: 56377
glTexImage2D just uploads texture data, nothing more. When you have your texture, draw a texture mapped quad the size of the screen and you will draw your texture pixels to the screen.
A ortographic projection is usually used for this.
Upvotes: 3
Reputation: 10222
Also you could just upload the pixels with glDrawPixels
if you don't need to update to much.
There is a nice example from Nehe on how to use textures here:
Upvotes: 0