comparison 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
comparison
equal deleted inserted replaced
633:46b95d06c8c2 634:5f381fa34769
73 73
74 /** Initializes the backend. 74 /** Initializes the backend.
75 */ 75 */
76 virtual void init() = 0; 76 virtual void init() = 0;
77 77
78 /** Forces a clear of the backbuffer
79 */
80 virtual void clearBackBuffer() = 0;
81
78 /** Performs cleanup actions. 82 /** Performs cleanup actions.
79 */ 83 */
80 virtual void deinit(); 84 virtual void deinit();
81 85
82 /** Creates the mainscreen (the display window). 86 /** Creates the mainscreen (the display window).
100 * Takes ownership over the surface. 104 * Takes ownership over the surface.
101 * @param surface The surface to convert. 105 * @param surface The surface to convert.
102 * @return The new Image. 106 * @return The new Image.
103 */ 107 */
104 virtual Image* createImage(SDL_Surface* surface) = 0; 108 virtual Image* createImage(SDL_Surface* surface) = 0;
105
106 /** Sets if the screen (backbuffer) should be cleared before rendering the next frame
107 * @param clear true = clear screen before next frame, false = do not clear screen
108 */
109 void setClearScreen(bool clear) { m_clear = clear; };
110 109
111 /** Returns a pointer to the main screen Image 110 /** Returns a pointer to the main screen Image
112 * @return A pointer to the main screen Image, or 0 if no mainscreen exists. 111 * @return A pointer to the main screen Image, or 0 if no mainscreen exists.
113 */ 112 */
114 Image* getScreenImage() const { return m_screen; }; 113 Image* getScreenImage() const { return m_screen; };
145 144
146 /** Gets the global colorkey setting 145 /** Gets the global colorkey setting
147 */ 146 */
148 const SDL_Color& getColorKey() const; 147 const SDL_Color& getColorKey() const;
149 148
149 /** Sets if the backbuffer should be cleared before rendering the next frame.
150 * @param clear true = clear screen before next frame, false = do not clear screen
151 */
152 void setClearBackBuffer(bool clear) { m_clear = clear; };
153
150 protected: 154 protected:
151 Image* m_screen; 155 Image* m_screen;
152 bool m_clear; 156 bool m_clear;
153 bool m_isalphaoptimized; 157 bool m_isalphaoptimized;
154 unsigned int m_chunkingsize; 158 unsigned int m_chunkingsize;