OGL example not working

Started by
2 comments, last by Caesar 22 years, 2 months ago
I''ve just started learning OpenGl (using OpenGL SBible) and I couldn''t get this working. It''s nearly the same as the second example in the book (colors changed) but it doesn''t work properly. Just the first two gl... commands executed. What''s wrong?
  

#include<windows.h>
#include<gl\gl.h>
#include<gl\glaux.h>
#include<conio.h>

void main()
{
    auxInitDisplayMode(AUX_SINGLE | AUX_RGBA);
    auxInitPosition(100,100,250,250);
    auxInitWindow("My first OpenGL Program");

    glClearColor(1.0f,0.0f,1.0f,1.0f);
    glClear(GL_COLOR_BUFFER_BIT);

    glColor3f(1.0f,1.0f,0.0f);
    glRectf(100.0f, 150.0f, 150.0f, 100.0f);

    glFlush();

    getch();
}

  
Thanks
Advertisement
That seems too simple, I don''t know about that auxInit stuff but when I make an OGL app I make a Win32 app that uses OGL. check out the nehe tutorials at nehe.gamedev.net
The aux stuff is a standard part of OGL and should provide some platformspecific routines (ie. creating the windows under Win32 etc) to ease the use for begginers
The aux stuff is ancient - I don''t think the library gets updated anymore.

If you are looking for platform independent & easy init. stuff try glut.

-Mezz

This topic is closed to new replies.

Advertisement