Archived

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

Optimization with WM_ERASEBKGND??

This topic is 5377 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

In my windows message handler I decided to add a proc for WM_ERASEBKGND where I simply return a 0, so that any code for clearing the screen would be avoided (I''m rewriting the entire screen each frame), and I expected a modest FPS increase but, in fact, this caused a relatively negligable decrease in FPS.. but a decrease all the same. Any ideas why this would happen? My only idea was perhaps that DirectX already prevents WM_ERASEBKGND''s, so by manually preventing it I simply added a useless switch in my message handler. One further question about switch statements in particular: Are switch statements implemented in code with a binary search? I always assumed this was so and the reason you could not use any non-numeric values for a case statement.. If it is compiler specific I use studio.net.

Share this post


Link to post
Share on other sites