











A callback function is a function that handle events. Callback functions determine exactly what function to call next when an event occurs.
myDisplay() is called after glutDisplayFunc(myDisplay) is called as after this line is executed, my screen start to process it's drawing and updating of the graphics on the screen.
Define a struct to represent pixels on the screen.
Define pointer to memory location that will enable pixel plotting.
Based on the screen resolution, a 800x600 memory array is created.
Memory that was created earlier is then transfered into OpenGL’s double buffer.
Buffer will then be cleared to enable a clean surface to work on.
OpenGL’s double buffer will then copy the image onto the VRAM to be displayed on the screen.
Deleting the dynamic array created to prevent memory leak.
24bits. Red, Green and Blue.
800*600*3=1.44MB
glDrawPixels() basically transfers what the buffer had stored into the display to enable the player to see the images. Plot-pixel basically just changes the data of the buffer.

Labels: practical