>>58156991
here's the whole file
#include <cstdio>
#include <GL/glew.h>
#include <GL/freeglut.h>
double mouse_x = 0,
mouse_y = 0;
void mouseMove( int x, int y ) {
mouse_x = x;
mouse_y = y;
}
void renderScene( ) {
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
double x = ( mouse_x / 320 - 1 ),
y = -( mouse_y / 140 - 1 );
glBegin( GL_TRIANGLES );
glVertex3f( 0, 0, 1 );
glVertex3f( 1, -1, 0 );
glVertex3f( x, y, 0 );
glEnd();
glutSwapBuffers();
}
int main ( int argc, char** argv ) {
glutInit ( &argc, argv );
glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB );
glutInitWindowPosition ( 1100, 100 );
glutInitWindowSize ( 640, 280 );
glutCreateWindow ( "GL_VERSION" );
glutDisplayFunc( renderScene );
glutPassiveMotionFunc( mouseMove );
glutIdleFunc( renderScene ) ;
glewInit();
printf( "OpenGL version supported by this platform: (%s) \n", glGetString( GL_VERSION ) );
printf( "GLSL version supported by this platform: (%s) \n", glGetString(GL_SHADING_LANGUAGE_VERSION ) );
glutMainLoop ( );
return 0;
}
currently looking into SDL, but I don't think it will help that much. Gonna look into GUI libs later