views:

378

answers:

3

Hi!

I'm actually working on an app to display an image onto a Dome.

The dome projection system is constitued of two projector and a pc running a GentoO Linux and KDE, with nvidia TwinView system.

Since here i've used SDL to display a fullscreen windows, and it display my app onto the two screen.

But i just figured that i need to project two different images, one on each projector.

That's why i search for a solution to display a fullscreen window on the first screen (projector) and another on the second. But SDL fullscreen just extend the window to the two screens.

I can use any librairie (since it light and free, as i will wrap it into my small "API"), or change display setting. BTW it would be nice to have openGL support, since SDL manage only one window ^^"

A: 

My guess is that SDL (or rather OpenGL, or whatever it uses behind to display graphics) believes you have only one large screen.

Therefore, displaying two different things on the different screens doesn't make sense (because you only have one screen).

Maybe I'm wrong, but you should try to use separate X-desktops to do that. I'm not on my linux box right now, so I can't help as much as I would but If I remember well, there was an option to have two distincts desktops without having two differents X servers.

Another "solution" would be to calculate the coordinates/boundaries of your screens and to display things cleverly on your one emulated screen but:

  1. It's ugly
  2. Error prone
  3. I don't like it
ereOn
Refering to your comment: if you want to launch an app on a particular display, just use: export DISPLAY=:0.1 (or whatever display number you want) in a command line before you start the app.
ereOn
for the two different Desktop, yes i think it's possible, but again SDL can create only one window, so i cannot create two windows in fullscreen in different display. Would you happen to know a librairy that can display many windows easly, with support for OpenGl rendering, or even juste displaying an image (as i can create an array of pixel).
sirithang
I suppose you can do that using directly *OpenGL*. But I must admit that I'm surprised *SDL* can't do such a thing natively. You may also take a look at http://www.ogre3d.org/ but I don't know what you want to achieve.
ereOn
+1  A: 

I think I have a solution for you. You need to emerge everything involved with the 'xinerama' USE flag. Then set meta modes in your X config or using nvidia-settings for each screen. This makes your monitors look like one screen to the driver, but informs the window manager of your independent screen boundaries. Now you can drag back and forth from window to window, AND you can do and independent fullscreen on each. Yay!

Note: I have tested this successfully on Gnome, but not KDE yet.

Good Luck!

Edit: forgot to mention that then you still need to figure out how to get your application to be meta mode aware. :p

treewhopper
A: 

Nice trick but it is not really a solution.

You instead need use SDL 1.3 (not implemented on 1.2) and call the SDL_SelectVideoDisplay(index_of_mmonitor) (usually 0 for first monitor and 1 for second) so you can direct your SDL work output on your prefered screen (fullscreen or not).

Regards.

mg72