gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx/libos Os.hxx


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gfx/libos Os.hxx
Date: Wed, 04 Dec 2002 04:27:59 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/12/04 04:27:59

Modified files:
        gfx/libos      : Os.hxx 

Log message:
        Preparing for off-screen rendering

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libos/Os.hxx.diff?tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: gzz/gfx/libos/Os.hxx
diff -u gzz/gfx/libos/Os.hxx:1.11 gzz/gfx/libos/Os.hxx:1.12
--- gzz/gfx/libos/Os.hxx:1.11   Wed Sep 25 08:27:59 2002
+++ gzz/gfx/libos/Os.hxx        Wed Dec  4 04:27:59 2002
@@ -29,7 +29,9 @@
 
 #include <string>
 
-/** A namespace which contains non-portable classes surrounding OpenGL.
+/** A namespace which contains 
+ * non-portable classes and wrappers for them, for 
+ * using OpenGL portably.
  */
 namespace Os {
 
@@ -52,9 +54,6 @@
         virtual void loadIntoTexture(GLint level, GLint xoffset,
                                        GLint yoffset) = 0;
 
-       //  virtual void loadInto(Gummi::Tex::Id id,
-    //             int tx, int ty, int tw, int th,
-    //             int x, int y, int w, int h) = 0;
     };
 
     class Eventhandler {
@@ -73,23 +72,31 @@
        virtual void repaint() { };
     };
 
-    /*
-    class IdleTasks {
+    /** An abstract OpenGL rendering surface.
+     */
+    class RenderingSurface {
     public:
-       virtual ~IdleTasks() { } // not called by WindowSystem
-       * One unit of processing.
-        * @return True, if a tick is needed again ASAP.
-        *
-       virtual bool tick() = 0;
+       virtual ~RenderingSurface() { };
+
+       /** Enable this window for rendering.
+        */
+       virtual bool setCurrent() = 0;
+       virtual bool releaseCurrent() = 0;
+
+       virtual void resize(int w, int h) = 0;
+       virtual void getSize(int *xywh) = 0;
     };
-    */
 
-    class Window {
+    /** An OpenGL rendering surface in a physical
+     * window.
+     */
+    class Window : public RenderingSurface {
     protected:
-       /** Queue a repaint request.
-        */
     public:
        Window() { }
+       virtual ~Window() { };
+       /** Queue a repaint request.
+        */
        virtual void repaint() = 0;
        virtual void setEventHandler(Eventhandler *h) = 0;
        /*
@@ -99,16 +106,10 @@
        */
 
        // virtual pair<int, int> getSize() = 0;
-       /** Enable this window for rendering.
-        */
-       virtual bool setCurrent() = 0;
-       virtual bool releaseCurrent() = 0;
 
        virtual void swapBuffers() = 0;
 
        virtual void move(int x, int y) = 0;
-       virtual void resize(int w, int h) = 0;
-       virtual void getSize(int *xywh) = 0;
 
        /** Call EventHandler->timeout at least X milliseconds 
         * from now.
@@ -116,9 +117,20 @@
        virtual void addTimeout(int ms, int id) = 0;
     };
 
+    /** The overall singleton wrapper class
+     * for the current window system. OpenGL
+     * is supported on different windowing systems
+     * and those systems all have different ways
+     * of creating the drawables and handling
+     * events. This class is the basis of abstracting
+     * those features that gzz needs.
+     */
     class WindowSystem {
        static WindowSystem *instance;
     public:
+       /** Get the instance of WindowSystem appropriate 
+        * for the current environment.
+        */
        static WindowSystem *getInstance();
 
        virtual ~WindowSystem() {}




reply via email to

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