Visible Surface glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH ); glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glEnable ( GL_DEPTH_TEST ); glColor3f ( 1.0, 0.0, 0.0 ); drawDisc ( 20.0, 100.0, 100.0, 0.0 ); glColor3f ( 0.0, 0.0, 1.0 ); drawDisc ( 10.0, 100.0, 100.0, 0.5 ); glDisable ( GL_DEPTH_TEST ); Mouse Operations ( need GLUT or FreeGLUT ) void mouse ( int button, int state, int x, int y ) { if ( button == GLUT_LEFT_BUTTON && state == GLUT_DOWN ) drawSomething ( x, y ); if ( button == GLUT_RIGHT_BUTTON && state == GLUT_DOWN ) exit ( ); } -- and in main ( ) glutMouseFunc ( mouse ); Similar Keyboard Ops void myKey ( unsigned char key, int x, int y ) { if ( key == 'q' || key == 'Q' ) exit ( ); } -- and in main ( ) glutKeyboardFunc ( myKey ); Images ( bitblt hardware ) glBitmap ( width, height, xo, yo, xi, yi, bitmap ); GLubyte myimage [ 512 ] [ 512 ] [ 3 ]; glReadPixels ( GLint x, GLint y, GLsizei width, Glsizei height, GLenum format, GLenum type, GLvoid *image ); glDrawPixels ( GLsizei width, Glsizei height, GLenum format, GLenum type, GLvoid *image ); glCopyPixels ( GLint x, GLint y, GLsizei width, Glsizei height, GLenum type ); glRasterPos2i ( startx, starty ); glDrawPixels ( 512, 512, GL_RGB, GL_UNSIGNED_BYTE, myimage );

© 2019 G. Hill Price
All Rights Reserved