NeHe's windows opengl samples.

Started by
2 comments, last by GekkoCube 22 years, 1 month ago
First of all, using NehE''s opengl tutorials are a perfect way to dive into opengl! i noticed that all his examples have a winmain(), windproc()...etc (all windows specific functions). So obviously those programs wouldnt work for other platforms, like linux...or would it? ~ I am a DirectX to OpenGL convert! ~
Advertisement
quote:Original post by GekkoCube
First of all, using NehE''s opengl tutorials are a perfect way to dive into opengl!

i noticed that all his examples have a winmain(), windproc()...etc (all windows specific functions).

So obviously those programs wouldnt work for other platforms, like linux...or would it?

~ I am a DirectX to OpenGL convert! ~


nope, that would only work in windows

A CRPG in development...

Need help? Well, go FAQ yourself.

Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
If you need basic cross platform support, such as for a class that requires you to run on Unix and you want to do your homework on windows, use glut.

http://www.opengl.org/developers/documentation/glut/index.html
It all depends, if you realy want to use the "same" code for cross platform you can use SDL. But still there is always a few minor platform issues... You will notice all of the projects on the SDL site have a score indicating how compatible the project is with a specific platform...

Also, all the tutorials at NEHE are ported to different platforms. The initial release is for Windows and then other do the proting... At the bottom of each project where you download the project, you should notice the links to the different ports...

In theory any OPENGL function call should work exactly the same on any platform. The function call specifics is per language though. So if you wrote you app using c/c++ for windows, you would be able to take the OPENGL rendering code and recompile it for any compiler/platform supporting c/c++. Of course you would need opengl implementation for that platform.

Example (Draw a triangle):
The below c code should compile on windows, unix etc.. provided the programming enviroments are set up correctly (libraries, compiler options...)

glLoadIdentity()
glTranslate(...);
glBegin(GL_TRIANGLES);
glVertex3f(...);
glVertex3f(...);
glVertex3f(...);
glEnd();

As for other languages you just use the calling conventions for that language.

Edited by - ANSI2000 on February 20, 2002 1:47:56 PM

This topic is closed to new replies.

Advertisement