[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/gui aqua.cpp aqua_glue.h aqua_ogl_glue.cp...
From: |
Markus Gothe |
Subject: |
[Gnash-commit] gnash/gui aqua.cpp aqua_glue.h aqua_ogl_glue.cp... |
Date: |
Tue, 08 May 2007 21:55:32 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Markus Gothe <nihilus> 07/05/08 21:55:32
Modified files:
gui : aqua.cpp aqua_glue.h aqua_ogl_glue.cpp
aqua_ogl_glue.h aquasup.h
Log message:
Added more stubby functions from the SDL-gui.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aqua.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aqua_glue.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aqua_ogl_glue.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aqua_ogl_glue.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aquasup.h?cvsroot=gnash&r1=1.3&r2=1.4
Patches:
Index: aqua.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/aqua.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- aqua.cpp 8 May 2007 21:28:18 -0000 1.6
+++ aqua.cpp 8 May 2007 21:55:32 -0000 1.7
@@ -17,12 +17,20 @@
//
//
-/* $Id: aqua.cpp,v 1.6 2007/05/08 21:28:18 nihilus Exp $ */
+/* $Id: aqua.cpp,v 1.7 2007/05/08 21:55:32 nihilus Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+extern "C"{
+#include <unistd.h>
+#ifdef HAVE_GETOPT_H
+ #include <getopt.h>
+#endif
+// extern int getopt(int, char *const *, const char *);
+}
+
#include "gnash.h"
#include "gui.h"
#include "aquasup.h"
@@ -51,4 +59,40 @@
}
+void AquaGui::renderBuffer()
+{
+ //GNASH_REPORT_FUNCTION;
+
+ _glue.render();
+}
+
+bool AquaGui::init(int /*argc*/, char *** /*argv*/) /* Self-explainatory */
+{
+ return true;
+}
+
+void AquaGui::setTimeout(unsigned int timeout)
+{
+ _timeout = timeout;
+}
+
+void AquaGui::key_event(int key, bool down)
+{
+}
+
+bool AquaGui::createWindow(const char* /*title*/, int /*width*/, int
/*height*/)
+{
+ return true;
+}
+
+bool AquaGui::createMenu()
+{
+ return true;
+}
+
+bool AquaGui::setupEvents()
+{
+ return true;
+}
+
}
\ No newline at end of file
Index: aqua_glue.h
===================================================================
RCS file: /sources/gnash/gnash/gui/aqua_glue.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- aqua_glue.h 6 May 2007 22:13:51 -0000 1.1
+++ aqua_glue.h 8 May 2007 21:55:32 -0000 1.2
@@ -17,4 +17,24 @@
//
//
-/* $Id: aqua_glue.h,v 1.1 2007/05/06 22:13:51 nihilus Exp $ */
+/* $Id: aqua_glue.h,v 1.2 2007/05/08 21:55:32 nihilus Exp $ */
+
+#include "gnash.h"
+
+namespace gnash
+{
+
+class AquaGlue
+{
+ public:
+ virtual ~AquaGlue() { }
+ virtual bool init(int argc, char **argv[]) = 0;
+
+ virtual bool prepDrawingArea(int width, int height) = 0;
+ virtual render_handler* createRenderHandler(int depth) = 0;
+ virtual void render() = 0;
+ protected:
+ int _bpp;
+};
+
+}
\ No newline at end of file
Index: aqua_ogl_glue.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/aqua_ogl_glue.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- aqua_ogl_glue.cpp 6 May 2007 23:05:49 -0000 1.3
+++ aqua_ogl_glue.cpp 8 May 2007 21:55:32 -0000 1.4
@@ -17,4 +17,131 @@
//
//
-/* $Id: aqua_ogl_glue.cpp,v 1.3 2007/05/06 23:05:49 nihilus Exp $ */
\ No newline at end of file
+/* $Id: aqua_ogl_glue.cpp,v 1.4 2007/05/08 21:55:32 nihilus Exp $ */
+
+
+#include "aqua_ogl_glue.h"
+#include "tu_opengl_includes.h"
+
+#include "log.h"
+
+#define OVERSIZE 1.0f
+
+using namespace std;
+
+namespace gnash
+{
+
+AquaOglGlue::AquaOglGlue()
+#ifdef FIX_I810_LOD_BIAS
+ : _tex_lod_bias(-1.2f)
+#endif
+{
+// GNASH_REPORT_FUNCTION;
+}
+
+SdlOglGlue::~SdlOglGlue()
+{
+// GNASH_REPORT_FUNCTION;
+
+}
+
+bool
+#ifdef FIX_I810_LOD_BIAS
+AquaOglGlue::init(int argc, char** argv[])
+#else
+AquaOglGlue::init(int, char***)
+#endif
+{
+// GNASH_REPORT_FUNCTION;
+#ifdef FIX_I810_LOD_BIAS
+ int c = getopt (argc, *argv, "m:");
+ if (c == 'm') {
+ _tex_lod_bias = (float) atof(optarg);
+ }
+#endif
+
+ return true;
+}
+
+
+render_handler*
+AquaOglGlue::createRenderHandler(int depth)
+{
+// GNASH_REPORT_FUNCTION;
+
+ _bpp = depth;
+
+ render_handler* renderer = create_render_handler_ogl();
+
+#ifdef FIX_I810_LOD_BIAS
+ glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT,
_tex_lod_bias);
+#endif
+
+ return renderer;
+}
+
+bool
+SdlOglGlue::prepDrawingArea(int width, int height, uint32_t aqua_flags)
+{
+ if (_bpp == 16) {
+ // 16-bit color, surface creation is likely to succeed.
+ /*SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
+ SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
+ SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 15);
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);*/
+ } else {
+ assert(_bpp == 32);
+
+ // 32-bit color etc, for getting dest alpha,
+ // for MULTIPASS_ANTIALIASING (see
+ // render_handler_ogl.cpp).
+ /*SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);*/
+ }
+
+ //SDL_SetVideoMode(width, height, _bpp, sdl_flags | SDL_OPENGL);
+
+ // 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
+ glMatrixMode(GL_PROJECTION);
+
+
+ glOrtho(-OVERSIZE, OVERSIZE, OVERSIZE, -OVERSIZE, -1, 1);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+ // We don't need lighting effects
+ glDisable(GL_LIGHTING);
+ glPushAttrib (GL_ALL_ATTRIB_BITS);
+
+# ifdef FIX_I810_LOD_BIAS
+ glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT,
_tex_lod_bias);
+# endif
+
+ return true;
+}
+
+void
+AquaOglGlue::render()
+{
+// GNASH_REPORT_FUNCTION;
+ //SDL_GL_SwapBuffers();
+}
+
+
+
+} // namespace gnash
\ No newline at end of file
Index: aqua_ogl_glue.h
===================================================================
RCS file: /sources/gnash/gnash/gui/aqua_ogl_glue.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- aqua_ogl_glue.h 6 May 2007 22:13:51 -0000 1.1
+++ aqua_ogl_glue.h 8 May 2007 21:55:32 -0000 1.2
@@ -17,4 +17,30 @@
//
//
-/* $Id: aqua_ogl_glue.h,v 1.1 2007/05/06 22:13:51 nihilus Exp $ */
+/* $Id: aqua_ogl_glue.h,v 1.2 2007/05/08 21:55:32 nihilus Exp $ */
+
+#include "aqua_glue.h"
+
+using namespace std;
+
+namespace gnash
+{
+
+class AquaOglGlue : public AquaGlue
+{
+ public:
+ AquaOglGlue();
+ virtual ~AquaOglGlue();
+
+ bool init(int argc, char ***argv);
+ render_handler* createRenderHandler( int depth);
+ bool prepDrawingArea(int width, int height, uint32_t aqua_flags);
+ void render();
+ private:
+
+#ifdef FIX_I810_LOD_BIAS
+ float _tex_lod_bias;
+#endif
+};
+
+}
Index: aquasup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/aquasup.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- aquasup.h 8 May 2007 21:28:18 -0000 1.3
+++ aquasup.h 8 May 2007 21:55:32 -0000 1.4
@@ -17,7 +17,7 @@
//
//
-/* $Id: aquasup.h,v 1.3 2007/05/08 21:28:18 nihilus Exp $ */
+/* $Id: aquasup.h,v 1.4 2007/05/08 21:55:32 nihilus Exp $ */
#ifndef __AQUASUP_H__
#define __AQUASUP_H__
@@ -30,6 +30,10 @@
#include "gui.h"
+#if defined(RENDERER_OPENGL)
+#include "aqua_ogl_glue.h"
+#endif
+
namespace gnash {
class AquaGui : public Gui
@@ -41,17 +45,15 @@
int m_stage_width;
int m_stage_height;
- /// For 8 bit (palette / LUT) modes, sets a grayscale palette.
- //
- /// This GUI currently does not support palette modes.
- ///
- bool set_grayscale_lut8();
-
- bool initialize_renderer();
-
int valid_x(int x);
int valid_y(int y);
+ unsigned int _timeout;
+
+#if defined(RENDERER_OPENGL)
+ AquaOglGlue _glue;
+#endif
+
public:
AquaGui();
AquaGui(unsigned long xid, float scale, bool loop, unsigned int
depth);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash/gui aqua.cpp aqua_glue.h aqua_ogl_glue.cp...,
Markus Gothe <=