From Glut to DLL?

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.

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).]

Hmm. Intresting, where i could find more info about this topic?

Your other choice is to use SDL (Sound device lib 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:
[b]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.[/b]

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

Well… Could someone tell me how to do it on linux and how on windows?

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.

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).]