@@ -113,6 +113,12 @@ class Display : public SubsystemInterface
113113 virtual Bool isClippingEnabled () = 0;
114114 virtual void enableClipping ( Bool onoff ) = 0;
115115
116+ // TheSuperHackers @performance Batching 2D draw operations to reduce state changes and draw call overhead.
117+ virtual void beginBatch (); // /< start batching 2D draw operations.
118+ virtual void endBatch (); // /< stop batching and flush pending 2D draw operations.
119+ virtual void flush (); // /< flush pending 2D draw operations without ending the batch.
120+ virtual Bool isBatching () const { return m_isBatching; } // /< returns true if currently batching 2D draw operations.
121+
116122 virtual void step () {}; // /< Do one fixed time step
117123 virtual void draw () override ; // /< Redraw the entire display
118124 virtual void setTimeOfDay ( TimeOfDay tod ) = 0; // /< Set the time of day for this display
@@ -182,11 +188,15 @@ class Display : public SubsystemInterface
182188 virtual Int getLastFrameDrawCalls () = 0; // /< returns the number of draw calls issued in the previous frame
183189
184190protected:
191+ virtual void onBeginBatch () { }
192+ virtual void onEndBatch () { }
193+ virtual void onFlush () { }
185194
186195 virtual void deleteViews (); // /< delete all views
187196 UnsignedInt m_width, m_height; // /< Dimensions of the display
188197 UnsignedInt m_bitDepth; // /< bit depth of the display
189198 Bool m_windowed; // /< TRUE when windowed, FALSE when fullscreen
199+ Bool m_isBatching;
190200 View *m_viewList; // /< All of the views into the world
191201
192202 // Cinematic text data
0 commit comments