00001 00002 #ifndef _TP_FEEDBACK_H 00003 #define _TP_FEEDBACK_H 00004 00005 #include "GL/GLPlatform.h" 00006 #include "GL/TPBuffer.h" 00007 00008 00009 namespace gk { 00010 00011 class FeedbackState 00012 { 00013 GLAttributeBuffer *m_buffer; 00014 int m_index; 00015 00016 FeedbackState( const FeedbackState& ); 00017 00018 public: 00019 FeedbackState( ) 00020 : 00021 m_buffer(NULL), 00022 m_index(-1) 00023 {} 00024 00025 ~FeedbackState( ) {} 00026 00027 FeedbackState& operator= ( const FeedbackState& b ) 00028 { 00029 m_buffer= b.m_buffer; 00030 m_index= b.m_index; 00031 return *this; 00032 } 00033 00034 FeedbackState& setFeedbackBuffer( const ProgramFeedback& feedback, GLAttributeBuffer *buffer ); 00035 FeedbackState& reset( ); 00036 00037 FeedbackState& setBuffer( GLAttributeBuffer *buffer ); 00038 00039 GLAttributeBuffer *getBuffer( ) 00040 { 00041 return m_buffer; 00042 } 00043 00044 const GLAttributeBuffer *getBuffer( ) const 00045 { 00046 return m_buffer; 00047 } 00048 00049 FeedbackState& setIndex( const int index ); 00050 00051 int getIndex( ) const 00052 { 00053 return m_index; 00054 } 00055 }; 00056 00057 extern FeedbackState Feedbacks[16]; 00058 extern FeedbackState ActiveFeedbacks[16]; 00059 00060 FeedbackState& setFeedbackBuffer( const ProgramFeedback& feedback, GLAttributeBuffer *buffer ); 00061 FeedbackState& resetFeedbackBuffer( const ProgramFeedback& feedback ); 00062 00063 } 00064 00065 #endif