Jump to content
  • Advertisement

Archived

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

GekkoCube

OpenGL NeHe's windows opengl samples.

This topic is 5991 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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! ~

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!