14#ifndef OSG_FRAGMENTPROGRAM
15#define OSG_FRAGMENTPROGRAM 1
27#ifndef GL_ARB_fragment_program
28#define GL_FRAGMENT_PROGRAM_ARB 0x8804
29#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
30#define GL_PROGRAM_LENGTH_ARB 0x8627
31#define GL_PROGRAM_FORMAT_ARB 0x8876
32#define GL_PROGRAM_BINDING_ARB 0x8677
33#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
34#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
35#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
36#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
37#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
38#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
39#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
40#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
41#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
42#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
43#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
44#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
45#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
46#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
47#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
48#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
49#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
50#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
51#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
52#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
53#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
54#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
55#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
56#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
57#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
58#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
59#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
60#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
61#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
62#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
63#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
64#define GL_PROGRAM_STRING_ARB 0x8628
65#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
66#define GL_CURRENT_MATRIX_ARB 0x8641
67#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
68#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
69#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
70#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
71#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
72#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
73#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
74#define GL_MATRIX0_ARB 0x88C0
75#define GL_MATRIX1_ARB 0x88C1
76#define GL_MATRIX2_ARB 0x88C2
77#define GL_MATRIX3_ARB 0x88C3
78#define GL_MATRIX4_ARB 0x88C4
79#define GL_MATRIX5_ARB 0x88C5
80#define GL_MATRIX6_ARB 0x88C6
81#define GL_MATRIX7_ARB 0x88C7
82#define GL_MATRIX8_ARB 0x88C8
83#define GL_MATRIX9_ARB 0x88C9
84#define GL_MATRIX10_ARB 0x88CA
85#define GL_MATRIX11_ARB 0x88CB
86#define GL_MATRIX12_ARB 0x88CC
87#define GL_MATRIX13_ARB 0x88CD
88#define GL_MATRIX14_ARB 0x88CE
89#define GL_MATRIX15_ARB 0x88CF
90#define GL_MATRIX16_ARB 0x88D0
91#define GL_MATRIX17_ARB 0x88D1
92#define GL_MATRIX18_ARB 0x88D2
93#define GL_MATRIX19_ARB 0x88D3
94#define GL_MATRIX20_ARB 0x88D4
95#define GL_MATRIX21_ARB 0x88D5
96#define GL_MATRIX22_ARB 0x88D6
97#define GL_MATRIX23_ARB 0x88D7
98#define GL_MATRIX24_ARB 0x88D8
99#define GL_MATRIX25_ARB 0x88D9
100#define GL_MATRIX26_ARB 0x88DA
101#define GL_MATRIX27_ARB 0x88DB
102#define GL_MATRIX28_ARB 0x88DC
103#define GL_MATRIX29_ARB 0x88DD
104#define GL_MATRIX30_ARB 0x88DE
105#define GL_MATRIX31_ARB 0x88DF
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
#define GL_FRAGMENT_PROGRAM_ARB
Definition FragmentProgram:28
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Matrixd Matrix
Definition Matrix:27
Vec4f Vec4
Definition Vec4:21
Implements a simple buffered value for values that need to be buffered on a per graphics context basi...
Definition buffered_value:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
void setLocalParameters(const LocalParamList &lpl)
Set list of Program Parameters.
Definition FragmentProgram:180
GLuint & getFragmentProgramID(unsigned int contextID) const
Get the handle to the fragment program id for the current context.
Definition FragmentProgram:148
MatrixList _matrixList
Definition FragmentProgram:231
const MatrixList & getMatrices() const
Get list of Matrices.
Definition FragmentProgram:203
const std::string & getFragmentProgram() const
Get the fragment program.
Definition FragmentProgram:169
void setFragmentProgram(const std::string &program)
Set the fragment program using C++ style string.
Definition FragmentProgram:162
LocalParamList _programLocalParameters
Definition FragmentProgram:230
void setFragmentProgram(const char *program)
Set the fragment program using a C style string.
Definition FragmentProgram:155
std::string _fragmentProgram
Definition FragmentProgram:228
virtual void compileGLObjects(State &state) const
Default to nothing to compile - all state is applied immediately.
Definition FragmentProgram:210
buffered_value< GLuint > FragmentProgramIDList
Definition FragmentProgram:225
MatrixList & getMatrices()
Get list of Matrices.
Definition FragmentProgram:200
void setMatrices(const MatrixList &matrices)
Set list of Matrices.
Definition FragmentProgram:197
virtual void apply(State &state) const
apply the OpenGL state attributes.
FragmentProgramIDList _fragmentProgramIDList
Definition FragmentProgram:226
FragmentProgram(const FragmentProgram &vp, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual ~FragmentProgram()
void dirtyFragmentProgramObject()
Force a recompile on next apply() of associated OpenGL vertex program objects.
virtual void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
void setMatrix(const GLenum mode, const Matrix &matrix)
Matrix.
Definition FragmentProgram:189
virtual void releaseGLObjects(State *state=0) const
release an OpenGL objects in specified graphics context if State object is passed,...
virtual int compare(const osg::StateAttribute &sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition FragmentProgram:127
virtual bool getModeUsage(StateAttribute::ModeUsage &usage) const
Return the modes associated with this StateAttribute.
Definition FragmentProgram:139
const LocalParamList & getLocalParameters() const
Get const list of Program Parameters.
Definition FragmentProgram:186
META_StateAttribute(osg, FragmentProgram, FRAGMENTPROGRAM)
std::map< GLenum, Matrix > MatrixList
Definition FragmentProgram:194
LocalParamList & getLocalParameters()
Get list of Program Parameters.
Definition FragmentProgram:183
void setProgramLocalParameter(const GLuint index, const Vec4 &p)
Set Program Parameters.
Definition FragmentProgram:172
std::map< GLuint, Vec4 > LocalParamList
Definition FragmentProgram:177
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
@ FRAGMENTPROGRAM
Definition StateAttribute:162
Definition StateAttribute:308
virtual void usesMode(GLMode mode)=0
#define OSG_EXPORT
Definition Export:39