Jump to content
  • Advertisement
Sign in to follow this  
HellRiZZer

OpenGL MFC MDI Mouse Adjustment

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

Hi everyone, I've got another tricky question for yas: How do I calculate the mouse adjustment for Ortho mode in OpenGL for MDI application? For example, I got a toolbar, menu bar, frame width/height etc, how do I calculate the mouse position in absolute screen coordinates that I can get by using GetCursorPos(LPOINT Point)? In usual Win32 application the adjustment is done via:
POINT Point;
	::GetCursorPos(&Point);
	ScreenToClient(GetActiveWindow(), &Point);

	m_PrevCursorPos.x = m_CursorPos.x;
	m_PrevCursorPos.y = m_CursorPos.y;

	m_CursorPos.x = Point.x; 
	m_CursorPos.y = Point.y;

		int Viewport[4];
		glGetIntegerv(GL_VIEWPORT, Viewport);
		m_CursorPos.y = Viewport[3] - m_CursorPos.y;

But I can't figure out what I have to do to calculate it for the current active view.. Please help me adn I will present you all with the greatest GUI and tools of all times :) Thanks.

Share this post


Link to post
Share on other sites
Advertisement
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!