@Hans
Hi Hans,
In fact, I have an old OpenGL 1 book (english book).
I'd made some tests and learning a bit from book on how OpenGL. work.
I think I've understood now the basis of it.
Here is my first test that run well :
* OpenGL Sample #1
Show a simple box on the screen
*/
#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/* WHAT WE WANT TO DISPLAY ON SCREEN MUST BE ADDED IN THIS FUNCTION */
void My_glRendering( void )
{
glClearColor( 0.0, 0.0, 0.0, 0.0); /* Set backdrop as black */
glClear( GL_COLOR_BUFFER_BIT ); /* Clear the backdrop with glClearColor color */
glColor3f( 1.0, 1.0, 1.0 );
glBegin(GL_POLYGON) ;
glVertex3f( 0.25, 0.25, 0.0 );
glVertex3f( 0.75, 0.25, 0.0 );
glVertex3f( 0.75, 0.75, 0.0 );
glVertex3f( 0.25, 0.75, 0.0 );
glEnd() ;
glFlush();
}
/* SOME INITIALIZATIONS HERE */
void My_glInit( void )
{
glMatrixMode( GL_PROJECTION );
glLoadIdentity() ;
glOrtho( 0.0, 1.0, 0.0, 1.0, -1.0, 1.0 );
}
/* MAIN C PROCEDURE STARTUP-SEQUENCE IS HERE */
int main(int argc, char** argv)
{
glutInit(&argc, argv); /* Initialize Glut */
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); /* Define display mode properties such as single buffer, color mode and */
glutInitWindowSize( 640, 480 ); /* define the sizes of the window to create */
glutInitWindowPosition( 300, 300 );
glutCreateWindow("AmiDARK Test Window"); /* Create the final rendering window */
My_glInit();
glutDisplayFunc( My_glRendering );
glutMainLoop();
return 0;
}
I'm also beginner in C / C++ coding ...
[EDIT]
Thank you hans for all informations and help :)
Edited by freddix on 2009/2/13 19:00:40