viewsfere.blogg.se

Opengl projects with source code
Opengl projects with source code





* Main function: GLUT runs as a console application starting at main() */ GlBegin(GL_QUADS) // Each set of 4 vertices form a quad GlClear(GL_COLOR_BUFFER_BIT) // Clear the color buffer (background) // Draw a Red 1x1 Square centered at origin GlClearColor(0.0f, 0.0f, 0.0f, 1.0f) // Set background color to black and opaque Whenever the window needs to be re-painted.

opengl projects with source code

Call back when the window first appears and #include // GLUT, include glu.h and gl.h /* Handler for window-repaint event.

opengl projects with source code

* To compile with -lfreeglut -lglu32 -lopengl32 * Tested under Eclipse CDT with MinGW/Cygwin and CodeBlocks with MinGW * GL01Hello.cpp: Test OpenGL/GLUT C/C++ Setup Make sure that you can run the " GL01Hello.cpp" described in " How to write OpenGL programs in C/C++", reproduced below:

opengl projects with source code

  • How to write OpenGL|ES programs in Android.Įxample 1: Setting Up OpenGL and GLUT ( GL01Hello.cpp).
  • How to write OpenGL programs in Java: JOGL or LWJGL.
  • To set up OpenGL, depending on your programming platform, read:







    Opengl projects with source code