gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash backend/render_handler_ogl.h backend/rend...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash backend/render_handler_ogl.h backend/rend...
Date: Sat, 24 Nov 2007 00:27:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/11/24 00:27:03

Modified files:
        backend        : render_handler_ogl.h render_handler_ogl.cpp 
        gui            : aqua.cpp aqua_ogl_glue.cpp Info.plist.in 
                         Makefile.am 

Log message:
                * backend/render_handler_ogl{.cpp,.h}: Define a GLU callback
                type, because it depends on the platform, unfortunately.
                * gui/aqua.cpp: Add some debugging code. Return the proper
                value in run().
                * gui/aqua_ogl_glue.cpp: Add some debugging code.
                * gui/Info.plist.in: Apparently Aqua's bundling system
                "prefers" package names to have an uppercase first letter.
                * gui/Makefile.am: Updates to reflect package name change.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_ogl.h?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_ogl.cpp?cvsroot=gnash&r1=1.90&r2=1.91
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aqua.cpp?cvsroot=gnash&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aqua_ogl_glue.cpp?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Info.plist.in?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Makefile.am?cvsroot=gnash&r1=1.110&r2=1.111

Patches:
Index: backend/render_handler_ogl.h
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_ogl.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- backend/render_handler_ogl.h        10 Nov 2007 11:51:42 -0000      1.4
+++ backend/render_handler_ogl.h        24 Nov 2007 00:27:03 -0000      1.5
@@ -24,7 +24,9 @@
 #include <OpenGL/gl.h>
 #include <OpenGL/glu.h>
 #include <OpenGL/glext.h>
+#define GLUCALLBACKTYPE GLvoid (*)(...)
 #else
+# define GLUCALLBACKTYPE void (*)()
 # include <GL/gl.h>
 # ifdef WIN32
 #  define GL_CLAMP_TO_EDGE 0x812F

Index: backend/render_handler_ogl.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_ogl.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- backend/render_handler_ogl.cpp      23 Nov 2007 22:55:17 -0000      1.90
+++ backend/render_handler_ogl.cpp      24 Nov 2007 00:27:03 -0000      1.91
@@ -280,17 +280,17 @@
 : _tessobj(gluNewTess())
 {
   gluTessCallback(_tessobj, GLU_TESS_ERROR, 
-                  reinterpret_cast<void (*)()>(Tesselator::error));
+                  reinterpret_cast<GLUCALLBACKTYPE>(Tesselator::error));
   gluTessCallback(_tessobj, GLU_TESS_COMBINE_DATA,
-                  reinterpret_cast<void (*)()>(Tesselator::combine));
+                  reinterpret_cast<GLUCALLBACKTYPE>(Tesselator::combine));
   
   gluTessCallback(_tessobj, GLU_TESS_BEGIN,
-                  reinterpret_cast<void (*)()>(glBegin));
+                  reinterpret_cast<GLUCALLBACKTYPE>(glBegin));
   gluTessCallback(_tessobj, GLU_TESS_END,
-                  reinterpret_cast<void (*)()>(glEnd));
+                  reinterpret_cast<GLUCALLBACKTYPE>(glEnd));
                   
   gluTessCallback(_tessobj, GLU_TESS_VERTEX,
-                  reinterpret_cast<void (*)()>(glVertex3dv)); 
+                  reinterpret_cast<GLUCALLBACKTYPE>(glVertex3dv)); 
   
 #if 0        
   // for testing, draw only the outside of shapes.          

Index: gui/aqua.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/aqua.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- gui/aqua.cpp        28 Oct 2007 22:01:32 -0000      1.27
+++ gui/aqua.cpp        24 Nov 2007 00:27:03 -0000      1.28
@@ -1,4 +1,4 @@
-// 
+
 //   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@
 // 
 //
 
-/* $Id: aqua.cpp,v 1.27 2007/10/28 22:01:32 bjacques Exp $ */
+/* $Id: aqua.cpp,v 1.28 2007/11/24 00:27:03 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -54,9 +54,11 @@
         return noErr;
 }
 
-void DoAdvanceMovie ( EventLoopTimerRef inTimer, void * data)
+void DoAdvanceMovie ( EventLoopTimerRef inTimer, void* data)
 {
-   Gui::advance_movie(static_cast<Gui*>(data));
+   GNASH_REPORT_FUNCTION;
+   AquaGui* gui = static_cast<AquaGui*>(data);
+   Gui::advance_movie(gui);
 }
   
        
@@ -76,14 +78,14 @@
 
 bool AquaGui::run()
 {
-//  GNASH_REPORT_FUNCTION;
+  GNASH_REPORT_FUNCTION;
     double interval = _interval / 1000.0;
 
 
     OSStatus ret = InstallEventLoopTimer (GetMainEventLoop(), 0, interval, 
       DoAdvanceMovie, this, _advance_timer);
-    if (!ret) {
-      return ret;
+    if (ret != noErr) {
+      return false;
     }
 
     RepositionWindow(myWindow, NULL, kWindowCascadeOnMainScreen);
@@ -96,8 +98,12 @@
 
 void AquaGui::renderBuffer()
 {
-//    GNASH_REPORT_FUNCTION;
+    GNASH_REPORT_FUNCTION;
     _glue.render();
+
+      Rect rectPort;
+      GetWindowPortBounds (myWindow, &rectPort);
+      InvalWindowRect (myWindow,  &rectPort); // force redrow
 }
 
 bool AquaGui::init(int argc, char ***argv)
@@ -184,7 +190,7 @@
        InstallWindowEventHandler (myWindow, handlerUPP,  // Install handler
                                  1, &eventType,
                                  NULL, NULL);
-       _glue.prepDrawingArea(_width, _height, GetWindowPort(myWindow));
+       assert(_glue.prepDrawingArea(_width, _height, GetWindowPort(myWindow)));
 
     return true;
 }

Index: gui/aqua_ogl_glue.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/aqua_ogl_glue.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- gui/aqua_ogl_glue.cpp       28 Oct 2007 22:01:32 -0000      1.16
+++ gui/aqua_ogl_glue.cpp       24 Nov 2007 00:27:03 -0000      1.17
@@ -18,7 +18,7 @@
 // 
 //
 
-/* $Id: aqua_ogl_glue.cpp,v 1.16 2007/10/28 22:01:32 bjacques Exp $ */
+/* $Id: aqua_ogl_glue.cpp,v 1.17 2007/11/24 00:27:03 bjacques Exp $ */
 
 
 #include "aqua_ogl_glue.h"
@@ -98,38 +98,26 @@
 bool AquaOglGlue::prepDrawingArea(int width, int height, AGLDrawable drawable)
 {
        GNASH_REPORT_FUNCTION;
-    //SDL_SetVideoMode(width, height, _bpp, sdl_flags | SDL_OPENGL);
-#if 0
-     // Turn on alpha blending.
-    glEnable(GL_BLEND);
-    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-                     
-    // Turn on line smoothing.  Antialiased lines can be used to
-    // smooth the outsides of shapes.
-    glEnable(GL_LINE_SMOOTH);
-    glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); // GL_NICEST, GL_FASTEST, 
GL_DONT_CARE
+    bool ret = aglSetDrawable(_context, drawable);
+    
     glMatrixMode(GL_PROJECTION);
 
+    float oversize = 1.0;
 
-    glOrtho(-OVERSIZE, OVERSIZE, OVERSIZE, -OVERSIZE, -1, 1);
+    // Flip the image, since (0,0) by default in OpenGL is the bottom left.
+    gluOrtho2D(-oversize, oversize, oversize, -oversize);
+    // Restore the matrix mode to the default.
     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();
- 
-    // We don't need lighting effects
-    glDisable(GL_LIGHTING);
-    glPushAttrib (GL_ALL_ATTRIB_BITS);         
-#endif
-#ifdef FIX_I810_LOD_BIAS
-    glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 
_tex_lod_bias);
-#endif
-    bool ret = aglSetDrawable(_context, drawable);
-    
     return ret;
 }
 
 void AquaOglGlue::render()
 {
-//    GNASH_REPORT_FUNCTION;
+    GNASH_REPORT_FUNCTION;
+    assert(aglSetCurrentContext(_context));
+    aglUpdateContext(_context);
+
     aglSwapBuffers(_context);
 }
 

Index: gui/Info.plist.in
===================================================================
RCS file: /sources/gnash/gnash/gui/Info.plist.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gui/Info.plist.in   28 Oct 2007 22:01:32 -0000      1.8
+++ gui/Info.plist.in   24 Nov 2007 00:27:03 -0000      1.9
@@ -5,11 +5,11 @@
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>CFBundleExecutable</key>
-       <string>gnash</string>
+       <string>Gnash</string>
        <key>CFBundleGetInfoString</key>
        <string>Copyright (C) 2005-2007 Free Software Foundation, Inc.</string>
        <key>CFBundleIconFile</key>
-       <string>GnashG.icns</string>
+       <string>GnashG</string>
        <key>CFBundleIdentifier</key>
        <string>com.gnash.aqua</string>
        <key>CFBundleInfoDictionaryVersion</key>

Index: gui/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/gui/Makefile.am,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- gui/Makefile.am     22 Nov 2007 16:19:57 -0000      1.110
+++ gui/Makefile.am     24 Nov 2007 00:27:03 -0000      1.111
@@ -111,7 +111,7 @@
 #OS X stuff goes here...
 GUI_CPPFLAGS += -DGUI_AQUA
 
-bundle_name = gnash.app
+bundle_name = Gnash.app
 
 
 if  HAVE_OPENGL
@@ -174,7 +174,7 @@
 
 if BUILD_AQUA_GUI
 BUILT_SOURCES += bundle
-EXTRA_DIST += gnash.app
+EXTRA_DIST += Gnash.app
 endif
 
 #
@@ -420,7 +420,7 @@
        mkdir -p $(bundle_name)/Contents/Resources
        echo "APPL????" > $(bundle_name)/Contents/PkgInfo
        cp Info.plist $(bundle_name)/Contents/Info.plist
-       cp -f $(bin_PROGRAMS) $(bundle_name)/Contents/MacOS
+       cp -f .libs/aqua-gnash $(bundle_name)/Contents/MacOS/Gnash
        cp -f images/GnashG.icns $(bundle_name)/Contents/Resources/
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]