Archived

This topic is now archived and is closed to further replies.

Caesar

OGL example not working

Recommended Posts

Caesar    126
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
Caesar    126
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

Share this post


Link to post
Share on other sites
Mezz    571
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

Share this post


Link to post
Share on other sites