LP64 fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2007-05-16 11:47:07 +00:00
parent 1884063d39
commit ef7bf59cb8

View File

@@ -44,16 +44,21 @@ wxGLContext::wxGLContext(
)
{
m_window = win;
#ifndef __LP64__
m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetTopLevelWindowRef()));
#endif
m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
GLboolean b;
#ifndef __LP64__
b = aglSetDrawable(m_glContext, m_drawable);
wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") );
aglEnable(m_glContext , AGL_BUFFER_RECT ) ;
#else
b = aglSetHIViewRef(m_glContext, (HIViewRef) win->GetHandle());
#endif
wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") );
b = aglSetCurrentContext(m_glContext);
wxCHECK_RET( b, wxT("Couldn't activate OpenGl context") );
}
@@ -243,6 +248,7 @@ void wxGLCanvas::UpdateContext()
void wxGLCanvas::SetViewport()
{
#ifndef __LP64__
// viewport is initially set to entire port
// adjust glViewport to just this window
int x = 0 ;
@@ -284,6 +290,7 @@ void wxGLCanvas::SetViewport()
parms[0] += 20000 ;
aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ;
}
#endif
}
void wxGLCanvas::OnSize(wxSizeEvent& event)