Reputation: 107
I have recently started into learning OpenGL ES, learning from 1.0, working to 2.0.
My question is this, I know how to render two triangles(sharing one vertex coordination) to create a square/rectangle. And adding a texture to that, the size of the image. To seamlessly create an image on the 'canvas'. Is this the correct way of putting a graphic image on the screen, or is there a method that I can use to put one on?
In other words: Android API has::
canvas.drawBitmap(bitmap, x, y, filter);
Does OpenGL ES 1.0+ or 2.0 have a separate method to place a Bitmap image on the screen?
Upvotes: 0
Views: 612
Reputation: 54642
Not really, no. There are a couple of extensions that more directly support functionality similar to what you're describing:
http://www.khronos.org/registry/gles/extensions/OES/OES_draw_texture.txt http://www.khronos.org/registry/gles/extensions/NV/draw_texture.txt
But with standard API calls, what you're describing is the right way to display an image.
OpenGL ES 3.0 has glBlitFramebuffer()
, which is another option that could be used for this. But this is not in ES 1.1 and ES 2.0.
Full OpenGL used to have a glDrawPixels()
function, but this is also deprecated in modern OpenGL versions.
Upvotes: 1