Advertise here: Contact FM.


Getting to the point in OpenGL ES
September 11, 2008 5:36 AM   RSS feed for this thread 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 comments 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-ish DVD player only plays ...   |   Where can I get a professional... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
Windows OpenGL being tempramental December 6, 2008
How can I rotate around 3 axes in opengl? October 14, 2008
inexperienced geek seeks opengl expert for comfort,... June 1, 2008
What is the best way to realtime-render 3D images... January 4, 2008
I want to be the next Will Wright February 6, 2007