Getting to the point in OpenGL ES
September 11, 2008 5:36 AM   Subscribe

Drawing pixels with OpenGL ES 1.1?

Is there a straightforward way to draw (x, y) or (x, y, 0.0f) in OpenGL ES?

So far I have found glDrawArrays and glDrawElements but these appear to be used to draw 1D or 2D elements (lines, triangles, etc.). My Google fu isn't helping me tonight.

Thanks for any advice or example code.
posted by Blazecock Pileon to Computers & Internet (2 answers total)
glDrawElements(GL_POINTS, 0, num_points, point_array);
You can also use glDrawArrays if you use glVertexPointer first.

Use glPointParameter, glPointSize, and glColor to modify the appearance of the points. Using glPointSizePointer lets you specify an array of point sizes, which is handy for particle effects.
posted by jedicus at 7:13 AM on September 11, 2008

I'm not an OpenGL ES expert, but I think your best bet would be to draw to a bitmap offscreen, then apply that as a texture to a quad. Then you set up an orthographic projection such that the quad fills the screen exactly to the edges, and such that one unit in OpenGL space equals one unit in pixel space, and voila. Here's some sample code that should be applicable.

Good luck!
posted by aparrish at 11:34 AM on September 11, 2008

« Older 'New' is the new 'obsolete'   |   Voigtländer Bessamatic Needs a Bath Newer »
This thread is closed to new comments.