diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2014-07-04 20:30:33 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2014-07-04 20:30:33 +0400 |
commit | dc627428c92aaefe2a2c88d9d2557d376040cb45 (patch) | |
tree | ac6db4907837ad5261dffda8dbb71c90453fb900 | |
parent | 653379b15a95b3a348fe59a57620da5cdc3d8dae (diff) |
Added getNumOfAASamples to GHOST_IWindow interface.
I was going to use it for something, but decided to use glGetIntegerv(GL_SAMPLES, &i) instead.
It may be the case that neither this nor stereoVisual should be cached.
-rw-r--r-- | intern/ghost/GHOST_C-api.h | 6 | ||||
-rw-r--r-- | intern/ghost/GHOST_IWindow.h | 6 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_C-api.cpp | 7 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_Window.cpp | 5 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_Window.h | 6 |
5 files changed, 30 insertions, 0 deletions
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h index 2dbc48f8e21..b678d52c481 100644 --- a/intern/ghost/GHOST_C-api.h +++ b/intern/ghost/GHOST_C-api.h @@ -680,6 +680,12 @@ extern GHOST_TSuccess GHOST_SetSwapInterval(GHOST_WindowHandle windowhandle, int extern GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int* intervalOut); /** + * Gets the current swap interval for swapBuffers. + * \return Number of AA Samples (0 if there is no multisample buffer) + */ +extern GHOST_TUns16 GHOST_GetNumOfAASamples(GHOST_WindowHandle windowhandle); + +/** * Activates the drawing context of this window. * \param windowhandle The handle to the window * \return An intean success indicator. diff --git a/intern/ghost/GHOST_IWindow.h b/intern/ghost/GHOST_IWindow.h index 85649746b9b..ba3797a77e7 100644 --- a/intern/ghost/GHOST_IWindow.h +++ b/intern/ghost/GHOST_IWindow.h @@ -219,6 +219,12 @@ public: virtual GHOST_TSuccess getSwapInterval(int& intervalOut) = 0; /** + * Gets the current swap interval for swapBuffers. + * \return Number of AA Samples (0 if there is no multisample buffer) + */ + virtual GHOST_TUns16 getNumOfAASamples() = 0; + + /** * Activates the drawing context of this window. * \return A boolean success indicator. */ diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp index f074e2b0ecc..731cb29ee27 100644 --- a/intern/ghost/intern/GHOST_C-api.cpp +++ b/intern/ghost/intern/GHOST_C-api.cpp @@ -706,6 +706,13 @@ GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int* inter } +GHOST_TUns16 GHOST_GetNumOfAASamples(GHOST_WindowHandle windowhandle) +{ + GHOST_IWindow *window = (GHOST_IWindow *) windowhandle; + + return window->getNumOfAASamples(); +} + GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle) { GHOST_IWindow *window = (GHOST_IWindow *) windowhandle; diff --git a/intern/ghost/intern/GHOST_Window.cpp b/intern/ghost/intern/GHOST_Window.cpp index a320b6a67be..82dc039b840 100644 --- a/intern/ghost/intern/GHOST_Window.cpp +++ b/intern/ghost/intern/GHOST_Window.cpp @@ -131,6 +131,11 @@ GHOST_TSuccess GHOST_Window::getSwapInterval(int& intervalOut) return m_context->getSwapInterval(intervalOut); } +GHOST_TUns16 GHOST_Window::getNumOfAASamples() +{ + return m_context->getNumOfAASamples(); +} + GHOST_TSuccess GHOST_Window::activateDrawingContext() { return m_context->activateDrawingContext(); diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h index 53a547660c9..c6634d39618 100644 --- a/intern/ghost/intern/GHOST_Window.h +++ b/intern/ghost/intern/GHOST_Window.h @@ -207,6 +207,12 @@ public: virtual GHOST_TSuccess getSwapInterval(int& intervalOut); /** + * Gets the current swap interval for swapBuffers. + * \return Number of AA Samples (0 if there is no multisample buffer) + */ + virtual GHOST_TUns16 getNumOfAASamples(); + + /** * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop */ virtual void setAcceptDragOperation(bool canAccept); |