Can someone tell me how to draw a single white pixel at a coordinate, say (100,200)?
I am using GLUT and so far have figured out how to open a blank window. Once I figure out how to draw pixels, I will use that to implement the Bresenham line drawing algorithm. (Yes, I am aware OpenGL can draw lines. I am required to implement this myself).
#include <stdio.h>
#include <GL/glut.h>
static int win(0);
int main(int argc, char* argv[]){
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGBA|GLUT_SINGLE);
glutInitWindowSize(500,500);
glutInitWindowPosition(100,100);
//step 2. Open a window named "GLUT DEMO"
win = glutCreateWindow("GLUT DEMO");
glClearColor(0.0,0.0,0.0,0.0); //set background
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
glutMainLoop();
}