![]()
GlBegin(GL_POLYGON) // These vertices form a closed polygon GlBegin(GL_TRIANGLES) // Each set of 3 vertices form a triangle GlVertex2f(-0.2f, 0.1f) // so that the normal (front-face) is facing you GlVertex2f(-0.8f, 0.1f) // Define vertices in counter-clockwise (CCW) order ![]() GlClear(GL_COLOR_BUFFER_BIT) // Clear the color buffer with current clearing color // Define shapes enclosed within a pair of glBegin and glEnd Call back when the window first appears and #include // GLUT, include glu.h and gl.h /* Initialize OpenGL Graphics */ * Draw Simple 2D colored Shapes: quad, triangle and polygon. * GL02Primitive.cpp: Vertex, Primitive and Color Try building and runnng this OpenGL C/C++ program: Vertex, Primitive and Color Example 2: Vertex, Primitive and Color ( GL02Primitive.cpp) A standalone utility called " glewinfo.exe" (under the " bin" directory) can be used to produce the list of OpenGL functions supported by your graphics system. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform." Source and pre-build binary available at.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |