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

Author Topic: Screensaver  (Read 5188 times)

0 Members and 1 Guest are viewing this topic.

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Screensaver
« on: November 21, 2012, 03:33:04 pm »
Does anyone have any experience in creating screensavers on sfml ? I need to create a screensaver for my game, do I need to handle any special events ? Or just handle mouse/key down/move events and close window ?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Screensaver
« Reply #1 on: November 21, 2012, 04:06:46 pm »
I need to create a screensaver for my game
What? ???
Either I misunderstand the term 'screensaver' or your sentence doesn't make sense... ;D
What exactly do you understand with screensaver, specially in connection with your game?

Additionally I ask myself who's still using screensavers. :P
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Screensaver
« Reply #2 on: November 21, 2012, 04:11:20 pm »
I need to create a screensaver for my game
What? ???
Either I misunderstand the term 'screensaver' or your sentence doesn't make sense... ;D
What exactly do you understand with screensaver, specially in connection with your game?

Additionally I ask myself who's still using screensavers. :P

Well, i need to create screensaver for Windows and Mac, it has to be one of my game scenes with some animations. (Also shared resources and game states, no problem with this).

P.S. I'm sure nobody will use it, but our client wants it.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Screensaver
« Reply #3 on: November 21, 2012, 04:17:56 pm »
Well, i need to create screensaver for Windows and Mac, it has to be one of my game scenes with some animations. (Also shared resources and game states, no problem with this).
I still don't really get what your game has to do with the screensaver... Or do you want to show your game as screensaver?

Anyways you simply create a fullscreen window and draw whatever you like. If you want to use the OS specific entry points for screensavers, you'll have to do some research, otherwise you could simply check sf::Mouse::getPosition() and sf::Event::KeyPressed and if they don't change with a certain time span, create you window and as soon as they get used close it again.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Screensaver
« Reply #4 on: November 21, 2012, 04:26:03 pm »
Or do you want to show your game as screensaver?
Thats it

starmessage

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • View the moon phase and write your name in the stars
Re: Screensaver
« Reply #5 on: December 02, 2012, 08:33:11 pm »
If your screensaver is simple enough, you can use the screensaver maker tools that create automatically a new screensaver using a collection of pictures, or videos.

If you really want to build your own, both Win and Mac have functions to integrate your screensaver
In Win you include the lib scrnsave.lib and in mac, you subclass the screensaverView class and link to the screensaver framework.

win:
http://www.dreamincode.net/forums/topic/17214-write-your-own-windows-screen-saver/
mac:
http://cocoadevcentral.com/articles/000088.php

It is better to intergrate your screensaver instead of producing a standard executable that behaves like a screensaver:
- you control/select it via the OS control panel
- you define the time-out from the OS
- the native screensaver will not start during your emulated screensaver executable run.
- it will respect other programs that disable the starting of the screensavers

 

anything