Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Fordy

DirectX and Screensavers

This topic is 6106 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As my first DX program, I thought I''d build a simple screensaver with the standard Screen Saver Library. I have done other simple screensavers with GUI, but I have had problems when trying to do the same with DX. As soon as I shift into Direct Draw 4 and attach my surface, the screensaver closes. I did some experimentation and found the cause was that my app was bombarded with WM_MOUSEMOVE messages as soon as the WM_ERASBKGND message was recieved. As mouse movements are critical to a screensaver I had to work around by using a custom windows class that fed another windows procdure. This procedure then disregarded WM_MOUSEMOVE and used Direct Input to test if the mouse had indeed moved. If so, I sent a WM_CLOSE to the ScreenSaverProc() and closed. It works now, but I know I am working around a problem I know nothing about and that bothers me a little Has anyone had any experience with this situation? if so, how did you overcome it and is it better than the method I used? Any help would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
P.S.

Sorry about the multiple posts, this forum is a little more sensitive than I am used to

Share this post


Link to post
Share on other sites
Doh.....figured it out....

The change in modes moves the mouse even though the screensize stays the same, therefore I disregard WM_MOUSEMOVE for 2 seconds on initialisation and then allow the WindProc() to do the normal thing with them.......works AOK now & code is cut down a lot

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If anybody has any info about how to make a DX program into a screensaver I''d like to hear about it too - any links etc would be great.

Share this post


Link to post
Share on other sites
There''s a scrnsave.lib with the windows SDK.

Use it and implement the following 3 funcs

ScreenSaverProc()//a simple callback func to implement your work

ScreenSaverConfigureDialog()//a dialog proc for the settings applet in the display properties

RegisterDialogClasses()//for setting custom Windows Classes


Look it up on MSDN as there''s a lot more than I have detailed. If I ever get it working nicely I will post the code

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!