The sample tutorials are not Windows programs. They seem to be console programs. However when I try to compile them they do give an error in Visual C++ 6.0. I’m running WindowsXP.
Can someone explain why I can’t use OpenGL in console programs and why are the tutorial programs written like that?
This example is written for Linux X windows, not windows:
Requires a library called Tk which may not be a version of it written for windows, need to check on it though.
Also the examples on that webpage are also almost 7 years old.
If you want a good source for openGL under windows, nehe.gamedev.net is a good resource.
Your bit of code:
#include <gl\gl.h>
void main()
{
// You have a empty main with no window opening commands!
}
This is not enought code to do anything, you also need to have code in which to open a window. OpenGL has no windowing commands, it is strictly a drawing API. So you ether need to open a windows with Native windows code or a API like GLUT.
[This message has been edited by nexusone (edited 02-04-2004).]
“This example is written for Linux X windows, not windows” - well, put it this way: that error is because windows gl headers depend on windows.h. If it is a linux program, then odds on it wont compile under VCPP as it lacks the Linux windowing headers etc.
I don’t mean this in a patronising way, but are you sure you have a windows port there?