PDA

View Full Version : From Glut to DLL?



runggu
09-20-2002, 05:08 AM
Hi!

I'm making my little opengl program. And untill now, i've been using glut. But now i'm decided to make it pure gl.

So how to:
1.Set up double buffer and dump it to screen.
2.Set up fullscreen mode
3.Get keyboard input

And please notice. I'm making my program easily portable, so no DirectX please.

Deiussum
09-20-2002, 05:18 AM
Not using a library like glut, and portability are practically mutually exclusive goals. OpenGL itself has nothing that is operating system specific, like the creation of windows. For that you have to use operating specific methods, or libraries that hide that like glut or SDL. So if you want to do as you termed "pure OpenGL" and want it portable, you'll need to do a lot of #ifdef stuff to check the environment, and have different code for different operating systems in those blocks.

In Windows you do that with Choose/Describe/SetPixelFormat stuff, then use wglCreateContext. In Linux there are things similar to the SetPixelFormat stuff, but then you use glxCreateContext

[This message has been edited by Deiussum (edited 09-20-2002).]

runggu
09-20-2002, 05:21 AM
Hmm. Intresting, where i could find more info about this topic?

nexusone
09-20-2002, 05:49 AM
Your other choice is to use SDL (Sound device lib www.libsdl.org (http://www.libsdl.org) ), nice cross platform library for sound, keyboard, video setup. It is a good replacement for using instead of GLUT.

As another poster stated, each OS system has its own video setup structure, only with a lib like glut or SDL can you have easy crossplatform support.


Originally posted by runggu:
Hi!

I'm making my little opengl program. And untill now, i've been using glut. But now i'm decided to make it pure gl.

So how to:
1.Set up double buffer and dump it to screen.
2.Set up fullscreen mode
3.Get keyboard input

And please notice. I'm making my program easily portable, so no DirectX please.



[This message has been edited by nexusone (edited 09-20-2002).]

runggu
09-20-2002, 07:07 AM
Well... Could someone tell me how to do it on linux and how on windows?

Deiussum
09-20-2002, 09:39 AM
Take a look at the Nehe base code for how to do it on Windows. He might have an example for how to do it on Linux as well.

nexusone
09-20-2002, 10:48 AM
I thought we answered that queston?

GLUT run's on both windows, linux and Mac.
The same with SDL, windows, linux and Mac.

Nehe has SDL and glut examples of his tutors)

If you write your programs using ether, they then could be compiled to run on any other system supporting them.


Originally posted by runggu:
Well... Could someone tell me how to do it on linux and how on windows?



[This message has been edited by nexusone (edited 09-20-2002).]