 # Plotting Pixels--how?

Is there a simple command, like PlotPixel(x,y,color) in OpenGL? Or do I need to load as a textrue?

Use glVertex in orthographic projection or use glDrawPixels(x,y); use glColor to set the color. I havn’t actualy used glDrawPixels but I will any day now. Tim

It took me a while, but I finally figured out
how to write individual pixels to the framebuffer. glDrawPixels is nice, but its slow, and you can’t control each and every pixel. Doing it the following way overcomes that problem:

BYTE *aBitmap = some bitmap data;

glBegin(GL_POINTS);
for (y=0.0;y<128.0;y=y+1) {
for (x=0.0;x<256.0;x=x+1) {
glColor3f((float)((float)aBitmap[index+2]/255.0), (float)((float)aBitmap[index+1]/255.0), (float)((float)aBitmap[index]/255.0));
glVertex2f(x*.999,y*.999);
// calculate the index for an x and y.
index = ((int)x + ((int)y * 256)) * 3;
}
}
glEnd();

This is for a 256X128 texutre at 24 bit
resolution, hence the need to step by three bytes everytime. Hope this helps… it sure helps me. A couple things I forgot to metion:
(1) the image data is in BGR format, that is
blue byte, green byte, red byte.

(2) the x * .999, and y * .999 is required on
at least my 3d card in order to keep the
vertices packed together (no spaces).

Let me know if anyone can find a way to speed this up.