From e07200c4e847ddff8a46ea9fdc23e17437d74c15 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 6 Dec 2001 00:17:47 +0000 Subject: Implemeted 95% of all Mac OS X support. Makefiles still need modifications. Almost all test applications run out of the box (->Makefile). See more information in README.mac . Changes: - message handling - access to opaque port structures - image, bitmap, pixmap support - most OpenGL stuff - window styles git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1812 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Gl_Window.cxx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/Fl_Gl_Window.cxx') diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 31142185c..e4a16c81e 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.2 2001/12/04 04:12:58 matthiaswm Exp $" +// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.3 2001/12/06 00:17:47 matthiaswm Exp $" // // OpenGL window code for the Fast Light Tool Kit (FLTK). // @@ -202,8 +202,12 @@ void Fl_Gl_Window::flush() { #ifdef __APPLE__ //: clear previous clipping in this shared port - CGrafPort *port = (CGrafPort*)fl_xid(this); - SetRectRgn( port->clipRgn, 0, 0, 0x7fff, 0x7fff ); + GrafPtr port = GetWindowPort( fl_xid(this) ); + Rect rect; SetRect( &rect, 0, 0, 0x7fff, 0x7fff ); + GrafPtr old; GetPort( &old ); + SetPort( port ); + ClipRect( &rect ); + SetPort( old ); #endif make_current(); @@ -296,10 +300,10 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) { valid(0); #ifdef __APPLE__ if ( parent() ) { //: resize our GL buffer rectangle - CGrafPort *port = (CGrafPort*)fl_xid(this); - GLint rect[] = { X, port->portRect.bottom-h()-y(), W, H }; - aglSetInteger( (GLXContext)context_, AGL_BUFFER_RECT, rect ); - aglEnable( (GLXContext)context_, AGL_BUFFER_RECT ); + Rect wrect; GetWindowPortBounds( fl_xid(this), &wrect ); + GLint rect[] = { X, wrect.bottom-h()-y(), W, H }; + aglSetInteger( context_, AGL_BUFFER_RECT, rect ); + aglEnable( context_, AGL_BUFFER_RECT ); } #elif !defined(WIN32) if (!resizable() && overlay && overlay != this) @@ -347,5 +351,5 @@ void Fl_Gl_Window::draw_overlay() {} #endif // -// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.2 2001/12/04 04:12:58 matthiaswm Exp $". +// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.3 2001/12/06 00:17:47 matthiaswm Exp $". // -- cgit v1.2.3