I am looking for a very simple tutorial to use OpenGL only for 2D drawing.
My problem is that I want to draw, with OpenGl a bitmap having its pixels.
Thank you in advance, Ouael
OpenGL is quite appropriate for 2D games. Although it is generally used for 3D, the same functionality can be used for 2D games. That is to say, anything you can do with 3D OpenGL will be applicable with "2D" OpenGL. Some further information can be found at this location.
OpenGL makes it possible to render sophisticated 2D and 3D graphics on your computer screen.
The function glVertex2f specifies the x and y coordinates of the vertex, and the z coordinate is set to zero. There is also a function glVertex3f that specifies all three coordinates. The "2" or "3" in the name tells how many parameters are passed to the function.
The final OpenGL primitive is the GL_POLYGON, which you can use to draw a polygon having any number of sides. • Eg a polygon consisting of five vertices. • Polygons, like quads, must have all vertices on the same plane.
The glbuffer for the Android NDK was useful for me.
This answer also has many tutorials linked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With