Reputation: 241
So I know that glDrawPixels is deprecated. Is there any function that does the same thing? I thought of using textures, but they are modified by the current matrix, unlike pixels that are drawn by glDrawPixels.
Upvotes: 4
Views: 3711
Reputation: 9547
You need to draw a quad with :
For starters, use an Identity matrix, and a mesh with X and Y coords between 0 and 1.
You might want to use a mix of http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/ and http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-11-2d-text/ (though the latter one should be improved regarding the matrix used)
Upvotes: 1
Reputation: 2292
You could use a fragment shader where a function of gl_FragCoord
is used to sample a rectangular texture.
Alternatively, you could use a more traditional approach and just set up your transformation matrices to approximate the pixel coordinate system of your window and then draw a textured quad with your image.
Upvotes: 1
Reputation: 474436
I thought of using textures, but they are modified by the current matrix
The "current matrix" is deprecated in 3.0 and removed in 3.1+ as well. So if you're not using glDrawPixels
, you wouldn't be using matrix functions either. So it's nothing to be concerned about.
Upvotes: 2