http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

TheGrumpyProgrammer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More help for an OpenGl Beginner.



Well, I am not familiar with AUX , but if you want simplistic console app openGL code, use glut instead of aux...
 
One thing ... I think you might have to "SwapBuffer"  look up that api... or swapbufferS  .. i forget.  If you really want good help for
beginning openGL, goto NEHE's examples.  Just search for openGL and NeHe and you'll find it.  
 
here is the address.. its the best site out there....  http://nehe.gamedev.net/opengl.asp
 
Good Luck!!  (Glut might be a bad habit to get into... try using windows  .. the console app thing is kinda odd)
 
Ben Humphrey
Humongous Entertainment
Game Programmer
benjina@mindspring.com
benh@humongous.com
----- Original Message -----
Sent: Saturday, May 06, 2000 4:21 PM
Subject: More help for an OpenGl Beginner.

Before anything I must thank everyone who helped me before in this list.Now, my question:
 
    I am using VC6 to compile the following OpenGl code. The problem is that it only creates a window with a black background and nothing else. Does anyone can tell me what should I do to make my rendering code really work?
 
#include "stdafx.h"
#include "windows.h"
#include "gl/gl.h"
#include "gl/glu.h"
#include "gl/glaux.h"
 
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib")
 

void CALLBACK MainLoop(void);
 
int main(int argc, char* argv[])
{
    auxInitDisplayMode(AUX_RGBA | AUX_DOUBLE | AUX_DEPTH);
    auxInitPosition(0, 0, 640, 480);
    auxInitWindow("Win32 OpenGL Console Application Test");
 

    auxMainLoop(MainLoop);
 return(0);
}
 
void CALLBACK MainLoop(void)
{
 glBegin(GL_TRIANGLES);
  glColor3f(1.0,1.0,1.0);
  glVertex3f(0.0,0.0,0.0);
  glVertex3f(1.0,1.0,0.0);
  glVertex3f(0.0,1.0,0.0);
 glEnd();
 
 glFlush();
}