OpenGL Anti-aliasing implementation for blender windows
authorDamien Plisson <damien.plisson@yahoo.fr>
Wed, 6 Jan 2010 11:42:52 +0000 (11:42 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Wed, 6 Jan 2010 11:42:52 +0000 (11:42 +0000)
Added GHOST_TUns16 numOfAASamples parameter to GHOST_CreateWindow to specify the number of AA samples (null if no AA wanted)
Implemented it in the cascade of GHOST classes.

Full implementation currently done for OSX/Cocoa, stubs for other OSes.
Moguri : it's ready for your win32 implementation !

Note that fallback to a non AA window (if gfx card doesn't support AA) is done inside GHOST OS specific layer, so that blender windowmanager still gets its window created properly.

22 files changed:
intern/ghost/GHOST_C-api.h
intern/ghost/GHOST_ISystem.h
intern/ghost/intern/GHOST_C-api.cpp
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/ghost/intern/GHOST_SystemCarbon.h
intern/ghost/intern/GHOST_SystemCocoa.h
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemWin32.h
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
intern/ghost/intern/GHOST_Window.cpp
intern/ghost/intern/GHOST_Window.h
intern/ghost/intern/GHOST_WindowCarbon.cpp
intern/ghost/intern/GHOST_WindowCarbon.h
intern/ghost/intern/GHOST_WindowCocoa.h
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.h
intern/ghost/intern/GHOST_WindowX11.cpp
intern/ghost/intern/GHOST_WindowX11.h
source/blender/windowmanager/intern/wm_window.c

index d4788ae9e86eef27d64d2342db9f347cb5f9a14a..7e7b24721eba8969324644a5c91d6f1e56f20201 100644 (file)
@@ -162,6 +162,8 @@ extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
  * @param      height  The height the window.
  * @param      state   The state of the window when opened.
  * @param      type    The type of drawing context installed in this window.
+ * @param stereoVisual         Stereo visual for quad buffered stereo.
+ * @param numOfAASamples       Number of samples used for AA (zero if no AA)
  * @return     A handle to the new window ( == NULL if creation failed).
  */
 extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
@@ -172,7 +174,8 @@ extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
        GHOST_TUns32 height,
        GHOST_TWindowState state,
        GHOST_TDrawingContextType type,
-       const int stereoVisual);
+       const int stereoVisual,
+       const GHOST_TUns16 numOfAASamples);
 
 /**
  * Returns the window user data.
index 305caa70ae4a5991814a6145e5af5c3b3b5407b9..d1449aaef5903a699b1f3f61ab41d84aef4bbddb 100644 (file)
@@ -216,14 +216,15 @@ public:
         * Create a new window.
         * The new window is added to the list of windows managed. 
         * Never explicitly delete the window, use disposeWindow() instead.
-        * @param       title   The name of the window (displayed in the title bar of the window if the OS supports it).
-        * @param       left            The coordinate of the left edge of the window.
-        * @param       top             The coordinate of the top edge of the window.
-        * @param       width           The width the window.
-        * @param       height          The height the window.
-        * @param       state           The state of the window when opened.
-        * @param       type            The type of drawing context installed in this window.
+        * @param       title                   The name of the window (displayed in the title bar of the window if the OS supports it).
+        * @param       left                    The coordinate of the left edge of the window.
+        * @param       top                             The coordinate of the top edge of the window.
+        * @param       width                   The width the window.
+        * @param       height                  The height the window.
+        * @param       state                   The state of the window when opened.
+        * @param       type                    The type of drawing context installed in this window.
         * @param       stereoVisual    Create a stereo visual for quad buffered stereo.
+        * @param       numOfAASamples  Number of samples used for AA (zero if no AA)
         * @param       parentWindow    Parent (embedder) window
         * @return      The new window (or 0 if creation failed).
         */
@@ -231,7 +232,8 @@ public:
                const STR_String& title,
                GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
                GHOST_TWindowState state, GHOST_TDrawingContextType type,
-               const bool stereoVisual,
+               const bool stereoVisual = false,
+               const GHOST_TUns16 numOfAASamples = 0,
                const GHOST_TEmbedderWindowID parentWindow = 0) = 0;
 
        /**
index 556176809f459ebc03daa9f4a139b50ae1026541..be726282d80ffe7635ac8fca7dd65ff7003b1bd7 100644 (file)
@@ -140,7 +140,8 @@ GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
                                                                          GHOST_TUns32 height,
                                                                          GHOST_TWindowState state,
                                                                          GHOST_TDrawingContextType type,
-                                                                         const int stereoVisual)
+                                                                         const int stereoVisual,
+                                                                         const GHOST_TUns16 numOfAASamples)
 {
        GHOST_ISystem* system = (GHOST_ISystem*) systemhandle;
        bool bstereoVisual;
@@ -151,7 +152,7 @@ GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
                bstereoVisual = false;
 
        return (GHOST_WindowHandle) system->createWindow(title, left, top, width, height,
-               state, type, bstereoVisual);
+               state, type, bstereoVisual, numOfAASamples);
 }
 
 GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle)
index 57d6f6c06cc4e01dc53377ab251424cb07e68d73..3813a5ee450e6aea927a6c6d53e41f52e45fc1cf 100644 (file)
@@ -402,6 +402,7 @@ GHOST_IWindow* GHOST_SystemCarbon::createWindow(
        GHOST_TWindowState state,
        GHOST_TDrawingContextType type,
        bool stereoVisual,
+       const GHOST_TUns16 numOfAASamples,
        const GHOST_TEmbedderWindowID parentWindow
 )
 {
index 5b3b786a5aca5c44349bedd8791a9292ab024ade..7ebbbd8e97b45c6e7e676cea93f903d2c1281820 100644 (file)
@@ -115,6 +115,7 @@ public:
                GHOST_TWindowState state,
                GHOST_TDrawingContextType type,
                const bool stereoVisual,
+               const GHOST_TUns16 numOfAASamples = 0,
                const GHOST_TEmbedderWindowID parentWindow = 0 
        );
        
index 81eb8978588890b23ad9a664604e03b3e47392fa..5b78f9b8fa3ef9fbf59a3a22626444e653e6a5d4 100644 (file)
@@ -93,13 +93,15 @@ public:
         * Create a new window.
         * The new window is added to the list of windows managed. 
         * Never explicitly delete the window, use disposeWindow() instead.
-        * @param       title   The name of the window (displayed in the title bar of the window if the OS supports it).
-        * @param       left    The coordinate of the left edge of the window.
-        * @param       top             The coordinate of the top edge of the window.
-        * @param       width   The width the window.
-        * @param       height  The height the window.
-        * @param       state   The state of the window when opened.
-        * @param       type    The type of drawing context installed in this window.
+        * @param       title                   The name of the window (displayed in the title bar of the window if the OS supports it).
+        * @param       left                    The coordinate of the left edge of the window.
+        * @param       top                             The coordinate of the top edge of the window.
+        * @param       width                   The width the window.
+        * @param       height                  The height the window.
+        * @param       state                   The state of the window when opened.
+        * @param       type                    The type of drawing context installed in this window.
+        * @param       stereoVisual    Stereo visual for quad buffered stereo.
+        * @param       numOfAASamples  Number of samples used for AA (zero if no AA)
         * @param       parentWindow    Parent (embedder) window
         * @return      The new window (or 0 if creation failed).
         */
@@ -111,7 +113,8 @@ public:
                GHOST_TUns32 height,
                GHOST_TWindowState state,
                GHOST_TDrawingContextType type,
-               const bool stereoVisual,
+               const bool stereoVisual = false,
+               const GHOST_TUns16 numOfAASamples = 0,
                const GHOST_TEmbedderWindowID parentWindow = 0 
        );
        
index e9d34534fcfc69819709e9996b91a66ef0e00387..1ba20315512d18230903903ab518eb9b9b1e6129 100644 (file)
@@ -657,6 +657,7 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
        GHOST_TWindowState state,
        GHOST_TDrawingContextType type,
        bool stereoVisual,
+       const GHOST_TUns16 numOfAASamples,
        const GHOST_TEmbedderWindowID parentWindow
 )
 {
@@ -672,7 +673,7 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
        left = left > contentRect.origin.x ? left : contentRect.origin.x;
        top = top > contentRect.origin.y ? top : contentRect.origin.y;
        
-       window = new GHOST_WindowCocoa (this, title, left, top, width, height, state, type);
+       window = new GHOST_WindowCocoa (this, title, left, top, width, height, state, type, stereoVisual, numOfAASamples);
 
     if (window) {
         if (window->getValid()) {
index 15914a5bf4343501c82913a81300550b11b44553..d7d657fb4969246c5b02603f6444defd1d6289e4 100644 (file)
@@ -190,7 +190,7 @@ GHOST_IWindow* GHOST_SystemWin32::createWindow(
        const STR_String& title, 
        GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
        GHOST_TWindowState state, GHOST_TDrawingContextType type,
-       bool stereoVisual, const GHOST_TEmbedderWindowID parentWindow )
+       bool stereoVisual, const GHOST_TUns16 numOfAASamples, const GHOST_TEmbedderWindowID parentWindow )
 {
        GHOST_Window* window = 0;
        window = new GHOST_WindowWin32 (this, title, left, top, width, height, state, type, stereoVisual);
index 517f7ddbeea524657ed7147dd1917eb7fe7f37c2..65d6a57ede3ce4d794f921237b8a189a341f9017 100644 (file)
@@ -110,6 +110,8 @@ public:
         * @param       height  The height the window.
         * @param       state   The state of the window when opened.
         * @param       type    The type of drawing context installed in this window.
+        * @param       stereoVisual    Stereo visual for quad buffered stereo.
+        * @param       numOfAASamples  Number of samples used for AA (zero if no AA)
         * @param       parentWindow    Parent (embedder) window
         * @return      The new window (or 0 if creation failed).
         */
@@ -117,7 +119,9 @@ public:
                const STR_String& title,
                GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
                GHOST_TWindowState state, GHOST_TDrawingContextType type,
-               const bool stereoVisual, const GHOST_TEmbedderWindowID parentWindow = 0 );
+               const bool stereoVisual = false,
+               const GHOST_TUns16 numOfAASamples = 0,
+               const GHOST_TEmbedderWindowID parentWindow = 0 );
 
        /***************************************************************************************
         ** Event management functionality
index ad8647d2246047b5d19bf00dccc59b78860c06ed..3ee3c1a29f360863da17aeded1106138f3d89077 100644 (file)
@@ -228,6 +228,8 @@ getMainDisplayDimensions(
         * @param       height  The height the window.
         * @param       state   The state of the window when opened.
         * @param       type    The type of drawing context installed in this window.
+        * @param       stereoVisual    Stereo visual for quad buffered stereo.
+        * @param       numOfAASamples  Number of samples used for AA (zero if no AA)
         * @param       parentWindow    Parent (embedder) window
         * @return      The new window (or 0 if creation failed).
         */
@@ -242,6 +244,7 @@ createWindow(
        GHOST_TWindowState state,
        GHOST_TDrawingContextType type,
        bool stereoVisual,
+       const GHOST_TUns16 numOfAASamples,
        const GHOST_TEmbedderWindowID parentWindow
 ){
        GHOST_WindowX11 * window = 0;
index d76c3991beb2cde38a32d1113f434ec73af5ab1f..361db783102e064cf0694a120eb3764be38deccd 100644 (file)
@@ -127,6 +127,7 @@ public:
                GHOST_TWindowState state,
                GHOST_TDrawingContextType type,
                const bool stereoVisual,
+               const GHOST_TUns16 numOfAASamples = 0,
                const GHOST_TEmbedderWindowID parentWindow = 0 
        );
 
index 14a255e2e5ef2ab79dd21dd3fb6a06f44ffbac3b..939a911dfac4a50b6828b05b12789d1e299102d5 100644 (file)
@@ -44,13 +44,15 @@ GHOST_Window::GHOST_Window(
        GHOST_TInt32 /*left*/, GHOST_TInt32 /*top*/, GHOST_TUns32 width, GHOST_TUns32 height,
        GHOST_TWindowState state,
        GHOST_TDrawingContextType type,
-       const bool stereoVisual)
+       const bool stereoVisual,
+       const GHOST_TUns16 numOfAASamples)
 :
        m_drawingContextType(type),
        m_cursorVisible(true),
        m_cursorGrab(GHOST_kGrabDisable),
        m_cursorShape(GHOST_kStandardCursorDefault),
-       m_stereoVisual(stereoVisual)
+       m_stereoVisual(stereoVisual),
+       m_numOfAASamples(numOfAASamples)
 {
        m_isUnsavedChanges = false;
        m_canAcceptDragOperation = false;
index 1b5681dc41cafa71fbf08c97ca7c79b1d2e85a02..8aab9125130a6e1cdae2780a3126abbffe09c96c 100644 (file)
@@ -75,14 +75,15 @@ public:
         * Constructor.
         * Creates a new window and opens it.
         * To check if the window was created properly, use the getValid() method.
-        * @param title         The text shown in the title bar of the window.
-        * @param left          The coordinate of the left edge of the window.
-        * @param top           The coordinate of the top edge of the window.
-        * @param width         The width the window.
-        * @param heigh         The height the window.
-        * @param state         The state the window is initially opened with.
-        * @param type          The type of drawing context installed in this window.
-        * @param stereoVisual  Stereo visual for quad buffered stereo.
+        * @param title                         The text shown in the title bar of the window.
+        * @param left                          The coordinate of the left edge of the window.
+        * @param top                           The coordinate of the top edge of the window.
+        * @param width                         The width the window.
+        * @param heigh                         The height the window.
+        * @param state                         The state the window is initially opened with.
+        * @param type                          The type of drawing context installed in this window.
+        * @param stereoVisual          Stereo visual for quad buffered stereo.
+        * @param numOfAASamples        Number of samples used for AA (zero if no AA)
         */
        GHOST_Window(
                const STR_String& title, 
@@ -92,7 +93,8 @@ public:
                GHOST_TUns32 height,
                GHOST_TWindowState state,
                GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
-               const bool stereoVisual = false);
+               const bool stereoVisual = false,
+               const GHOST_TUns16 numOfAASamples = 0);
 
        /**
         * @section Interface inherited from GHOST_IWindow left for derived class
@@ -319,6 +321,9 @@ protected:
         *  the graphics h/w
         */
        bool m_stereoVisual;
+       
+       /** Number of samples used in anti-aliasing, set to 0 if no AA **/
+       GHOST_TUns16 m_numOfAASamples;
     
     /** Full-screen width */
     GHOST_TUns32 m_fullScreenWidth;
index 362e949a0a4f14554826686966ed0e7c73ae5370..3e53a0521463748ac034187ad71dc0e8719a4467 100644 (file)
@@ -98,7 +98,8 @@ GHOST_WindowCarbon::GHOST_WindowCarbon(
        GHOST_TUns32 height,
        GHOST_TWindowState state,
        GHOST_TDrawingContextType type,
-       const bool stereoVisual
+       const bool stereoVisual,
+       const GHOST_TUns16 numOfAASamples
 ) :
        GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone),
        m_windowRef(0),
index dd00add7fb1940f83ae65a6eabc1e80f2db83f32..b91e5410ddd375ce44a10f49ca6d27b630ace2c7 100644 (file)
@@ -80,7 +80,8 @@ public:
                GHOST_TUns32 height,
                GHOST_TWindowState state,
                GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
-               const bool stereoVisual = false
+               const bool stereoVisual = false,
+               const GHOST_TUns16 numOfAASamples = 0
        );
 
        /**
index e59d9c173330ce69603809fbace61166b998a07d..b54634b08d7eb085cf0ac3d36506181664e9a57b 100644 (file)
@@ -61,15 +61,16 @@ public:
         * Constructor.
         * Creates a new window and opens it.
         * To check if the window was created properly, use the getValid() method.
-        * @param systemCocoa The associated system class to forward events to
-        * @param title         The text shown in the title bar of the window.
-        * @param left          The coordinate of the left edge of the window.
-        * @param top           The coordinate of the top edge of the window.
-        * @param width         The width the window.
-        * @param height        The height the window.
-        * @param state         The state the window is initially opened with.
-        * @param type          The type of drawing context installed in this window.
-        * @param stereoVisual  Stereo visual for quad buffered stereo.
+        * @param systemCocoa           The associated system class to forward events to
+        * @param title                         The text shown in the title bar of the window.
+        * @param left                          The coordinate of the left edge of the window.
+        * @param top                           The coordinate of the top edge of the window.
+        * @param width                         The width the window.
+        * @param height                        The height the window.
+        * @param state                         The state the window is initially opened with.
+        * @param type                          The type of drawing context installed in this window.
+        * @param stereoVisual          Stereo visual for quad buffered stereo.
+        * @param numOfAASamples        Number of samples used for AA (zero if no AA)
         */
        GHOST_WindowCocoa(
                GHOST_SystemCocoa *systemCocoa,
@@ -80,7 +81,8 @@ public:
                GHOST_TUns32 height,
                GHOST_TWindowState state,
                GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
-               const bool stereoVisual = false
+               const bool stereoVisual = false,
+               const GHOST_TUns16 numOfAASamples = 0
        );
 
        /**
index 0f8ed741fdfaa0cd6ff17560f9b6c7da48f277ec..4d1aa35c4e73d41e553d7ecd2546d9e88237111e 100644 (file)
 #include <Carbon/Carbon.h>
 #endif
 
+#include <OpenGL/gl.h>
 /***** Multithreaded opengl code : uncomment for enabling
 #include <OpenGL/OpenGL.h>
 */
+
  
 #include "GHOST_WindowCocoa.h"
 #include "GHOST_SystemCocoa.h"
@@ -277,14 +279,15 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
        GHOST_TUns32 height,
        GHOST_TWindowState state,
        GHOST_TDrawingContextType type,
-       const bool stereoVisual
+       const bool stereoVisual, const GHOST_TUns16 numOfAASamples
 ) :
-       GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual),
+       GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual, numOfAASamples),
        m_customCursor(0)
 {
        NSOpenGLPixelFormatAttribute pixelFormatAttrsWindow[40];
+       NSOpenGLPixelFormat *pixelFormat = nil;
        int i;
-       
+               
        m_systemCocoa = systemCocoa;
        m_fullScreen = false;
        
@@ -329,13 +332,52 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
        
        if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
        
+       if (numOfAASamples>0) {
+               // Multisample anti-aliasing
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFAMultisample;
+               
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFASampleBuffers;
+               pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 1;
+               
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFASamples;
+               pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) numOfAASamples;
+               
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFANoRecovery;
+       }
+       
        pixelFormatAttrsWindow[i] = (NSOpenGLPixelFormatAttribute) 0;
        
-
-       //Creates the OpenGL View inside the window
-       NSOpenGLPixelFormat *pixelFormat =
-       [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttrsWindow];
+       pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttrsWindow];
+       
        
+       //Fall back to no multisampling if Antialiasing init failed
+       if (pixelFormat == nil) {
+               i=0;
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFADoubleBuffer;
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
+               //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,;   // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
+               
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize;
+               pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 32;
+               
+               if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
+               
+               pixelFormatAttrsWindow[i] = (NSOpenGLPixelFormatAttribute) 0;
+               
+               pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttrsWindow];
+               
+       }
+       
+       if (numOfAASamples>0) { //Set m_numOfAASamples to the actual value
+               GLint gli;
+               [pixelFormat getValues:&gli forAttribute:NSOpenGLPFASamples forVirtualScreen:0];
+               if (m_numOfAASamples != (GHOST_TUns16)gli) {
+                       m_numOfAASamples = (GHOST_TUns16)gli;
+                       printf("GHOST_Window could be created with anti-aliasing of only %i samples\n",m_numOfAASamples);
+               }
+       }
+               
+       //Creates the OpenGL View inside the window
        m_openGLView = [[CocoaOpenGLView alloc] initWithFrame:rect
                                                                                                 pixelFormat:pixelFormat];
        
index ea14f1dfc1b4dd18a5aa606fcb6fdcb82f026b1f..e276f216fb7a1883fa36e83efe9ae4b395e41d3e 100644 (file)
@@ -105,10 +105,11 @@ GHOST_WindowWin32::GHOST_WindowWin32(
        GHOST_TUns32 height,
        GHOST_TWindowState state,
        GHOST_TDrawingContextType type,
-       const bool stereoVisual)
+       const bool stereoVisual,
+       const GHOST_TUns16 numOfAASamples)
 :
        GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone,
-       stereoVisual),
+       stereoVisual,numOfAASamples),
        m_system(system),
        m_hDC(0),
        m_hGlRc(0),
index 07a31911a5e28a21d7d7b33fb4f17a8db070bb59..954546f3d82eb46cbe28f5ce8a3597c85c4ed4fc 100644 (file)
@@ -75,6 +75,7 @@ public:
         * @param state         The state the window is initially opened with.
         * @param type          The type of drawing context installed in this window.
         * @param stereoVisual  Stereo visual for quad buffered stereo.
+        * @param numOfAASamples        Number of samples used for AA (zero if no AA)
         */
        GHOST_WindowWin32(
                GHOST_SystemWin32 * system,
@@ -85,7 +86,8 @@ public:
                GHOST_TUns32 height,
                GHOST_TWindowState state,
                GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
-               const bool stereoVisual = false
+               const bool stereoVisual = false,
+               const GHOST_TUns16 numOfAASamples = 0
        );
 
        /**
index 25d6c5980f658d777fe4331c260e84a2e3b5f233..286e64e7e2330d36faf36ec47c66a967759052b4 100644 (file)
@@ -153,9 +153,10 @@ GHOST_WindowX11(
        GHOST_TWindowState state,
        const GHOST_TEmbedderWindowID parentWindow,
        GHOST_TDrawingContextType type,
-       const bool stereoVisual
+       const bool stereoVisual,
+       const GHOST_TUns16 numOfAASamples
 ) :
-       GHOST_Window(title,left,top,width,height,state,type,stereoVisual),
+       GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples),
        m_context(NULL),
        m_display(display),
        m_system (system),
index 0dba1776553a30311671be88574ee1ff57c7f192..9a299e16eb436e623433838b420a44c65388d8ff 100644 (file)
@@ -67,6 +67,7 @@ public:
         * @param parentWindow  Parent (embedder) window
         * @param type          The type of drawing context installed in this window.
         * @param stereoVisual  Stereo visual for quad buffered stereo.
+        * @param numOfAASamples        Number of samples used for AA (zero if no AA)
         */
        GHOST_WindowX11(
                GHOST_SystemX11 *system,
@@ -79,7 +80,8 @@ public:
                GHOST_TWindowState state,
                const GHOST_TEmbedderWindowID parentWindow,
                GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
-               const bool stereoVisual = false
+               const bool stereoVisual = false,
+               const GHOST_TUns16 numOfAASamples = 0
        );
 
                bool 
index 54f6d58ced45df2b652e21bda3ea680b2c36e6f7..61e6063329a649dde118b79cb414d1b48f15cdb4 100644 (file)
@@ -312,7 +312,8 @@ static void wm_window_add_ghostwindow(wmWindowManager *wm, char *title, wmWindow
                                                                 win->posx, posy, win->sizex, win->sizey, 
                                                                 inital_state, 
                                                                 GHOST_kDrawingContextTypeOpenGL,
-                                                                0 /* no stereo */);
+                                                                0 /* no stereo */,
+                                                                4 /* 4x AA */);
        
        if (ghostwin) {