Thread: Getting Started Making a Screensaver

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    30

    Getting Started Making a Screensaver

    I have been researching how to create a very basic GUI application in C++ with the intent of eventually making a basic game, such as pacman or tetris. I have a lot to learn about C++, and I have everything to learn about game libraries and APIs. I have decided that making something even more basic than a simple game is best for me at this point, but I want it to be something graphical, and potentially even animated (if not in the first phase, at some point later). I have decided to attempt to make a screensaver, as a screensaver can have graphical complexity, but can still be more simplified than a game since it requires very little user input (as well as no sound or AI). I would argue that the most basic screensaver imaginable would be about the most basic graphical application one could develop.

    I know that many screensavers are created using C/C++ as their general language and DirectX or OpenGL as their library/API. These are all languages and libraries I would like to learn, and of course I would like to learn many others. I am definitely going to stick with C++ for this task, but what libraries should I attempt to use if I have never done anything like this before? How should I even begin this task if I have never made a GUI? Should I do something even simpler than a screensaver for this to be the most affective learning experience?

    Note: I am not limited to any particular platform.

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Speaking about your thread's title, you don't need a GUI to make a screensaver.

    The trick of a screensaver is to protect the screen ( surprise!! ), by making sure that not even one pixel onto the monitor stays unchanged. A screensaver should be light-weight, meaning that it shouldn't heat up the CPU or GPU when running.

    About games, if you want to make something that has "graphical complexity" as you say, you should pick a graphics API ( OpenGL, Direct3D, SDL ) or a graphics engine ( Orge3D, Irrlicht, Unreal ), a 3D modeling and animation tool ( 3D Studio, Anim8or, 3D Blender ) or make a graphics engine and a 3D modeling and animation tool by yourself and stick with it!

    Hope i helped.
    Devoted my life to programming...

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    30
    Regarding the screensaver concept, I am not necessarily trying to make something that is intended to be used as a screensaver, meaning that it would necessarily preserve the screen, be energy efficient, and so forth. All I really wanted to do was display an image or an animation on the screen.

    Having a final product that resembled an actual screensaver in appearance and functionality would be a worthy goal for learning how to use these APIs and other libraries though.

  4. #4
    Registered User
    Join Date
    Oct 2010
    Posts
    30
    I was just recently thinking a great way to get started doing this would be to find some open source screensavers out there and try and figure out how they work or how to modify them. I would imagine almost every Linux screensaver available would generally be open source.

  5. #5
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    I think that if you are essentially looking at just displaying images then unless screensavers per se hold some special interest for you, i would not go looking for code on them.
    The best thing you could do is get a library like SDL and learn it, vsit the lazy foo tutorial pages, it starts from scratch with SDL and providing you have a grasp of programming to start with then you will be up to speed in no time. If you just wanted to do that 'screensaver' idea then it is as simple as

    initialise SDL Video
    Get a surface (and run as full screen)
    load your image
    blit to memory (block image transfer - common 2d graphics method, SDL has built in functions to do this)
    refresh screen.

    all these things are fairly straightforward in SDL
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  6. #6
    Registered User
    Join Date
    Oct 2010
    Posts
    30
    Thanks for the reply, I'm gonna go try exactly what you recommended and see where I end up.

    Also, for anyone out there who is looking to do the screensaver approach, I discovered that the source code for the "Flurry32" screensaver is available on sourceforge, (among that of many other screensavers). Flurry32 is a screensaver for Windows which is based off of the "Flurry" screensaver for OS X. It's written in C++, which meets my personal criteria, and it uses OpenGL.

    Honestly, just browsing through the source code, Flurry32 seems a bit overwhelming at first glance. The OpenGL parts of it are definitely foreign to me.

    I also learned that, while using Windows, if you have a "Screensaver" file (which is simply a .scr file), and you place it in the C: > Windows > System32 folder, it becomes available as a screensaver for the user to select in their screensaver options. Most of you guys probably already knew that, but I thought I'd still mention it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. making sprites
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 02-20-2010, 07:00 AM
  2. thinking about making a network traffic monitor
    By jimjamjahaa in forum C++ Programming
    Replies: 9
    Last Post: 10-13-2005, 11:38 AM
  3. Making a screensaver, and need help
    By Finchie_88 in forum Windows Programming
    Replies: 0
    Last Post: 10-25-2004, 12:24 PM
  4. Making control...
    By Finchie_88 in forum C++ Programming
    Replies: 2
    Last Post: 09-07-2004, 01:42 PM
  5. Making a Compiler in C++
    By rqcompiler in forum C++ Programming
    Replies: 0
    Last Post: 04-21-2002, 11:54 AM