X Windows

Hello,

I’m a programmer new to Linux. I am trying to make an OpenGL grphics application that can be run from the textmode-shell without the need of starting any windowing desktops like GNOME or KDE. Is it possible to make the application start/connect to X server and switch from text to graphics mode?
(Like the god OS DOS)

Thanks.

You usually need to start the X server manually in order to use it (at least most people would want it that way).

It IS possible to start the X server without using any window manager at all. It’s a bit “dangerous” though, since you have absolutely no control over the windows other than from you program (meaning that your program must not fail).

I’m not sure what you should call to start the X server (if you run ‘startx’ you usually get a full startup - at least that’s the common case). I suppose you can actually check if you can get an X11 connection with usual X11 calls from your program. If it fails you could start up the X server in a separate process and wait for it to come “alive”, run your program, and then terminate the X server process. Haven’t tried it…

If I were you, I would forget “DOS-style” though - it’s dead!

Sidenote: You may want to try GLFW , which gives you all the X11 window handling etc, “for free” (you don’t have to worry about X Window coding etc).

[This message has been edited by marcus256 (edited 05-14-2003).]

Thanks for your help.
The reason I love the DOS way is speed. It’s fast like hell. Once u run the process, it takes the control the whole system resources.

My guess is that you can start Xserver with a terminal only - simply create a file called .xinitrc in your home directory and put inside but a single line :
xterm
this will start xterminal without going into window menager stuff.
The same way you can use to start your app.
Just my 5cents

I have never used it, but I believe SVGAlib doesn’t use X.
<www.svgalib.org>

cheers
John

Originally posted by wis mak:
Thanks for your help.
The reason I love the DOS way is speed. It’s fast like hell. Once u run the process, it takes the control the whole system resources.

That’s not really an issue. With a system such as Linux, you will usually get >98% of the CPU time (and 100% of the GFX card time if you run OpenGL in fullscreen). On a 1 GHz system you will not miss those last 1-5% of CPU processing power.

Of course, if you are running a heavily loaded web server or something similar in the background it’s a whole other story, but that’s not a fair comparison (you can’t do that under DOS anyway).

Thanks for your help.
The reason I love the DOS way is speed. It’s fast like hell. Once u run the process, it takes the control the whole system resources.

This may be true for dos but it is certainly not true for unix. Unix is a multitasking OS regardless of wether you’re running a windowing system or not.X is not a different OS or something like windows is. Try running “ps aux” under the shell to see what processes are currently running.Anyway better forget about it as it’s not going to make any noticeable difference as marcus said and start thinking how you can make the application itself faster.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.