Skip to main content
gamedev.net
🔒 Locked

Status bar

Started by glVertex3f Jun 27, 2004 at 5:53 PM 5 replies 1.8k views
Original Post
glVertex3f
glVertex3f
I have been trying to put a status bar in my window. Does OpenGL conflict with this or something? I am using OpenGL to actually draw ths 'stuff" inside the screen. I have looked at various different tutorials and example code, but nomatter what I try I cant get the status bar to work. Can someone either explain/give example or point me in the direction of a detailed explanation of how this works.
Fruny
Fruny
Are you trying to draw that bar in GL itself or is it a part of your window. If the latter and you are relying on the window's client area parameters, you may have to re-compute your viewport, so that GL doesn't actually draw over the status bar.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
glVertex3f
glVertex3f
Im scared OpenGL is infact drawing over the status bar, I just cant figure out how to fix it.
Fruny
Fruny
What do you pass to glViewport on a resize?
How tall is your status bar?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
glVertex3f
glVertex3f
I made it so the window cannot be resized. Its always 640x480.

And Ive noticed when I first run the application, I can see the status bar flash up, but then its covered by openGL. Ive tried messing with the glViewport and ortho settings but opengl still draws over the status bar.

EDIT:
This is how I declare the status bar

g_hStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,            hwnd, (HMENU)IDC_STATUS, g_hInstance, NULL);


I do that in my "create window" function right after i declare the window handle.
_the_phantom_
_the_phantom_
hmmm i could be because the window is 'owner drawn' and you control the whole view pane via OpenGL, so I would guess that to use a status bar you would have to attach a view panel of some sort to the window, above the status bar, and then draw to that.

I could be barking up the wrong leaf supporting plant, however that would certainly fix the problem [smile]
Fruny
Fruny
I am not a windows expert, so I don't know for sure how you would go around reducing the client area for GL itself. Assuming you're using plain Win32, you might succeed by creating a control (like a picture control or something) and use that as your context instead of the whole window.

Otherwise, well, setting your viewport properly *before* you do a glClear, or something, might work.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

Topic Locked

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

Sign in to reply to this topic.