Commit bc69429a authored by Maciej Suminski's avatar Maciej Suminski

Added GetTarget() for GALs.

parent 7d5a4563
...@@ -740,6 +740,14 @@ void CAIRO_GAL::SetTarget( RenderTarget aTarget ) ...@@ -740,6 +740,14 @@ void CAIRO_GAL::SetTarget( RenderTarget aTarget )
} }
cairo_push_group( currentContext ); cairo_push_group( currentContext );
currentTarget = aTarget;
}
RenderTarget CAIRO_GAL::GetTarget() const
{
return currentTarget;
} }
......
...@@ -700,6 +700,14 @@ void OPENGL_GAL::SetTarget( RenderTarget aTarget ) ...@@ -700,6 +700,14 @@ void OPENGL_GAL::SetTarget( RenderTarget aTarget )
currentManager = &overlayManager; currentManager = &overlayManager;
break; break;
} }
currentTarget = aTarget;
}
RenderTarget OPENGL_GAL::GetTarget() const
{
return currentTarget;
} }
......
...@@ -218,6 +218,9 @@ public: ...@@ -218,6 +218,9 @@ public:
/// @copydoc GAL::SetTarget() /// @copydoc GAL::SetTarget()
virtual void SetTarget( RenderTarget aTarget ); virtual void SetTarget( RenderTarget aTarget );
/// @copydoc GAL::GetTarget()
virtual RenderTarget GetTarget() const;
// ------- // -------
// Cursor // Cursor
// ------- // -------
...@@ -263,6 +266,7 @@ private: ...@@ -263,6 +266,7 @@ private:
boost::shared_ptr<CAIRO_COMPOSITOR> compositor; ///< Object for layers compositing boost::shared_ptr<CAIRO_COMPOSITOR> compositor; ///< Object for layers compositing
unsigned int mainBuffer; ///< Handle to the main buffer unsigned int mainBuffer; ///< Handle to the main buffer
unsigned int overlayBuffer; ///< Handle to the overlay buffer unsigned int overlayBuffer; ///< Handle to the overlay buffer
RenderTarget currentTarget; ///< Current rendering target
// Variables related to wxWidgets // Variables related to wxWidgets
wxWindow* parentWindow; ///< Parent window wxWindow* parentWindow; ///< Parent window
......
...@@ -572,6 +572,13 @@ public: ...@@ -572,6 +572,13 @@ public:
*/ */
virtual void SetTarget( RenderTarget aTarget ) = 0; virtual void SetTarget( RenderTarget aTarget ) = 0;
/**
* @brief Gets the currently used target for rendering.
*
* @return The current rendering target.
*/
virtual RenderTarget GetTarget() const = 0;
// ------------- // -------------
// Grid methods // Grid methods
// ------------- // -------------
......
...@@ -211,6 +211,9 @@ public: ...@@ -211,6 +211,9 @@ public:
/// @copydoc GAL::SetTarget() /// @copydoc GAL::SetTarget()
virtual void SetTarget( RenderTarget aTarget ); virtual void SetTarget( RenderTarget aTarget );
/// @copydoc GAL::GetTarget()
virtual RenderTarget GetTarget() const;
// ------- // -------
// Cursor // Cursor
// ------- // -------
...@@ -283,6 +286,7 @@ private: ...@@ -283,6 +286,7 @@ private:
OPENGL_COMPOSITOR compositor; ///< Handles multiple rendering targets OPENGL_COMPOSITOR compositor; ///< Handles multiple rendering targets
unsigned int mainBuffer; ///< Main rendering target unsigned int mainBuffer; ///< Main rendering target
unsigned int overlayBuffer; ///< Auxiliary rendering target (for menus etc.) unsigned int overlayBuffer; ///< Auxiliary rendering target (for menus etc.)
RenderTarget currentTarget; ///< Current rendering target
// Shader // Shader
SHADER shader; ///< There is only one shader used for different objects SHADER shader; ///< There is only one shader used for different objects
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment