DirectX and Screensavers

Started by
4 comments, last by Fordy 22 years, 2 months ago
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.
Advertisement
P.S.

Sorry about the multiple posts, this forum is a little more sensitive than I am used to
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
how do you go about using the screen saver library? i''ve never heard of it...


thanks
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.
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

This topic is closed to new replies.

Advertisement