Ghost Context Refactor
[blender-staging.git] / source / gameengine / Rasterizer / RAS_ICanvas.h
index d7e2f237bb0401856c2b6ec8aa9484d208b7993d..d90cbea286e5d8d5524368e1be545932d5ee2189 100644 (file)
@@ -29,8 +29,8 @@
  *  \ingroup bgerast
  */
 
-#ifndef __RAS_ICANVAS
-#define __RAS_ICANVAS
+#ifndef __RAS_ICANVAS_H__
+#define __RAS_ICANVAS_H__
 
 #ifdef WITH_CXX_GUARDEDALLOC
 #include "MEM_guardedalloc.h"
@@ -59,7 +59,7 @@ public:
        virtual 
        ~RAS_ICanvas(
        ) {
-       };
+       }
 
        virtual 
                void 
@@ -80,8 +80,8 @@ public:
         * Initializes the canvas for drawing.  Drawing to the canvas is
         * only allowed between BeginDraw() and EndDraw().
         *
-        * @retval false Acquiring the canvas failed.
-        * @retval true Acquiring the canvas succeeded.
+        * \retval false Acquiring the canvas failed.
+        * \retval true Acquiring the canvas succeeded.
         *
         */
 
@@ -105,6 +105,18 @@ public:
                void 
        SwapBuffers(
        )=0;
+       
+       virtual
+               void
+       SetSwapInterval(
+               int interval
+       )=0;
+
+       virtual
+               bool
+       GetSwapInterval(
+               int& intervalOut
+       )=0;
  
        virtual 
                void 
@@ -133,25 +145,25 @@ public:
 
        virtual
                int
-       GetMouseX( int x
+       GetMouseX(int x
        )=0;
 
        virtual
                int
-       GetMouseY( int y
+       GetMouseY(int y
        )= 0;
 
        virtual
                float
-       GetMouseNormalizedX( int x
+       GetMouseNormalizedX(int x
        )=0;
 
        virtual
                float
-       GetMouseNormalizedY( int y
+       GetMouseNormalizedY(int y
        )= 0;
 
-       virtual 
+       virtual
                const RAS_Rect &
        GetDisplayArea(
        ) const = 0;
@@ -170,7 +182,7 @@ public:
        ) = 0;
 
        /**
-        * Set the visible vieport 
+        * Set the visible view-port 
         */
 
        virtual
@@ -178,7 +190,26 @@ public:
        SetViewPort(
                int x1, int y1,
                int x2, int y2
-       ) = 0; 
+       ) = 0;
+
+       /**
+        * Update the Canvas' viewport (used when the viewport changes without using SetViewPort()
+        * eg: Shadow buffers and FBOs
+        */
+
+       virtual
+               void
+       UpdateViewPort(
+               int x1, int y1,
+               int x2, int y2
+       ) = 0;
+
+       /**
+        * Get the visible viewport
+        */
+       virtual
+               const int*
+       GetViewPort() = 0;
 
        virtual 
                void 
@@ -205,16 +236,33 @@ public:
        MakeScreenShot(
                const char* filename
        )=0;
+
+       virtual
+               void 
+       ResizeWindow(
+               int width,
+               int height
+       )=0;
+
+       virtual
+               void
+       SetFullScreen(
+               bool enable
+       )=0;
+
+       virtual
+               bool
+       GetFullScreen()=0;
+
+               
        
 protected:
        RAS_MouseState m_mousestate;
-       
+
+
 #ifdef WITH_CXX_GUARDEDALLOC
-public:
-       void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ICanvas"); }
-       void operator delete( void *mem ) { MEM_freeN(mem); }
+       MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_ICanvas")
 #endif
 };
 
-#endif //__RAS_ICANVAS
-
+#endif  /* __RAS_ICANVAS_H__ */