Jump to content
  • Advertisement
Sign in to follow this  
vadim85

OpenGL ScrollView MFC

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

I want to implement scrollbars for openGl scene That what I’m doing: IMPLEMENT_DYNCREATE(COglView, CScrollView) void COglView::OnInitialUpdate() { CScrollView::OnInitialUpdate(); CSize sizeTotal; CRect clientRec; GetClientRect(clientRec); sizeTotal = GetTotalSize(); sizeTotal.cx = (clientRec.Width())*m_GLManager.GetScaleFactor(); sizeTotal.cy = (clientRec.Height())*m_GLManager.GetScaleFactor(); SetScrollSizes(MM_TEXT, sizeTotal); } OnZoomin function: m_scalefactor += 0.1; OnDrawScene function glScalef(m_scalefactor,m_scalefactor,m_scalefactor); to “scroll” the scene I’m using glTranslatef(m_TranslateX,m_TranslateY,m_TranslateZ); Now my question how to find the relationship between position of the scroll bar and how I should increase/decrease m_TranslateX and m_TranslateY parameters ??? Please help me, it’s really urgent . Thank you. P.S some example could be very help

Share this post


Link to post
Share on other sites
Advertisement
I can help, but I'll have to look up some MFC stuff beforehand. Your problem doesn't look too hard to solve, but I don't use CScrollViews very often (in fact, I don't like using them full stop. They don't integrate with OpenGL very well at all). Plus, I'm going out in a while. Anyway, I'll post this evening or tomorrow...

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!