Skip to main content
GameDev.net gamedev.net
🔒 Locked

Small problem

Started by Coffee Drinker Jul 29, 2001 at 1:00 AM 5 replies 550+ views
Original Post
Coffee Drinker
Coffee Drinker
hi there i''m writing my first 3d game and i feel quite excited about it. my tiny problem is that i can''t get rid of the taskbar after i switch the display mode (if the new resolution is same or higher then the current). does anyone know how to deal with this? also, i''ve always been wondering how to enumerate or check for all available OpenGL drivers on the system and if needed, switch to them. since this is my largest project so far and i''m new to opengl, i''m approaching it very carefully, considering all the details and stuff, so i''ll accept any kind of advice. do you think a nice 3d terrain, viewed from a bird''s eye could run smoothly on, say, a p3/500 with a voodoo3. the terrain will be viewed from a flying object, from high above, so i guess BSP trees and portals won''t speed things a lot. my best bet so far is view frustum culling. am i right about this? thanks Free your mind.
Free your mind.
Terran Marine
Terran Marine
I''m not sure about the taskbar...

You might want to apply fogging in order to decrease the viewing distance and gain performance.

merlin9x9
merlin9x9
The problem is that the taskbar is usually set to be a top-most window, which means that you must make your window top-most if you want it to overlap the taskbar. You''ll probably want to do this whenever your window is activated (you can handle it in either WM_ACTIVATE or WM_ACTIVATEAPP) to make sure that the window always gets put in front of the taskbar.

Good luck with your game!
merlin9x9
merlin9x9
That works, but only once. You have to make your window top-most every time it gains the focus, which is why I recommended doing it where you handle WM_ACTIVATE or WM_ACTIVATEAPP.

Think about it this way. The taskbar is (usually) a top-most window. Then you make your app a top-most window. How does Windows decide which one gets to be on top since they''re both top-most? It doesn''t—the only guarantee you have with a top-most window is that it will always be on top of non-top-most windows. So, in other words, whichever top-most window had the input focus last is the one that''s on top.

So, you just created your window, and since it gains the input focus, it''ll be on top. But let''s say the user Alt+Tab''s out of your app or otherwise switches. Or maybe another app steals the input focus. The taskbar will gain the input focus and become the one on top. Then you go back to your app, and the taskbar will still be on top.

So, again, you must make your window top-most every time your window is activated, and you do this by using, say, SetWindowPos with the value HWND_TOPMOST passed for the hWndInsertAfter parameter. As a nice side-effect, once you''ve done this, you won''t have to bother to create the window with the WS_EX_TOPMOST style since the window receives activation messages when it''s first created (though it doesn''t hurt to add the style anyway).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.