pouët.net

Go to bottom

How can I open a fullscreen OpenGL window on Linux?

category: general [glöplog]
How to open a fullscreen OpenGL window on Linux?
...it should be a lot easier to find that. Either I don't know where to search for it, or it's hard to find. No SDL allowed.
added on the 2009-02-07 22:23:14 by xernobyl xernobyl
Even if SDL is not 'allowed' for whatever you're doing, you can still look at the SDL sources for window creation, no ?
added on the 2009-02-07 22:25:21 by snoutmate snoutmate
Any more smart ideas?
added on the 2009-02-07 22:32:09 by xernobyl xernobyl
freeglut
you could have a look at the native X11 opengl window creation source from nehe. i'm not 100% sure it handles fullscreen though, it was long ago i used this.
added on the 2009-02-07 23:13:19 by nystep nystep
look into source code of sdl and learn how it's made
added on the 2009-02-08 00:06:34 by psc80 psc80
get the sourcecode here http://www.libsdl.org/release/SDL-1.2.13.tar.gz anyway, i think it will be easier for you to use it and for free it will run on other operating system like macos
added on the 2009-02-08 00:09:35 by psc80 psc80
Quote:
Any more smart ideas?


Snoutmate is right though.

SDL's source is available, why don't you just take a look at it to understand how it handles those things ?
added on the 2009-02-08 00:09:46 by keops keops
Psc was faster. Psc80, one point :D
added on the 2009-02-08 00:10:24 by keops keops
errm, Tiago, why would you want to not use SDL under Linux?

Some time ago, I have written my own X11 lib ("libdx", ported to Win32, Linux, Solaris and Irix) before I started using SDL 8 years ago. Trust me, you don't want that ;) (way too much effort involved and you need to frequently keep it up to date because Linux is an ever-changing "target")

Isn't SDL "a given" in Linux intros/demo compos, anyway ? (I mean, similar to what DirectX is under Win32.)
added on the 2009-02-08 00:17:10 by xyz xyz
we use glfw, http://glfw.sourceforge.net/

creates windows on linux, mac, windows. and maybe more I dunno, but it kicks ass.
added on the 2009-02-08 00:55:30 by thec thec
### SDL, ftw ###
added on the 2009-02-08 02:47:33 by bdk bdk
I don't know why I don't want to use SDL. I've found some X11 code somewhere.
added on the 2009-02-08 02:53:43 by xernobyl xernobyl
glut? it sucks, but with a certain viewpoint, it rules, too.
added on the 2009-02-08 07:04:32 by blala blala
Maybe he wants to make a 4k, in which case all of the frameworks are out.
added on the 2009-02-08 08:39:13 by sol_hsa sol_hsa
Listen to thec, use GLFW..
Or rip the sources you need out from there... Simple lightweight and just nice..
added on the 2009-02-08 12:44:25 by gnilk gnilk
What about time control? What should I use?
I want something like window's QueryPerformanceCounter and family. Don't ask me to check wine's source.
added on the 2009-02-11 03:54:36 by xernobyl xernobyl
You can check GLFW sources :-P

Anyway, gettimeofday() should be enough for general use, if you need more precision than 10us, take a look at clock_gettime/clock_getres.
added on the 2009-02-11 05:13:20 by snoutmate snoutmate


You can use the well known glut, or ...

Here is my fullscreen GLX opening, working on some recent ubuntu

Yet, from ubuntu you have to download some more dev packages to be able to use the screen ID stuffs... I don't remember the names of the dev packages, yes I should trace a correct pack dependency for this. Note I had to recode all this in 2006 because some linux video packages changed. (when I switched from mandrake to ubuntu, but it's more compatible now)

the .cpp source up there is from some SDL equivalent I did (for my own portable machine), First, it came from some nehe startup if I'm correct, but there are improvements, like a code to have invisible mouse.

What does it do ? basically it asks for all screen modes available for your linux, open a fullscreen using one of then, set up a gl context for it.
Note: its superclass is just a basic common GL init with some glEnable().

There is also a sound server that is able to play a sound signal in the same cpp...
added on the 2009-02-11 09:48:54 by krabob krabob
Quote:
Yet, from ubuntu you have to download some more dev packages to be able to use the screen ID stuffs...

I wanted to mean:

Yet, from ubuntu you have to download some more dev packages to be able to COMPILE the screen ID stuffs...
added on the 2009-02-11 09:50:01 by krabob krabob
you want google for GLUT
added on the 2009-02-11 09:50:52 by Silicium Silicium
and the package is libxxf86vm-dev , as noted in the source.
added on the 2009-02-11 09:51:26 by krabob krabob
I have something similar to that now. Does your thing have time control? FPS and such.
added on the 2009-02-11 15:17:58 by xernobyl xernobyl
You never considered taking a look at GLFW or even read up what it was and what it provides?
If you had done that you would realize that it comes with timers, input control and such...
added on the 2009-02-11 16:30:26 by gnilk gnilk
How do I hide the mouse?
From what I understand X11 has no such function and you need to make some hack by replacing the cursor with a transparent one. That can't be the only solution, is it? :S
added on the 2009-02-16 14:27:53 by xernobyl xernobyl

login

Go to top