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.
...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.
Even if SDL is not 'allowed' for whatever you're doing, you can still look at the SDL sources for window creation, no ?
Any more smart ideas?
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.
look into source code of sdl and learn how it's made
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
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 ?
Psc was faster. Psc80, one point :D
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.)
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.)
we use glfw, http://glfw.sourceforge.net/
creates windows on linux, mac, windows. and maybe more I dunno, but it kicks ass.
creates windows on linux, mac, windows. and maybe more I dunno, but it kicks ass.
### SDL, ftw ###
I don't know why I don't want to use SDL. I've found some X11 code somewhere.
glut? it sucks, but with a certain viewpoint, it rules, too.
Maybe he wants to make a 4k, in which case all of the frameworks are out.
Listen to thec, use GLFW..
Or rip the sources you need out from there... Simple lightweight and just nice..
Or rip the sources you need out from there... Simple lightweight and just nice..
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.
I want something like window's QueryPerformanceCounter and family. Don't ask me to check wine's source.
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.
Anyway, gettimeofday() should be enough for general use, if you need more precision than 10us, take a look at clock_gettime/clock_getres.
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...
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...
you want google for GLUT
and the package is libxxf86vm-dev , as noted in the source.
I have something similar to that now. Does your thing have time control? FPS and such.
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...
If you had done that you would realize that it comes with timers, input control and such...
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
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