tags:

views:

449

answers:

5

How exactly would one go about getting an OpenGL app to run fullscreen straight from the terminal (Ubuntu Server 9.04)? I've developed an application for visual diagnostics on my server, but, I'm not totally sure the best way to get it to run in a windowless environment.


Ideally, I would run my program:

./visualdiagnostics

and have that launch the OpenGL app. Then, via a simple Ctrl+X key binding, I'll kill the app and go back to the terminal.


Do I need to install X11 and then somehow launch it from within the program? What would be the best way to detect if it's already running and, start/stop it if necessary?

And FYI: No, I'm not trying to get this to run over Putty or anything... I have a monitor hooked straight up to the server. The server has proper video drivers installed.

A: 

Are you trying to have the video be on the monitor connected directly to the computer?

Is X running on the server?

If X is running, you can do

  export DISPLAY=:0.0

which tells X apps to connect to the X server at localhost, rather than where' you're coming from.

If you're actually logging in locally (from a direct terminal) ... yes, you need X installed and running.

Milan Ramaiya
A: 

And if X is not running, you can just start it with xinit, or directly. Check the relevant man pages ("xinit" and "Xserver").

Andy Ross
+2  A: 

Well I am clearly not sure my answer might help you out.

Long ago when I was student, I manage to do so (launching an openGL app from a terminal only linux installation) by installing frame buffer. As long as I remember I needed to recompile my kernel (as framebuffer was/is a kernel module).

This was maybe 5 years ago on a debian distrib, and I don't know how does it work now for up-to-date debian distrib as Ubuntu. Maybe framebuffer is compiled statically in the binary kernel provided by default with Ubuntu. May be not. Maybe framebuffer is irrelevant now... Or I may be totally wrong and not remembering every details of my own adventure 5 years ago now ..

Have a look on Google ! ;-)

Hope it will help...

**

Update:

**
What is frame buffer ?
How to install it? Here or there

yves Baumes
+1  A: 

As yves pointed out, you can avoid running the X server if you use the framebuffer. Actually, the framebuffer modules are often yet available (for example, they are used to have the tux logo during the kernel start or a text terminal with fancy images in the background), this anyway depends on the distribution and the settings you are using.

The kernel side is quite primitive so I'd suggest to use some higher level library such as DirectFB. The framebuffer is usable without problems but don't expect the same maturity level than a full blown X server.

ntd
+3  A: 
jhs
You sir, are my hero. Perfect and beautiful answer. And yes, I meant "console" instead of "gnome-terminal" :P Thanks for spending the time to write out such a great response.
brianreavis
You're very welcome! To tell the truth, I already knew most of it from a previous project. I guess that's the benefit of this site!
jhs