Browse Source

add mark_new

David Rose 20 years ago
parent
commit
da1e8f95b4

+ 11 - 0
panda/src/display/graphicsStateGuardian.I

@@ -435,6 +435,17 @@ reset_if_new() {
   return false;
   return false;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: GraphicsStateGuardian::mark_new
+//       Access: Public
+//  Description: Marks the GSG as "new", so that the next call to
+//               reset_if_new() will be effective.
+////////////////////////////////////////////////////////////////////
+INLINE void GraphicsStateGuardian::
+mark_new() {
+  _needs_reset = true;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GraphicsStateGuardian::modify_state
 //     Function: GraphicsStateGuardian::modify_state
 //       Access: Public
 //       Access: Public

+ 1 - 0
panda/src/display/graphicsStateGuardian.h

@@ -177,6 +177,7 @@ public:
   virtual void framebuffer_release_texture(GraphicsOutput *win, Texture *tex);
   virtual void framebuffer_release_texture(GraphicsOutput *win, Texture *tex);
 
 
   INLINE bool reset_if_new();
   INLINE bool reset_if_new();
+  INLINE void mark_new();
   virtual void reset();
   virtual void reset();
 
 
   INLINE void modify_state(const RenderState *state);
   INLINE void modify_state(const RenderState *state);