Jump to content
  • Advertisement
Sign in to follow this  
lapkomic

OpenGL Pop Up Menu Win32 and OpenGL

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

Hello everybody!!! As you no doubt guess I need help! I am writing some OpenGl app under win32; I have some DrawGLScene; When I click right mouse I get Pop Up Menu; But if dont select anything and click left bottom outside the menu I get BLACK SCREEN and my Scene dosnt draw. Whats going on??? Where the BUG??

Share this post


Link to post
Share on other sites
Advertisement
impossible to say without further info
r u refreshing the opengl window as much as possible (eg 60fps)

Share this post


Link to post
Share on other sites
I am Sorry! I was wrong!
Lets start from begining.
My draw function:

int DrawGLScene(GLvoid) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

DrawObjects();

glFlush ();
return TRUE;
}

When I click mouse rigth button I get pop up menu.
If I select some item everything goes OK.
But if I DONT select anything and click left button outside the menu
My scene disappear and I get NOT BLACK WINDOW like I said befor
but clean screen of glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT) function.

This is PopUpMenu handle function:
case WM_CONTEXTMENU:
if( (hPopMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_POPUP))) == NULL )
return 0;
hMenuTrackPopup = GetSubMenu(hPopMenu, 0);
TrackPopupMenuEx(hMenuTrackPopup,
TPM_LEFTALIGN | TPM_RIGHTBUTTON,
LOWORD(lParam),
HIWORD(lParam),
hWnd,
NULL);

DestroyMenu(hPopMenu);

break;

So do you know what is going on???
Thanks.

Share this post


Link to post
Share on other sites
You can try return 0; instead of the break; at the end.
Probably I'm totally wrong ...
but the only thing I can imagine is that it tries to deal with the else case again and again!?
If nothing else this is a BUMP ...

Also ... put code or source tags around your code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!