Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

2D example with OpenGL

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

like image 502
Ouael Mouelhi Avatar asked Mar 07 '11 13:03

Ouael Mouelhi


People also ask

Can OpenGL be used for 2D graphics?

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.

Can you make 2D games with OpenGL?

OpenGL makes it possible to render sophisticated 2D and 3D graphics on your computer screen.

What is glVertex2f in OpenGL?

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.

What is Gl_polygon in OpenGL?

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.


1 Answers

The glbuffer for the Android NDK was useful for me.

This answer also has many tutorials linked.

like image 199
Matthew Willis Avatar answered Oct 14 '22 17:10

Matthew Willis