PDA

View Full Version : OpenGL without X Windows



bozzao
05-23-2002, 03:30 PM
Hi,
what do I have to do to make a OpenGL application that runs in the console? Without X Windows.

Thanks

Fernando Fernandes

05-23-2002, 09:38 PM
You have to find some OpenGL implementation that can be run in the console. The only one that perhaps has hardware support is Mesa with Voodoo cards. I think that a more recent project without hw support exist but I do not know where to find it. The speed can not be compared with a "real" OpenGL implementation like nvidias but it will run in the console.

saian
05-23-2002, 11:33 PM
i think you have to use the frame buffer, this may be a good way.
hope someone else could give you more information.

amendol
05-24-2002, 05:46 AM
There was a project a while back to port the dri to the frame buffer (using SDL on the frame buffer). Do a search for fbdri. The posts should be on opengl.org, I believe that they only got it working with the ati radeon's but they said that it should work with others with minimal effort.

Jamie

bozzao
05-24-2002, 08:25 AM
I need a small and fast solution for 3D graphics. I have only 256mb of disk space (I am using a flash memory card) for the entire system. I am now using a celeron 900mhz. I can put about any video board I want.

Do you think that with this limitations I can run the X Windows with my open gl application with a hi performance? (it will be the only thing running in the machine so I donīt need anything else)

amendol
05-24-2002, 10:46 AM
Originally posted by bozzao:
I need a small and fast solution for 3D graphics. I have only 256mb of disk space (I am using a flash memory card) for the entire system. I am now using a celeron 900mhz. I can put about any video board I want.

Do you think that with this limitations I can run the X Windows with my open gl application with a hi performance? (it will be the only thing running in the machine so I donīt need anything else)

You may need some ram for X + you app, but it sounds like enough. You should get just fine performance with a good gfx card.

bozzao
05-24-2002, 11:15 AM
I have 256 of ram!

How much disk space does a full linux installation with X take?

My app have 100mb, more 32 of swap, leave me with 124mb of free disk space.

CopyCat
05-24-2002, 01:50 PM
Well...what dp you mean a full instalation ?
It depends on the distribution..
X takes about 30 mb of space ( plus minus )
With linux + basic packages + lighweght interface ( like WM ) you should do it in 100 MB os HW.
And besides that...swap is optional..
If you'r going to use it only for development, nothign more you don't have to make a swap partition ( especialy if you have 256 RAM ).

amendol
05-24-2002, 09:45 PM
You should look into one of the embedded linux distributions: hardhad, blue cat etc.

They easily fit in to less than you have.

Jamie

bozzao
05-27-2002, 03:52 AM
But does they suport X Window and OpenGL?

jide
05-27-2002, 04:51 AM
i don't think the embedded linux is the solution.
i don't think too, that not using the swap is a good solution. however, you could remake your linux kernel to manage r/w on the drive at the fly, instead of using the swap before. But you'll be confronted to a fragmentation of your partitions.

you could put 32Mo of swap
and 224 for your /

try to avoid installing the whole packages, try to limit. XWindow is one of the best solutions as far it's small (don't attempt to use KDE or Gnome or enlightenment). it's fast, too.
i think it's possible.

by the way, if you've 256Mo of ram, you could (it's a dangerous way if you don't know really) use the /dev/ram file as another partition. you will loose all whenever you reboot your system, but it can be a solution if your system need more disk space for compilation...

good luck

bozzao
05-27-2002, 05:10 AM
The application I am making is sort of game for, I donīt know the name in english but is that places where there are a lot of machines with games and pinballs. My game is sort of a Mortal Kombat and I wanna put it in a place like that. The sollution I made was using linux as the OS and openGL. Do you guys know that kind of machine is that they use for those games? Is it a regular pc?

Thanks

satan
05-27-2002, 08:46 AM
if you mean arcade machines then it's not a regular pc (or better i never heard of any)
mostly it's special hardware and a special os, too
i think you can compare them more to a game console than to an regular pc since they are optimized for their special usage (esp. graphics which are normally far beyond anything a pc can do and depending on the game special input devices, etc)

and if your game is a mortal combat clone you should better use all the nice little features of a geforce4 ti (or comparable) to have a chance against the highly optimized beasts standing next to your linux arcade http://www.opengl.org/discussion_boards/ubb/smile.gif

(btw i would be really interested in screenshots)


[This message has been edited by satan (edited 05-27-2002).]

amendol
05-27-2002, 08:02 PM
actually, an embedded linux distro is just what you are looking for!

An arcade system is really an embedded system. And if you are going to make more than one, and keep the cost down. Than the only solution is to spend a little time getting an embedded distro (or roll your own) to work with the libs that you need.

jide
05-28-2002, 01:08 AM
you don't need an embedded system for your arcade until you don't want to use an existed 'console arcade' and as far you don't want to make a real arcade for now.

I don't really know what's inside them, but it looks like big console, certainly some are more powerful than XBox.

if you use regular PC components, i think you'll avoid some incompatibilities. An arcade box is big enough to stand all these componants: a 17" monitor, a tower with motherboard... the only problem would certainly be the 'moneyer'.

In this case, you could use 2 hard drives (i know you only got one): it will permit to store your OS on one and the game on the other.

I think it's the most efficient solution for you.

I hope it will help. don't avoid to reply if you're not right with me !

bozzao
05-28-2002, 04:26 AM
Using a real pc doesnīt mean a big solution (in size :0) there are some motherboards for aaeon (www.aaeon.com) and they are realy small. They have a network board, pci, usb, everthing actualy. In some models (like the one I am using) you cam use a flash memory card instead of a regular HD (the acces is much faster and you will not have any problens of damaging it). And the coust is not that expensive (of couse a proprietary system that is made in great quantitie is much cheaper but that is just for big companys :0).

About my hd size I have a 256 now, but if I cant put everthing on it a can put a 512, no problem.

I think that using a embedded linux could help me using less memory, and maybe less processor. Again I will use OpenGL. So I need a compatible solution. Does embedded systens compatible with OpenGL and X windows? Because if it is I see no reason for not using it.

Another problem I faced is the filesystem. I was using Ext2 but the arcade machines are usualy shutdown just turnning everthing out, wich could cause me problem if any files in the system got corrupted. So, now I am using ReiserFS. It seams to be much trustable and harder to corrupt.

Well, I know this is not about openGL but I think it is very interresting for all of us :0)

amendol
05-28-2002, 05:31 AM
X windows will work with an embedded distro. The only difference with the embedded distro from the standard ones, is the focus on making things small + boot quick + maybe some realtime issues.

There are a several journaling filesystems out there now that can withstand a powerdown. I'm using sgi's xfs. It's nice. There are others though: ext3, jfs(IBM), reiser(SP?).

maybe more.

bozzao
05-28-2002, 05:40 AM
Thanks, I will look at those.

I realy think that a embedded distro is a good solution. I canīt see any bad points at it. Does anyone can?

jide
05-29-2002, 02:15 AM
no bad point, but just a remark:

you're not obliged to unmount a ext2 partition i order to have everything correctly saved. There is an option when you recompile your kernel. it's above the last pages when you use make xconfig.

jide
05-29-2002, 02:18 AM
... and you could jump to the opengl for embeded systems forum, just here. maybe you'll have anwers.

06-12-2002, 10:01 AM
I don't think that you should use an embedded ditrobution.

I reccomend that you do a "Linux from scratch". If you're not familiar with it, it means that you download all of the components of the os(kernel, shell, compiler, basic tools), and install them 1 at a time. You choose exactly what you want. Also, since you compile everything from scratch, it runs very fast because it is optimized for the hardware.

I recommend, that you build the system on another pc, and then strip it down to just a minimal shell and X windows. Total, it shouldn't be more than 70mb.

note: If you only want to run 1 program in X with opengl, then you don't need a window manager. Just execute the program in your .xinitrc file instead of the window manager.

For more information on Linux From Scratch: http://www.linuxfromscratch.org

bozzao
06-13-2002, 01:58 PM
>>Just execute the program in your .xinitrc file instead of the window manager.

How do I do that? Is there any place where I can find documentation?

How do I make a minimum X installation?

ssross
06-13-2002, 10:20 PM
My .xinitrc looks something like:

xloadimage -onroot -quiet bg.jpg
some_apps &
/usr/bin/sawfish

As mentioned, you don't _have_ to have a window manager but you could have keyboard focus problems without it. Your app may already handle focus in the absence of a window manager, if not look into XSetInputFocus.

The manpage for xinit has some discussion about .xinitrc

A couple of notes.
- If you use the graphical login, you need to use $HOME/.xsession instead of .xinitrc
- The script may have to be executable
- If you mess up in the script it can be hard to log in to fix it. I suggest having a second login with permissions to edit/delete the .xinitrc or .xsession file until you have it right.

06-13-2002, 11:17 PM
If you want to install a mininal X windows, then I think that your only option is to compile it from source. If you get a binary verision then it will probably contain hundreds of input and video drivers that you will not use.

About not using a window manager, just replace the line in .xinitrc that starts the wm to the program you want to run