diff engine/core/video/renderbackend.h @ 634:5f381fa34769

* Added the clearBackBuffer() function to the renderbackends. * Renamed setClearScreen() to setClearBackBuffer() * The SDL render backend now honors what was set with setClearBackBuffer() * Documented testRenderedViewPort() * The OpenGL backend no longer clears the screen every frame by default. testRenderedViewPort() takes care of clearing the screen for now. Note: if the user overrides the default and enables clearing of the backbuffer that it may be cleared twice in one frame (OpenGL only)!
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 06 Oct 2010 15:49:53 +0000
parents 46b95d06c8c2
children 3094988564d5
line wrap: on
line diff
--- a/engine/core/video/renderbackend.h	Wed Oct 06 14:09:24 2010 +0000
+++ b/engine/core/video/renderbackend.h	Wed Oct 06 15:49:53 2010 +0000
@@ -75,6 +75,10 @@
 		 */
 		virtual void init() = 0;
 
+		/** Forces a clear of the backbuffer
+		 */
+		virtual void clearBackBuffer() = 0;
+
 		/** Performs cleanup actions.
 		 */
 		virtual void deinit();
@@ -103,11 +107,6 @@
 		 */
 		virtual Image* createImage(SDL_Surface* surface) = 0;
 
-		/** Sets if the screen (backbuffer) should be cleared before rendering the next frame
-		 * @param clear true = clear screen before next frame, false = do not clear screen
-		 */
-		void setClearScreen(bool clear) { m_clear = clear; };
-
 		/** Returns a pointer to the main screen Image
 		 * @return A pointer to the main screen Image, or 0 if no mainscreen exists.
 		 */
@@ -147,6 +146,11 @@
 		 */
 		const SDL_Color& getColorKey() const;
 
+		/** Sets if the backbuffer should be cleared before rendering the next frame.
+		 * @param clear true = clear screen before next frame, false = do not clear screen
+		 */
+		void setClearBackBuffer(bool clear) { m_clear = clear; };
+
 	protected:
 		Image* m_screen;
 		bool m_clear;