Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: dual monitor question  (Read 6859 times)

0 Members and 1 Guest are viewing this topic.

jeroen clarysse

  • Newbie
  • *
  • Posts: 12
    • View Profile
dual monitor question
« on: April 16, 2013, 11:28:05 pm »
we're writing an application for a psychology research program where we want to dispay information to the subject of a test. While this info (images mainly) is displayed, we also want to show info on a second monitor where the researcher is following the experiment (in another room)

i have 3 questions :

- how reliable can the images be presented to the subject in terms of timing ? Is this hardware acceleration fast enough that, when I "draw" to the screen, the image is visible within one refresh rate ?
- how fast does the execution return to the code ? I.e. when I draw to the screen, how long will it take for the drawing  to complete ? I assume this is < 1 msec ? This is important since we need to check responses via the parallel or serial port every millisecond
- the most important question : can SFML handle this dual monitor setup ? I know that the manual specifies that there can be only one fullscreen window, but perhaps I can make one window fullscreen (the one for the subject) and the other window on the other monitor as big as the monitor resolution, so that it "looks" fullscreen. Is this possible ? Are there any speed repercussions ?

many thanks !


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: dual monitor question
« Reply #1 on: April 17, 2013, 08:06:34 am »
Quote
- how reliable can the images be presented to the subject in terms of timing ? Is this hardware acceleration fast enough that, when I "draw" to the screen, the image is visible within one refresh rate ?
If your application can run at the monitor's refresh rate (60 Hz), then you're sure that drawing (and everything else) won't take more than one refresh period.

Quote
- how fast does the execution return to the code ? I.e. when I draw to the screen, how long will it take for the drawing  to complete ? I assume this is < 1 msec ? This is important since we need to check responses via the parallel or serial port every millisecond
It depends. You should test it directly. But don't check only draw calls, it's display() which takes all the time, since OpenGL is an asynchronous API.

Quote
- the most important question : can SFML handle this dual monitor setup ?
Nop :)
Laurent Gomila - SFML developer

jeroen clarysse

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: dual monitor question
« Reply #2 on: April 17, 2013, 10:14:10 am »

Quote
- the most important question : can SFML handle this dual monitor setup ?
Nop :)
[/quote]

dang... that's a shame :-(

is there any chance that dual monitor support will be added in the NEAR future (4 months ) ? Otherwise I will have to fall back to SDL, where version 2 apparently has dual monitor support. I would prefer to use SFML though : it seems more simple and intuitive, and the F in the name makes it way cooler :-)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: dual monitor question
« Reply #3 on: April 17, 2013, 10:21:27 am »
Quote
is there any chance that dual monitor support will be added in the NEAR future (4 months ) ?
I don't think so.

But you should be able to create your two windows correctly, it's just that you won't be able to put each on its own monitor with code, you'll have to move them manually.
Laurent Gomila - SFML developer

jeroen clarysse

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: dual monitor question
« Reply #4 on: April 17, 2013, 10:24:53 am »
But you should be able to create your two windows correctly, it's just that you won't be able to put each on its own monitor with code, you'll have to move them manually.

hm... if they are fullscreen, there is no way to move them, is there :-)

i'm still conflicted... I prefer using SFML over SDL, but I need the dual monitor stuff (the 2nd monitor shows graphs from a data acquisition card). I can't expect the researchers to drag windows around every time they launch the software... decisions, decisions...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: dual monitor question
« Reply #5 on: April 17, 2013, 10:35:22 am »
I usually don't suggest that, but you could also use som OS specific functions to move windows around, but I'm not sure if you can have two fullscreen SFML "windows" on two monitors. (You could simply test it) ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: dual monitor question
« Reply #6 on: April 17, 2013, 10:42:52 am »
SFML allows only one window to be in fullscreen mode. But you can create the second at the size of the monitor and with no decoration, to fake a second fullscreen window.

Using OS-specific functions or modifying SFML is also a valid option. It wouldn't require too much work, if you just implement directly what you need.
Laurent Gomila - SFML developer

jeroen clarysse

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: dual monitor question
« Reply #7 on: April 17, 2013, 10:58:12 am »
thanks for the replies (both of you)... i have new questions :

- Laurent said "you'll have to move them manually". Is there no way to do this programmatically ? So that the user doesn't need to actually click&drag ? That would solve it !

- has anyone ever used the OS-specific functions ? Is there any sample code out there ?

- what on macos X ? On most mac apps, going fullscreen completely shuts down the 2nd monitor (one of the most ackward design decisions apple has ever made). Does the SFML "fullscreen" also have this restriction ?

guys, you are way too helpful : now I'm even more in doubt as to wether I should use SFML or SDL !

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: dual monitor question
« Reply #8 on: April 17, 2013, 11:11:10 am »
Quote
- Laurent said "you'll have to move them manually". Is there no way to do this programmatically ? So that the user doesn't need to actually click&drag ? That would solve it !
You can do it, and I guess it would work on an extended desktop (i.e. when X > width_of_first_monitor, things appear on the second monitor). I have never tested it, so I can't tell you for sure. And it also probably depends on the OS.

Quote
- has anyone ever used the OS-specific functions ? Is there any sample code out there ?
You first need to define precisely what functions you need, which are not implemented in SFML.

Quote
guys, you are way too helpful : now I'm even more in doubt as to wether I should use SFML or SDL !
SDL 2 is great, you should give it a try.
Laurent Gomila - SFML developer

jeroen clarysse

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: dual monitor question
« Reply #9 on: April 17, 2013, 11:41:46 am »
Quote
You can do it, and I guess it would work on an extended desktop (i.e. when X > width_of_first_monitor, things appear on the second monitor). I have never tested it, so I can't tell you for sure. And it also probably depends on the OS.


Would there be no speed penalty ? I need Win and Mac platform...

Quote
Quote
- has anyone ever used the OS-specific functions ? Is there any sample code out there ?
You first need to define precisely what functions you need, which are not implemented in SFML.

well... i just need 2 fullscreen monitors :-) I'm not sure which OS specific calls are needed. It kind of surprises me that so few people need it ! I mean, almost all desktops today have dual video, and most laptop users attach an extra screen. So It really surprises me how few programs actually tap into that potential !

Quote
Quote
guys, you are way too helpful : now I'm even more in doubt as to wether I should use SFML or SDL !
SDL 2 is great, you should give it a try.

noooooooo ! You are torturing me !!
« Last Edit: April 17, 2013, 12:12:52 pm by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: dual monitor question
« Reply #10 on: April 17, 2013, 12:16:06 pm »
Quote
Would there be no speed penalty ? I need Win and Mac platform...
How could there be speed penalty? Once your windows are configured correctly, your app always runs the same way as before.

Quote
well... i just need 2 fullscreen monitors :-) I'm not sure which OS specific calls are needed. It kind of surprises me that so few people need it ! I mean, almost all desktops today have dual video, and most laptop users attach an extra screen. So It really surprises me how few programs actually tap into that potential !
Quote
noooooooo ! You are torturing me !!
Since you want two fullscreen windows, which SFML is unable to provide but SDL is (have you checked?), and writing OS-specific code may end up being an endless task for you, especially if you know nothing about Win32/Xlib/Cocoa programming... use SDL.
Laurent Gomila - SFML developer

pinko64

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: dual monitor question
« Reply #11 on: May 04, 2013, 09:38:16 pm »
Could you launch two separate executables. One for both monitors? And do some tricky code to make them (programs) connected.

TobyKaos

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • http://aubrun.thibaut.free.fr
Re: dual monitor question
« Reply #12 on: June 13, 2014, 04:13:16 pm »
I think it is possible and give a try to this.

I also want to launch two fullscreen windows on two monitor. SFML can't, but with some tricky process mmunication I think it is possible. right?

TobyKaos

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • http://aubrun.thibaut.free.fr
Re: dual monitor question
« Reply #13 on: June 13, 2014, 04:16:40 pm »
by pipe communication.

 

anything