00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <stdlib.h>
00044 #include <stdio.h>
00045
00046 #include <OSGConfig.h>
00047
00048 #include <OSGGL.h>
00049 #include <OSGGLEXT.h>
00050
00051 #include "OSGWindow.h"
00052
00053 #include "OSGVertexProgramChunk.h"
00054
00055 OSG_USING_NAMESPACE
00056
00067
00068
00069
00070
00071 StateChunkClass VertexProgramChunk::_class("VertexProgram");
00072
00073 UInt32 VertexProgramChunk::_arbVertexProgram;
00074
00075
00076
00077
00078
00079 void VertexProgramChunk::initMethod (void)
00080 {
00081 }
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 VertexProgramChunk::VertexProgramChunk(void) :
00095 Inherited()
00096 {
00097 _arbVertexProgram = Window::registerExtension("GL_ARB_vertex_program");
00098 }
00099
00100 VertexProgramChunk::VertexProgramChunk(const VertexProgramChunk &source) :
00101 Inherited(source)
00102 {
00103 }
00104
00105 VertexProgramChunk::~VertexProgramChunk(void)
00106 {
00107 }
00108
00109
00110
00111 void VertexProgramChunk::onCreate(const VertexProgramChunk *)
00112 {
00113 if(GlobalSystemState == Startup)
00114 return;
00115
00116
00117
00118
00119 VertexProgramChunkPtr tmpPtr(*this);
00120
00121 beginEditCP(tmpPtr, VertexProgramChunk::GLIdFieldMask);
00122
00123 setGLId(
00124 Window::registerGLObject(
00125 osgTypedMethodVoidFunctor2ObjCPtrPtr<VertexProgramChunkPtr,
00126 Window ,
00127 UInt32>(
00128 tmpPtr,
00129 &VertexProgramChunk::handleGL),
00130 1));
00131
00132 endEditCP(tmpPtr, VertexProgramChunk::GLIdFieldMask);
00133 }
00134
00135
00136
00137
00138 const StateChunkClass *VertexProgramChunk::getClass(void) const
00139 {
00140 return &_class;
00141 }
00142
00143
00144
00145 void VertexProgramChunk::changed(BitVector whichField, UInt32 origin)
00146 {
00147 Inherited::changed(whichField, origin);
00148 }
00149
00150 void VertexProgramChunk::dump( UInt32 ,
00151 const BitVector ) const
00152 {
00153 SLOG << "Dump VertexProgramChunk NI" << std::endl;
00154 }
00155
00156
00157
00161 void VertexProgramChunk::handleGL(Window *win, UInt32 idstatus)
00162 {
00163 Inherited::handleGL(win, idstatus, GL_VERTEX_PROGRAM_ARB, _arbVertexProgram);
00164 }
00165
00166 UInt32 VertexProgramChunk::getExtension(void) const
00167 {
00168 return _arbVertexProgram;
00169 }
00170
00171 GLenum VertexProgramChunk::getTarget(void) const
00172 {
00173 return GL_VERTEX_PROGRAM_ARB;
00174 }
00175
00176 const char *VertexProgramChunk::getTargetName(void) const
00177 {
00178 return "Vertex Program";
00179 }
00180
00181
00182
00183
00184
00185 #ifdef OSG_SGI_CC
00186 #pragma set woff 1174
00187 #endif
00188
00189 #ifdef OSG_LINUX_ICC
00190 #pragma warning( disable : 177 )
00191 #endif
00192
00193 namespace
00194 {
00195 static Char8 cvsid_cpp [] = "@(#)$Id: $";
00196 static Char8 cvsid_hpp [] = OSGVERTEXPROGRAMCHUNKBASE_HEADER_CVSID;
00197 static Char8 cvsid_inl [] = OSGVERTEXPROGRAMCHUNKBASE_INLINE_CVSID;
00198
00199 static Char8 cvsid_fields_hpp[] = OSGVERTEXPROGRAMCHUNKFIELDS_HEADER_CVSID;
00200 }
00201
00202 #ifdef __sgi
00203 #pragma reset woff 1174
00204 #endif
00205