47 VL_DEBUG_SET_OBJECT_NAME()
50 #ifdef VL_USER_DATA_SHADER 51 mShaderUserData =
NULL;
71 #define GET_OR_CREATE(RS)\ 72 RS* rs = static_cast<RS*>( gocRenderStateSet()->renderState( RS_##RS ) ); \ 76 gocRenderStateSet()->setRenderState( rs, -1 ); \ 80 #define GET_OR_CREATE_IDX(RS, index)\ 81 RS* rs = static_cast<RS*>( gocRenderStateSet()->renderState( RS_##RS, index ) ); \ 85 gocRenderStateSet()->setRenderState( rs, index ); \ 183 glPixelTransferi(GL_MAP_COLOR, mapColor() ? GL_TRUE : GL_FALSE);
184 glPixelTransferi(GL_MAP_STENCIL, mapStencil() ? GL_TRUE : GL_FALSE);
185 glPixelTransferi(GL_INDEX_SHIFT, indexShift() );
186 glPixelTransferi(GL_INDEX_OFFSET, indexOffset() );
187 glPixelTransferf(GL_RED_SCALE, redScale() );
188 glPixelTransferf(GL_GREEN_SCALE, greenScale() );
189 glPixelTransferf(GL_BLUE_SCALE, blueScale() );
190 glPixelTransferf(GL_ALPHA_SCALE, alphaScale() );
191 glPixelTransferf(GL_DEPTH_SCALE, depthScale() );
192 glPixelTransferf(GL_RED_BIAS, redBias() );
193 glPixelTransferf(GL_GREEN_BIAS, greenBias() );
194 glPixelTransferf(GL_BLUE_BIAS, blueBias() );
195 glPixelTransferf(GL_ALPHA_BIAS, alphaBias() );
196 glPixelTransferf(GL_DEPTH_BIAS, depthBias() );
198 if (Has_GL_ARB_imaging)
200 glPixelTransferf(GL_POST_COLOR_MATRIX_RED_SCALE, postColorMatrixRedScale() );
201 glPixelTransferf(GL_POST_COLOR_MATRIX_GREEN_SCALE, postColorMatrixGreenScale() );
202 glPixelTransferf(GL_POST_COLOR_MATRIX_BLUE_SCALE, postColorMatrixBlueScale() );
203 glPixelTransferf(GL_POST_COLOR_MATRIX_ALPHA_SCALE, postColorMatrixAlphaScale() );
204 glPixelTransferf(GL_POST_COLOR_MATRIX_RED_BIAS, postColorMatrixRedBias() );
205 glPixelTransferf(GL_POST_COLOR_MATRIX_GREEN_BIAS, postColorMatrixGreenBias() );
206 glPixelTransferf(GL_POST_COLOR_MATRIX_BLUE_BIAS, postColorMatrixBlueBias() );
207 glPixelTransferf(GL_POST_COLOR_MATRIX_ALPHA_BIAS, postColorMatrixAlphaBias() );
208 glPixelTransferf(GL_POST_CONVOLUTION_RED_SCALE, postConvolutionRedScale() );
209 glPixelTransferf(GL_POST_CONVOLUTION_GREEN_SCALE, postConvolutionGreenScale() );
210 glPixelTransferf(GL_POST_CONVOLUTION_BLUE_SCALE, postConvolutionBlueScale() );
211 glPixelTransferf(GL_POST_CONVOLUTION_ALPHA_SCALE, postConvolutionAlphaScale() );
212 glPixelTransferf(GL_POST_CONVOLUTION_RED_BIAS, postConvolutionRedBias() );
213 glPixelTransferf(GL_POST_CONVOLUTION_GREEN_BIAS, postConvolutionGreenBias() );
214 glPixelTransferf(GL_POST_CONVOLUTION_BLUE_BIAS, postConvolutionBlueBias() );
215 glPixelTransferf(GL_POST_CONVOLUTION_ALPHA_BIAS, postConvolutionAlphaBias() );
228 glHint( GL_PERSPECTIVE_CORRECTION_HINT, mPerspectiveCorrectionHint );
VL_CHECK_OGL()
234 glHint( GL_GENERATE_MIPMAP_HINT, mGenerateMipmapHint );
VL_CHECK_OGL()
240 glHint( GL_POLYGON_SMOOTH_HINT, mPolygonSmoothHint );
VL_CHECK_OGL()
241 glHint( GL_LINE_SMOOTH_HINT, mLineSmoothHint );
VL_CHECK_OGL()
245 glHint( GL_POINT_SMOOTH_HINT, mPointSmoothHint );
VL_CHECK_OGL()
274 glDepthMask(mDepthMask?GL_TRUE:GL_FALSE);
VL_CHECK_OGL()
282 if ( mFrontFace == mBackFace )
284 glPolygonMode(GL_FRONT_AND_BACK, mFrontFace);
VL_CHECK_OGL()
306 VL_glBlendFuncSeparate(mSrcRGB, mDstRGB, mSrcAlpha, mDstAlpha);
VL_CHECK_OGL()
319 { VL_glBlendEquationSeparate(mModeRGB, mModeAlpha);
VL_CHECK_OGL() }
335 VL_DEBUG_SET_OBJECT_NAME()
336 mFrontAmbient =
fvec4(0.2f, 0.2f, 0.2f, 1.0f);
337 mFrontDiffuse =
fvec4(0.8f, 0.8f, 0.8f, 1.0f);
338 mFrontSpecular =
fvec4(0.0f, 0.0f, 0.0f, 1.0f);
339 mFrontEmission =
fvec4(0.0f, 0.0f, 0.0f, 1.0f);
342 mBackAmbient =
fvec4(0.2f, 0.2f, 0.2f, 1.0f);
343 mBackDiffuse =
fvec4(0.8f, 0.8f, 0.8f, 1.0f);
344 mBackSpecular =
fvec4(0.0f, 0.0f, 0.0f, 1.0f);
345 mBackEmission =
fvec4(0.0f, 0.0f, 0.0f, 1.0f);
348 mColorMaterialEnabled =
false;
355 float min_alpha =
std::min( mFrontAmbient.a(), mBackAmbient.a() );
356 min_alpha =
std::min( min_alpha, mFrontDiffuse.a() );
357 min_alpha =
std::min( min_alpha, mBackDiffuse.a() );
358 min_alpha =
std::min( min_alpha, mFrontSpecular.a());
359 min_alpha =
std::min( min_alpha, mBackSpecular.a() );
360 min_alpha =
std::min( min_alpha, mFrontEmission.a());
361 min_alpha =
std::min( min_alpha, mBackEmission.a() );
367 mFrontAmbient.a() *= alpha;
368 mBackAmbient.a() *= alpha;
369 mFrontDiffuse.a() *= alpha;
370 mBackDiffuse.a() *= alpha;
371 mFrontSpecular.a() *= alpha;
372 mBackSpecular.a() *= alpha;
373 mFrontEmission.a() *= alpha;
374 mBackEmission.a() *= alpha;
379 mFrontAmbient.a() = mBackAmbient.a() = alpha;
380 mFrontDiffuse.a() = mBackDiffuse.a() = alpha;
381 mFrontSpecular.a() = mBackSpecular.a() = alpha;
382 mFrontEmission.a() = mBackEmission.a() = alpha;
387 mFrontAmbient.a() = alpha;
388 mFrontDiffuse.a() = alpha;
389 mFrontSpecular.a() = alpha;
390 mFrontEmission.a() = alpha;
395 mBackAmbient.a() = alpha;
396 mBackDiffuse.a() = alpha;
397 mBackSpecular.a() = alpha;
398 mBackEmission.a() = alpha;
406 mFrontEmission = color;
408 setFrontTransparency(color.
a());
416 mBackEmission = color;
418 setBackTransparency(color.
a());
423 setFrontFlatColor(color);
424 setBackFlatColor(color);
431 #if defined(VL_OPENGL) 433 if (mColorMaterialEnabled)
435 glColorMaterial(colorMaterialFace(), colorMaterial());
VL_CHECK_OGL();
443 if ( mFrontAmbient == mBackAmbient )
445 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mFrontAmbient.ptr());
449 glMaterialfv(GL_FRONT, GL_AMBIENT, mFrontAmbient.ptr());
450 glMaterialfv(GL_BACK, GL_AMBIENT, mBackAmbient.ptr());
453 if ( mFrontDiffuse == mBackDiffuse )
455 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mFrontDiffuse.ptr());
459 glMaterialfv(GL_FRONT, GL_DIFFUSE, mFrontDiffuse.ptr());
460 glMaterialfv(GL_BACK, GL_DIFFUSE, mBackDiffuse.ptr());
463 if ( mFrontSpecular == mBackSpecular )
465 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mFrontSpecular.ptr());
469 glMaterialfv(GL_FRONT, GL_SPECULAR, mFrontSpecular.ptr());
470 glMaterialfv(GL_BACK, GL_SPECULAR, mBackSpecular.ptr());
473 if ( mFrontEmission == mBackEmission )
475 glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, mFrontEmission.ptr());
479 glMaterialfv(GL_FRONT, GL_EMISSION, mFrontEmission.ptr());
480 glMaterialfv(GL_BACK, GL_EMISSION, mBackEmission.ptr());
483 if ( mFrontShininess == mBackShininess )
485 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, mFrontShininess);
VL_CHECK_OGL();
489 glMaterialf(GL_FRONT, GL_SHININESS, mFrontShininess);
VL_CHECK_OGL();
490 glMaterialf(GL_BACK, GL_SHININESS, mBackShininess);
VL_CHECK_OGL();
496 if (mColorMaterialEnabled)
501 Log::error(
"OpenGL ES 1.x supports only CM_AMBIENT_AND_DIFFUSE color material mode!\n");
511 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mFrontAmbient.ptr());
512 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mFrontDiffuse.ptr());
513 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mFrontSpecular.ptr());
514 glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, mFrontEmission.ptr());
515 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, mFrontShininess);
VL_CHECK_OGL();
528 glLightModelf(GL_LIGHT_MODEL_COLOR_CONTROL, (
float)mColorControl);
VL_CHECK_OGL()
532 glLightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER, mLocalViewer ? 1.0f : 0.0f );
VL_CHECK_OGL()
535 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, mAmbientColor.ptr());
VL_CHECK_OGL()
536 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, mTwoSide ? 1.0f : 0.0f );
VL_CHECK_OGL()
590 VL_DEBUG_SET_OBJECT_NAME()
591 memset(mMask, 0xFF,
sizeof(
unsigned char)*32*32/8);
596 VL_DEBUG_SET_OBJECT_NAME()
602 memcpy(mMask, mask,
sizeof(
unsigned char)*32*32/8);
623 VL_glPointParameterf(GL_POINT_SIZE_MIN, mSizeMin);
VL_CHECK_OGL()
624 VL_glPointParameterf(GL_POINT_SIZE_MAX, mSizeMax);
VL_CHECK_OGL()
625 VL_glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, (
const float*)mDistanceAttenuation.ptr());
VL_CHECK_OGL()
629 VL_glPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE, mFadeThresholdSize);
VL_CHECK_OGL()
633 VL_glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, mPointSpriteCoordOrigin);
VL_CHECK_OGL()
643 VL_glStencilFuncSeparate(GL_FRONT, mFunction_Front, mRefValue_Front, mMask_Front);
VL_CHECK_OGL()
644 VL_glStencilFuncSeparate(GL_BACK, mFunction_Back, mRefValue_Back, mMask_Back);
VL_CHECK_OGL()
648 glStencilFunc(mFunction_Front, mRefValue_Front, mMask_Front);
VL_CHECK_OGL()
658 VL_glStencilOpSeparate(GL_FRONT, mSFail_Front, mDpFail_Front, mDpPass_Front);
VL_CHECK_OGL()
659 VL_glStencilOpSeparate(GL_BACK, mSFail_Back, mDpFail_Back, mDpPass_Back);
VL_CHECK_OGL()
663 glStencilOp(mSFail_Front, mDpFail_Front, mDpPass_Front);
VL_CHECK_OGL()
673 glStencilMaskSeparate(GL_FRONT, mMask_Front);
VL_CHECK_OGL()
674 glStencilMaskSeparate(GL_BACK, mMask_Back);
VL_CHECK_OGL()
686 VL_glBlendColor(mBlendColor.r(), mBlendColor.g(), mBlendColor.b(), mBlendColor.a());
VL_CHECK_OGL()
693 glVertexAttrib4fv( index, mValue.ptr() );
VL_CHECK_OGL()
702 glColor4f( mColor.r(), mColor.g(), mColor.b(), mColor.a() );
VL_CHECK_OGL()
710 VL_glSecondaryColor3f( mSecondaryColor.r(), mSecondaryColor.g(), mSecondaryColor.b() );
VL_CHECK_OGL()
718 glNormal3f( mNormal.x(), mNormal.y(), mNormal.z() );
VL_CHECK_OGL()
726 glColorMask(mRed?GL_TRUE:GL_FALSE, mGreen?GL_TRUE:GL_FALSE, mBlue?GL_TRUE:GL_FALSE, mAlpha?GL_TRUE:GL_FALSE);
VL_CHECK_OGL()
733 VL_glSampleCoverage(mValue, mInvert?GL_TRUE:GL_FALSE);
VL_CHECK_OGL()
746 setBorderColor(
fvec4(0,0,0,0));
748 setGenerateMipmap(
false);
763 mMagfilter = magfilter;
770 Log::bug(
"TexParameter::setMagFilter() accepts only the following values: TPF_LINEAR, TPF_NEAREST.\n");
783 bool err = (wrapS() != GL_CLAMP && wrapS() != GL_CLAMP_TO_EDGE && wrapS() != GL_CLAMP_TO_BORDER) |
784 (wrapT() != GL_CLAMP && wrapT() != GL_CLAMP_TO_EDGE && wrapT() != GL_CLAMP_TO_BORDER) |
785 (wrapR() != GL_CLAMP && wrapR() != GL_CLAMP_TO_EDGE && wrapR() != GL_CLAMP_TO_BORDER);
788 Log::bug(
"ARB_texture_rectangle extension allows only the following wrapping modes: GL_CLAMP, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER.\n");
VL_TRAP()
792 if (wrapS() == GL_MIRRORED_REPEAT || wrapT() == GL_MIRRORED_REPEAT || wrapR() == GL_MIRRORED_REPEAT)
796 Log::bug(
"GL_MIRRORED_REPEAT not supported by your OpenGL implementation.\n");
VL_TRAP()
800 if (wrapS() == GL_CLAMP_TO_EDGE || wrapT() == GL_CLAMP_TO_EDGE || wrapR() == GL_CLAMP_TO_EDGE)
804 Log::bug(
"GL_CLAMP_TO_EDGE not supported by your OpenGL implementation.\n");
VL_TRAP()
808 if (wrapS() == GL_CLAMP_TO_BORDER || wrapT() == GL_CLAMP_TO_BORDER || wrapR() == GL_CLAMP_TO_BORDER)
812 Log::bug(
"GL_CLAMP_TO_BORDER not supported by your OpenGL implementation.\n");
VL_TRAP()
821 #if defined(VL_OPENGL) 822 glTexParameterfv(dimension, GL_TEXTURE_BORDER_COLOR, borderColor().ptr());
VL_CHECK_OGL()
824 glTexParameteri(dimension, GL_TEXTURE_MIN_FILTER, minFilter());
VL_CHECK_OGL()
825 glTexParameteri(dimension, GL_TEXTURE_MAG_FILTER, magFilter());
VL_CHECK_OGL()
826 glTexParameteri(dimension, GL_TEXTURE_WRAP_S, wrapS());
VL_CHECK_OGL()
827 glTexParameteri(dimension, GL_TEXTURE_WRAP_T, wrapT());
VL_CHECK_OGL()
829 glTexParameteri(dimension, GL_TEXTURE_WRAP_R, wrapR());
VL_CHECK_OGL()
831 if (Has_GL_EXT_texture_filter_anisotropic)
832 glTexParameterf( dimension, GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy() );
VL_CHECK_OGL()
835 glTexParameteri(dimension, GL_GENERATE_MIPMAP, generateMipmap() ? GL_TRUE : GL_FALSE);
VL_CHECK_OGL()
839 glTexParameteri(dimension, GL_TEXTURE_COMPARE_MODE, compareMode() );
VL_CHECK_OGL()
840 glTexParameteri(dimension, GL_TEXTURE_COMPARE_FUNC, compareFunc() );
VL_CHECK_OGL()
842 glTexParameteri(dimension, GL_DEPTH_TEXTURE_MODE, depthTextureMode() );
VL_CHECK_OGL()
855 VL_DEBUG_SET_OBJECT_NAME()
858 mColor =
fvec4(0,0,0,0);
880 mPointSpriteCoordReplace =
false;
886 VL_CHECK(index < VL_MAX_LEGACY_TEXTURE_UNITS)
887 VL_CHECK(index < ctx->textureCoordCount())
890 VL_glActiveTexture( GL_TEXTURE0 + index );
VL_CHECK_OGL();
892 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode());
VL_CHECK_OGL()
897 glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color().ptr());
VL_CHECK_OGL()
904 glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE, rgbScale());
VL_CHECK_OGL()
905 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, combineRGB());
VL_CHECK_OGL()
906 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, source0RGB());
VL_CHECK_OGL()
907 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, source1RGB());
VL_CHECK_OGL()
908 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, operand0RGB());
VL_CHECK_OGL()
909 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, operand1RGB());
VL_CHECK_OGL()
912 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, source2RGB());
VL_CHECK_OGL()
913 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, operand2RGB());
VL_CHECK_OGL()
916 glTexEnvf(GL_TEXTURE_ENV, GL_ALPHA_SCALE, alphaScale());
VL_CHECK_OGL()
917 glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, combineAlpha());
VL_CHECK_OGL()
918 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, source0Alpha());
VL_CHECK_OGL()
919 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, source1Alpha());
VL_CHECK_OGL()
920 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, operand0Alpha());
VL_CHECK_OGL()
921 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, operand1Alpha());
VL_CHECK_OGL()
924 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, source2Alpha());
VL_CHECK_OGL()
925 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, operand2Alpha());
VL_CHECK_OGL()
932 glTexEnvi( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, mPointSpriteCoordReplace ? GL_TRUE : GL_FALSE );
VL_CHECK_OGL()
937 glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, mLodBias);
VL_CHECK_OGL()
948 VL_DEBUG_SET_OBJECT_NAME()
949 mEyePlaneS =
fvec4(1,0,0,0);
950 mObjectPlaneS =
fvec4(1,0,0,0);
951 mEyePlaneT =
fvec4(0,1,0,0);
952 mObjectPlaneT =
fvec4(0,1,0,0);
953 mEyePlaneR =
fvec4(0,0,1,0);
954 mObjectPlaneR =
fvec4(0,0,1,0);
955 mEyePlaneQ =
fvec4(0,0,0,1);
956 mObjectPlaneQ =
fvec4(0,0,0,1);
967 VL_CHECK(index < VL_MAX_LEGACY_TEXTURE_UNITS)
968 VL_CHECK(index < ctx->textureCoordCount())
970 VL_glActiveTexture( GL_TEXTURE0 + index );
974 #if defined(VL_OPENGL) 976 if (genModeS() || genModeT() || genModeR() || genModeQ())
978 glMatrixMode(GL_MODELVIEW);
984 glEnable(GL_TEXTURE_GEN_S);
985 glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, genModeS());
987 if (genModeS() ==
TGM_OBJECT_LINEAR) glTexGenfv(GL_S, GL_OBJECT_PLANE, objectPlaneS().ptr());
988 if (genModeS() ==
TGM_EYE_LINEAR) glTexGenfv(GL_S, GL_EYE_PLANE, eyePlaneS().ptr());
995 glEnable(GL_TEXTURE_GEN_T);
996 glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, genModeT());
998 if (genModeT() ==
TGM_OBJECT_LINEAR) glTexGenfv(GL_T, GL_OBJECT_PLANE, objectPlaneT().ptr());
999 if (genModeT() ==
TGM_EYE_LINEAR) glTexGenfv(GL_T, GL_EYE_PLANE, eyePlaneT().ptr());
1006 glEnable(GL_TEXTURE_GEN_R);
1007 glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, genModeR());
1009 if (genModeR() ==
TGM_OBJECT_LINEAR) glTexGenfv(GL_R, GL_OBJECT_PLANE, objectPlaneR().ptr());
1010 if (genModeR() ==
TGM_EYE_LINEAR) glTexGenfv(GL_R, GL_EYE_PLANE, eyePlaneR().ptr());
1017 glEnable(GL_TEXTURE_GEN_Q);
1018 glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, genModeQ());
1020 if (genModeQ() ==
TGM_OBJECT_LINEAR) glTexGenfv(GL_Q, GL_OBJECT_PLANE, objectPlaneQ().ptr());
1021 if (genModeQ() ==
TGM_EYE_LINEAR) glTexGenfv(GL_Q, GL_EYE_PLANE, eyePlaneQ().ptr());
1033 glDisable(GL_TEXTURE_GEN_S);
1036 glDisable(GL_TEXTURE_GEN_T);
1039 glDisable(GL_TEXTURE_GEN_R);
1042 glDisable(GL_TEXTURE_GEN_Q);
1044 #elif defined(VL_OPENGL_ES1) 1048 Log::bug(
"OpenGL ES does not support GL_SPHERE_MAP, GL_EYE_LINEAR or GL_OBJECT_LINEAR texture coordinate generation!\n");
VL_TRAP();
1052 if ( genModeS() != genModeT() || genModeT() != genModeR() )
1054 Log::bug(
"OpenGL ES requires the same texture coordinate generation mode for S, T and R!\n");
VL_TRAP();
1058 if(!Has_GL_OES_texture_cube_map)
1060 Log::bug(
"Use of vl::TexGen under OpenGL ES requires GL_OES_texture_cube_map extension!\n");
VL_TRAP();
1064 if (genModeS() && genModeT() && genModeR())
1071 glTexGeni( GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE, genModeS() );
VL_CHECK_OGL();
1077 glTexGeni( GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_OES );
VL_CHECK_OGL();
1090 VL_CHECK(index < VL_MAX_LEGACY_TEXTURE_UNITS)
1091 VL_CHECK(index < ctx->textureCoordCount())
1093 VL_glActiveTexture( GL_TEXTURE0 + index );
VL_CHECK_OGL();
1096 if (useCameraRotationInverse()) {
1108 return mTexture && mTexture->handle();
1114 VL_CHECK(index < VL_MAX_TEXTURE_IMAGE_UNITS)
1115 VL_CHECK(index < ctx->textureImageUnitCount())
1118 VL_glActiveTexture( GL_TEXTURE0 + index );
VL_CHECK_OGL()
1122 if (prev_tex_target)
1130 switch(prev_tex_target)
1147 glBindTexture( texture()->dimension(), texture()->handle() );
VL_CHECK_OGL()
1150 #if !defined(NDEBUG) && defined(VL_OPENGL) // glGetTexLevelParameter* is not supported under OpenGL ES 1151 if ( texture()->dimension() !=
TD_TEXTURE_BUFFER && (texture()->width() > 1 || texture()->height() > 1 || texture()->depth() > 1) )
1155 glGetTexLevelParameteriv( tex_target, 1, GL_TEXTURE_WIDTH, &width );
1159 switch(texture()->getTexParameter()->minFilter())
1166 Log::bug(
vl::Say(
"TextureSampler::apply() error: requested mipmapping texture filtering on a Texture with no mipmaps! (%s)\n") << texture()->
objectName() );
1182 switch(texture()->dimension())
1199 if ( texture()->getTexParameter()->dirty() )
1200 texture()->getTexParameter()->apply( texture()->dimension(), ctx );
float getMinimumAlpha() const
bool Has_GLES_Version_1_1
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
#define GET_OR_CREATE(RS)
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
RenderState wrapping the OpenGL function glPointParameter(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPointParameter.xml for more information.
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
RenderState wrapping the OpenGL function glStencilOp() and glStencilOpSeparate(), see also http://www...
LineWidth * gocLineWidth()
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
RenderState wrapping the OpenGL function glDepthFunc(), see also http://www.opengl.org/sdk/docs/man/xhtml/glDepthFunc.xml for more information.
RenderState wrapping the OpenGL function glHint(), see also http://www.opengl.org/sdk/docs/man/xhtml/...
Vector4< float > fvec4
A 4 components vector with float precision.
StencilFunc * gocStencilFunc()
A simple String formatting class.
RenderState wrapping the OpenGL function glPolygonOffset(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPolygonOffset.xml for more information.
RenderState wrapping the OpenGL function glPolygonMode(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPolygonMode.xml for more information.
TextureSampler * gocTextureSampler(int unit_index)
RenderState wrapping the OpenGL function glNormal(), see also http://www.opengl.org/sdk/docs/man/xhtm...
void set(const unsigned char *mask)
RenderState wrapping the OpenGL function glLogicOp(), see also http://www.opengl.org/sdk/docs/man/xht...
RenderState wrapping the OpenGL function glLightModel(), see also http://www.opengl.org/sdk/docs/man/xhtml/glLightModel.xml for more information.
ETextureDimension texUnitBinding(int unit_i) const
Returnes the texture target currently active for the specified texture unit. - For internal use only...
StencilOp * gocStencilOp()
RenderState wrapping the OpenGL function glBlendFunc(), see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml for more information.
Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard...
void setTransparency(float alpha)
RenderState wrapping the OpenGL function glPolygonStipple(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPolygonStipple.xml for more information.
RenderState wrapping the OpenGL function glFrontFace(), see also http://www.opengl.org/sdk/docs/man/xhtml/glFrontFace.xml for more information.
RenderState * renderState(ERenderState type, int index=-1)
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
RenderState wrapping the OpenGL function glShadeModel(), see also http://www.opengl.org/sdk/docs/man/xhtml/glShadeModel.xml for more information.
LineStipple * gocLineStipple()
GLSLProgram * gocGLSLProgram()
Gets or creates a GLSLProgram and returns it.
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
Wraps a GLSL program to which you can bind vertex, fragment and geometry shaders. ...
PixelTransfer * gocPixelTransfer()
Light * gocLight(int light_index)
RenderState wrapping the OpenGL function glDepthMask(), see also http://www.opengl.org/sdk/docs/man/xhtml/glDepthMask.xml for more information.
AlphaFunc * gocAlphaFunc()
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
ClipPlane * gocClipPlane(int plane_index)
PointSize * gocPointSize()
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
TextureMatrix * gocTextureMatrix(int unit_index)
void setFrontTransparency(float alpha)
PolygonMode * gocPolygonMode()
void apply(ETextureDimension dimension, OpenGLContext *gl) const
PointParameter * gocPointParameter()
RenderState wrapping the OpenGL function glPixelTransfer(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPixelTransfer.xml for more information.
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
BlendColor * gocBlendColor()
TexGen()
The eye and object planes are not transformed by any matrix (unlike usually with OpenGL), which means that the object plane is specified in object coordinates and that, the eye plane is specified in camera coordinates.
const Light * getLight(int light_index) const
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
RenderState wrapping the OpenGL function glColor(), see also http://www.opengl.org/sdk/docs/man/xhtml...
The TextureMatrix class uses a 4x4 matrix to transform the texture coordinates of a texture unit...
RenderState wrapping the OpenGL function glDepthRange(), see also http://www.opengl.org/sdk/docs/man/xhtml/glDepthRange.xml for more information.
Visualization Library main namespace.
PolygonOffset * gocPolygonOffset()
BlendEquation * gocBlendEquation()
DepthRange * gocDepthRange()
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
SampleCoverage * gocSampleCoverage()
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
RenderState wrapping the OpenGL function glTexEnv(), see also http://www.opengl.org/sdk/docs/man/xhtm...
RenderState wrapping the OpenGL function glBlendColor(), see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendColor.xml for more information.
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
DepthFunc * gocDepthFunc()
RenderState wrapping the OpenGL function glLineStipple(), see also http://www.opengl.org/sdk/docs/man/xhtml/glLineStipple.xml for more information.
bool Has_GLES_Version_2_0
FrontFace * gocFrontFace()
static void bug(const String &message)
Use this function to provide information about programming errors: wrong parameter initialization...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
Wraps the OpenGL function glClipPlane().
RenderState wrapping the OpenGL function glColorMask(), see also http://www.opengl.org/sdk/docs/man/xhtml/glColorMask.xml for more information.
RenderState wrapping the OpenGL function glVertexAttrib(), see also http://www.opengl.org/sdk/docs/man3/xhtml/glVertexAttrib.xml for more information.
Not supported under OpenGL ES 1.x.
float min(float a, float b)
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
The TextureSampler class associates a Texture object to an OpenGL texture unit.
const mat4 & modelingMatrix() const
Returns the Camera's modelingMatrix() (inverse of the view matrix).
bool Has_GL_GENERATE_MIPMAP
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
RenderState wrapping the OpenGL function glTexGen(), see also http://www.opengl.org/sdk/docs/man/xhtm...
RenderState wrapping the OpenGL function glLineWidth(), see also http://www.opengl.org/sdk/docs/man/xhtml/glLineWidth.xml for more information.
LightModel * gocLightModel()
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
Wraps the OpenGL functions glStencilFunc() and glStencilFuncSeparate(), see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilFunc.xml and http://www.opengl.org/sdk/docs/man/xhtml/glStencilFuncSeparate.xml for more information.
RenderState wrapping the OpenGL function glBlendEquation()/glBlendEquationSeparate(), see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml and http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquationSeparate.xml for more information.
RenderState wrapping the OpenGL function glMaterial() and glColorMaterial(), see also http://www...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
void setBackFlatColor(const fvec4 &color)
const GLSLProgram * getGLSLProgram() const
Returns a GLSLProgram if it exists or NULL otherwise.
#define GET_OR_CREATE_IDX(RS, index)
VertexAttrib * gocVertexAttrib(int attr_index)
RenderState wrapping the OpenGL function glPointSize(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPointSize.xml for more information.
void multiplyTransparency(float alpha)
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
const std::string & objectName() const
The name of the object, by default set to the object's class name.
virtual ~Shader()
Destructor.
ColorMask * gocColorMask()
const VertexAttrib * getVertexAttrib(int attr_index) const
RenderStateSet * getRenderStateSet()
RenderState wrapping the OpenGL function glAlphaFunc(), see also http://www.opengl.org/sdk/docs/man/xhtml/glAlphaFunc.xml for more information.
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
TexGen * gocTexGen(int unit_index)
BlendFunc * gocBlendFunc()
void setFrontFlatColor(const fvec4 &color)
fvec4 mVertexAttribValue[VA_MaxAttribCount]
Wraps the OpenGL function glLight().
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
bool Has_Fixed_Function_Pipeline
OpenGL: true if !Is_OpenGL_Forward_Compatible && !Is_OpenGL_Core_Profile OpenGL ES 1: always true Ope...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
void setTexUnitBinding(int unit_i, ETextureDimension target)
Declares that texture unit unit_i is currently bound to the specified texture target. - For internal use only.
ShadeModel * gocShadeModel()
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
void setFlatColor(const fvec4 &color)
Represents a virtual camera defining, among other things, the point of view from which scenes can be ...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
RenderState wrapping the OpenGL function glStencilMask() and glStencilMaskSeparate(), see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilMask.xml and http://www.opengl.org/sdk/docs/man/xhtml/glStencilMaskSeparate.xml for more information.
Not supported under OpenGL ES 1.x.
void setMagFilter(ETexParamFilter magfilter)
SecondaryColor * gocSecondaryColor()
TexEnv * gocTexEnv(int unit_index)
DepthMask * gocDepthMask()
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
void setBackTransparency(float alpha)
virtual void apply(int index, const Camera *, OpenGLContext *ctx) const
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it...
RenderState wrapping the OpenGL function glFog(), see also http://www.opengl.org/sdk/docs/man/xhtml/g...
PolygonStipple * gocPolygonStipple()
const ClipPlane * getClipPlane(int plane_index) const
RenderState wrapping the OpenGL function glSecondaryColor(), see also http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml for more information.
const T_Scalar & a() const
StencilMask * gocStencilMask()
RenderState wrapping the OpenGL function glSampleCoverage(), see also http://www.opengl.org/sdk/docs/man/xhtml/glSampleCoverage.xml for more information.
RenderState wrapping the OpenGL function glCullFace(), see also http://www.opengl.org/sdk/docs/man/xhtml/glCullFace.xml for more information.