57 VL_DEBUG_SET_OBJECT_NAME()
64 memset( mTexUnitBinding, 0,
sizeof(mTexUnitBinding) );
72 mIsInitialized =
false;
73 mHasDoubleBuffer =
false;
74 mVertexAttribCount = 0;
75 mTextureImageUnitCount = 0;
76 mTextureCoordCount = 0;
80 mNormal =
fvec3(0,1,0);
81 mColor =
fvec4(1,1,1,1);
82 mSecondaryColor =
fvec3(1,1,1);
87 mContinuousUpdate =
true;
88 mIgnoreNextMouseMoveEvent =
false;
94 if ( mLeftFramebuffer || mRightFramebuffer || mFramebufferObject.size() || mEventListeners.size() )
96 Log::warning(
"~OpenGLContext() called before dispatchDestroyEvent(), your application will likely crash.\n");
104 mFramebufferObject.push_back(
new FramebufferObject(
this, width, height, draw_buffer, read_buffer));
105 mFramebufferObject.back()->createFBO();
106 return mFramebufferObject.back().get();
112 for(
unsigned i=0; i<mFramebufferObject.size(); ++i)
114 if (mFramebufferObject[i] == fbort)
116 mFramebufferObject[i]->deleteFBO();
117 mFramebufferObject[i]->mOpenGLContext =
NULL;
118 mFramebufferObject.erase(mFramebufferObject.begin()+i);
126 if ( mIsInitialized ) {
127 mIsInitialized =
false;
129 destroyAllFramebufferObjects();
130 mLeftFramebuffer->mOpenGLContext =
NULL;
131 mRightFramebuffer->mOpenGLContext =
NULL;
132 mLeftFramebuffer =
NULL;
133 mRightFramebuffer =
NULL;
136 mDefaultRenderStates[i].mRS =
NULL;
138 mCurrentEnableSet =
NULL;
139 mNewEnableSet =
NULL;
140 mCurrentRenderStateSet =
NULL;
141 mNewRenderStateSet =
NULL;
143 for(
int i=0; i<VL_MAX_TEXTURE_IMAGE_UNITS; ++i )
153 for(
unsigned i=0; i<mFramebufferObject.size(); ++i)
155 mFramebufferObject[i]->deleteFBO();
156 mFramebufferObject[i]->mOpenGLContext =
NULL;
158 mFramebufferObject.clear();
165 if (el->mOpenGLContext ==
NULL)
167 mEventListeners.push_back(el);
168 el->mOpenGLContext =
this;
178 VL_CHECK( el->mOpenGLContext ==
this || el->mOpenGLContext ==
NULL );
179 if (el->mOpenGLContext ==
this)
181 std::vector< ref<UIEventListener> >::iterator pos = std::find(mEventListeners.begin(), mEventListeners.end(), el);
182 if( pos != mEventListeners.end() )
184 mEventListeners.erase( pos );
187 el->mOpenGLContext =
NULL;
196 std::vector< ref<UIEventListener> > temp = mEventListeners;
197 mEventListeners.clear();
198 for(
size_t i=0; i<temp.size(); ++i)
200 VL_CHECK( temp[i]->mOpenGLContext ==
this );
201 temp[i]->removedListenerEvent(
this);
202 temp[i]->mOpenGLContext =
NULL;
208 #if defined(VL_OPENGL) && defined(VL_PLATFORM_WINDOWS) 210 if (Has_GL_EXT_swap_control)
211 wglSwapIntervalEXT(enable?1:0);
224 #if defined(VL_OPENGL) && defined(VL_PLATFORM_WINDOWS) 225 if (Has_GL_EXT_swap_control)
226 return wglGetSwapIntervalEXT() != 0;
236 mIsInitialized =
false;
248 mExtensions = getOpenGLExtensions();
256 mTextureImageUnitCount = mTextureCoordCount = 1;
260 glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_tmp);
VL_CHECK_OGL();
261 mTextureCoordCount = mTextureImageUnitCount = max_tmp > mTextureImageUnitCount ? max_tmp : mTextureImageUnitCount;
266 glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_tmp);
VL_CHECK_OGL();
267 mTextureCoordCount = mTextureImageUnitCount = max_tmp > mTextureImageUnitCount ? max_tmp : mTextureImageUnitCount;
272 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &max_tmp);
VL_CHECK_OGL();
273 mTextureImageUnitCount = max_tmp > mTextureImageUnitCount ? max_tmp : mTextureImageUnitCount;
275 mTextureImageUnitCount = mTextureImageUnitCount < VL_MAX_TEXTURE_IMAGE_UNITS ? mTextureImageUnitCount : VL_MAX_TEXTURE_IMAGE_UNITS;
276 mTextureCoordCount = mTextureCoordCount < VL_MAX_LEGACY_TEXTURE_UNITS ? mTextureCoordCount : VL_MAX_LEGACY_TEXTURE_UNITS;
279 mVertexAttribCount = 0;
281 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &mVertexAttribCount);
292 #if defined(VL_OPENGL) 294 glDrawBuffer(GL_BACK);
296 mHasDoubleBuffer =
false;
298 mHasDoubleBuffer =
true;
300 mHasDoubleBuffer =
true;
303 setupDefaultRenderStates();
305 return mIsInitialized =
true;
311 size_t len = strlen(ext_name);
312 const char* ext = mExtensions.c_str();
313 const char* ext_end = ext + strlen(ext);
315 for(
const char* pos = strstr(ext,ext_name); pos && pos < ext_end; pos = strstr(pos,ext_name) )
317 if (pos[len] ==
' ' || pos[len] == 0)
337 Log::debug(
Say(
"OpenGL version: %s\n") << glGetString(GL_VERSION) );
338 Log::debug(
Say(
"OpenGL vendor: %s\n") << glGetString(GL_VENDOR) );
339 Log::debug(
Say(
"OpenGL renderer: %s\n") << glGetString(GL_RENDERER) );
343 Log::debug(
Say(
"GLSL version: %s\n") << glGetString(GL_SHADING_LANGUAGE_VERSION) );
346 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_val);
351 glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_val);
357 glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_val);
363 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &tmp);
365 max_val = tmp > max_val ? tmp : max_val;
366 Log::debug(
Say(
"Texture units (combined): %n\n") << max_val);
372 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_val);
373 Log::debug(
Say(
"Texture units (fragment shader): %n\n") << max_val);
377 if (Has_GL_EXT_texture_filter_anisotropic)
378 glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_val);
379 Log::debug(
Say(
"Anisotropic texture filter: %s, ") << (Has_GL_EXT_texture_filter_anisotropic?
"YES" :
"NO") );
381 Log::debug(
Say(
"S3 Texture Compression: %s\n") << (Has_GL_EXT_texture_compression_s3tc?
"YES" :
"NO") );
389 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max_val);
VL_CHECK_OGL();
405 glGetIntegerv(GL_MAX_VARYING_VECTORS, &max_val);
VL_CHECK_OGL();
410 glGetIntegerv(GL_MAX_VARYING_FLOATS, &max_val);
VL_CHECK_OGL();
421 glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &max_val);
VL_CHECK_OGL();
425 glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max_val);
VL_CHECK_OGL();
429 Log::debug(
Say(
"Max fragment uniform vectors: %n\n")<<max_val);
437 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &max_val);
VL_CHECK_OGL();
441 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, &max_val);
VL_CHECK_OGL();
445 Log::debug(
Say(
"Max vertex uniform vectors: %n\n")<<max_val);
451 glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &max_val);
VL_CHECK_OGL();
458 glGetIntegerv(GL_MAX_ELEMENTS_INDICES, &max_val );
VL_CHECK_OGL();
465 glGetIntegerv(GL_MAX_CLIP_PLANES, &max_val );
VL_CHECK_OGL();
472 glGetIntegerv(GL_MAX_CLIP_DISTANCES, &max_val );
VL_CHECK_OGL();
478 Log::debug(
"\n --- OpenGL Extensions --- \n");
480 std::stringstream sstream;
481 sstream << extensions();
482 std::string ext, line;
483 for(
int i=0; !sstream.eof(); ++i )
500 Log::debug(
Say(
"%s\n") << line );
510 mNewEnableSet->clear();
514 for(
size_t i=0; i<new_enables->
enables().size(); ++i )
517 mNewEnableSet->append(capability);
518 if(!mCurrentEnableSet->hasKey(capability))
522 if (glGetError() != GL_NO_ERROR)
531 for(
EEnable* capability = mCurrentEnableSet->begin(); capability != mCurrentEnableSet->end(); ++capability)
533 if (!mNewEnableSet->hasKey(*capability))
537 if (glGetError() != GL_NO_ERROR)
545 std::swap(mNewEnableSet, mCurrentEnableSet);
553 mNewRenderStateSet->clear();
560 mNewRenderStateSet->append(rs.
type(), rs);
561 if ( ! mCurrentRenderStateSet->hasKey(rs.
type()) || rs.
mRS.get() != mCurrentRenderStateSet->valueFromKey( rs.
type() ).mRS.get() )
569 for(
RenderStateSlot* rs = mCurrentRenderStateSet->begin(); rs != mCurrentRenderStateSet->end(); ++rs )
571 if ( ! mNewRenderStateSet->hasKey( rs->type() ) )
577 std::swap(mNewRenderStateSet, mCurrentRenderStateSet);
580 void OpenGLContext::setupDefaultRenderStates()
654 for(
int i=0; i<textureImageUnitCount(); ++i) {
660 for(
int i=0; i<textureCoordCount(); ++i)
677 if (mDefaultRenderStates[i].mRS)
686 mCurrentRenderStateSet->clear();
687 memset( mTexUnitBinding, 0,
sizeof( mTexUnitBinding ) );
692 mCurrentEnableSet->clear();
703 glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &vao );
VL_CHECK_OGL();
704 if (vao != (
int)mDefaultVAO ) {
705 error_msg +=
Say(
"Current VAO (%n) is not the default one (%n)!\n") << vao << mDefaultVAO;
731 glGetIntegerv(GL_MAX_LIGHTS, &max_lights);
733 for(
int i=0; i<max_lights; ++i)
735 if (glIsEnabled(GL_LIGHT0+i))
737 error_msg +=
Say(
" - GL_LIGHT%n was enabled!\n") << i;
738 glDisable(GL_LIGHT0+i);
744 glGetIntegerv(GL_MAX_CLIP_PLANES, &max_planes);
746 for(
int i=0; i<max_planes; ++i)
748 if (glIsEnabled(GL_CLIP_PLANE0+i))
750 error_msg +=
Say(
" - GL_CLIP_PLANE%n was enabled!\n") << i;
751 glDisable(GL_CLIP_PLANE0+i);
758 error_msg +=
" - GL_PRIMITIVE_RESTART was enabled!\n";
759 glDisable(GL_PRIMITIVE_RESTART);
766 #if !defined(VL_OPENGL_ES2) 767 glGetIntegerv(GL_ACTIVE_TEXTURE, &active_tex);
VL_CHECK_OGL();
768 active_tex -= GL_TEXTURE0;
771 error_msg +=
Say(
" - Active texture unit is GL_TEXTURE%n instead of GL_TEXTURE0!\n") << active_tex;
772 glActiveTexture(GL_TEXTURE0);
779 glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE, &active_tex);
VL_CHECK_OGL();
780 active_tex -= GL_TEXTURE0;
783 error_msg +=
Say(
" - Active client texture unit is GL_TEXTURE%n instead of GL_TEXTURE0!\n") << active_tex;
784 glClientActiveTexture(GL_TEXTURE0);
793 int coord_count = 16;
797 glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_tmp);
VL_CHECK_OGL();
798 coord_count = max_tmp < coord_count ? max_tmp : coord_count;
806 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &max_tmp);
VL_CHECK_OGL();
807 coord_count = max_tmp < coord_count ? max_tmp : coord_count;
813 glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_tmp);
VL_CHECK_OGL();
814 coord_count = max_tmp < coord_count ? max_tmp : coord_count;
822 VL_glActiveTexture(GL_TEXTURE0+coord_count);
VL_CHECK_OGL()
826 VL_glClientActiveTexture(GL_TEXTURE0+coord_count);
VL_CHECK_OGL()
835 if (memcmp(matrix,imatrix,
sizeof(matrix)) != 0)
837 error_msg +=
Say(
" - Texture matrix was not set to identity on texture unit %n!\n") << coord_count;
840 if (glIsEnabled(GL_TEXTURE_COORD_ARRAY))
842 error_msg +=
Say(
" - GL_TEXTURE_COORD_ARRAY was enabled on texture unit %n!\n") << coord_count;
843 glDisable(GL_TEXTURE_COORD_ARRAY);
850 if (glIsEnabled(GL_TEXTURE_1D))
852 error_msg +=
Say(
" - GL_TEXTURE_1D was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
853 glDisable(GL_TEXTURE_1D);
857 glGetIntegerv(GL_TEXTURE_BINDING_1D, &bound_tex);
VL_CHECK_OGL()
860 error_msg +=
Say(
" - GL_TEXTURE_BINDING_1D != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
864 if (glIsEnabled(GL_TEXTURE_2D))
866 error_msg +=
Say(
" - GL_TEXTURE_2D was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
867 glDisable(GL_TEXTURE_2D);
872 glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound_tex);
VL_CHECK_OGL()
875 error_msg +=
Say(
" - GL_TEXTURE_BINDING_2D != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
882 error_msg +=
Say(
" - GL_TEXTURE_RECTANGLE was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
883 glDisable(GL_TEXTURE_RECTANGLE);
887 glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE, &bound_tex);
VL_CHECK_OGL()
890 error_msg +=
Say(
" - GL_TEXTURE_BINDING_RECTANGLE != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
898 error_msg +=
Say(
" - GL_TEXTURE_3D was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
899 glDisable(GL_TEXTURE_3D);
903 glGetIntegerv(GL_TEXTURE_BINDING_3D, &bound_tex);
VL_CHECK_OGL()
906 error_msg +=
Say(
" - GL_TEXTURE_BINDING_3D != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
914 error_msg +=
Say(
" - GL_TEXTURE_CUBE_MAP was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
915 glDisable(GL_TEXTURE_CUBE_MAP);
919 glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &bound_tex);
VL_CHECK_OGL()
922 error_msg +=
Say(
" - GL_TEXTURE_BINDING_CUBE_MAP != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
929 glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY, &bound_tex);
932 error_msg +=
Say(
" - GL_TEXTURE_BINDING_1D_ARRAY != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
936 glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &bound_tex);
939 error_msg +=
Say(
" - GL_TEXTURE_BINDING_2D_ARRAY != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
946 glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE, &bound_tex);
949 error_msg +=
Say(
" - GL_TEXTURE_BINDING_2D_MULTISAMPLE != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
953 glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY, &bound_tex);
956 error_msg +=
Say(
" - GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
963 glGetIntegerv(GL_TEXTURE_BINDING_BUFFER, &bound_tex);
966 error_msg +=
Say(
" - GL_TEXTURE_BINDING_BUFFER != 0 on texture unit GL_TEXTURE%n.\n") << coord_count;
972 #if defined(VL_OPENGL) 973 if (glIsEnabled(GL_TEXTURE_GEN_S))
975 error_msg +=
Say(
" - GL_TEXTURE_GEN_S was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
976 glDisable(GL_TEXTURE_GEN_S);
979 if (glIsEnabled(GL_TEXTURE_GEN_T))
981 error_msg +=
Say(
" - GL_TEXTURE_GEN_T was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
982 glDisable(GL_TEXTURE_GEN_T);
985 if (glIsEnabled(GL_TEXTURE_GEN_R))
987 error_msg +=
Say(
" - GL_TEXTURE_GEN_R was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
988 glDisable(GL_TEXTURE_GEN_R);
991 if (glIsEnabled(GL_TEXTURE_GEN_Q))
993 error_msg +=
Say(
" - GL_TEXTURE_GEN_Q was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
994 glDisable(GL_TEXTURE_GEN_Q);
996 #elif defined(VL_OPENGL_ES1) 997 if (Has_GL_OES_texture_cube_map && glIsEnabled(GL_TEXTURE_GEN_STR_OES))
999 error_msg +=
Say(
" - GL_TEXTURE_GEN_STR_OES was enabled on texture unit GL_TEXTURE%n.\n") << coord_count;
1000 glDisable(GL_TEXTURE_GEN_STR_OES);
1008 error_msg +=
" - GL_COLOR_MATERIAL was enabled!\n";
1009 glDisable(GL_COLOR_MATERIAL);
1014 if (glIsEnabled(GL_FOG_COORD_ARRAY))
1016 error_msg +=
" - GL_FOG_COORD_ARRAY was enabled!\n";
1017 glDisable(GL_FOG_COORD_ARRAY);
1023 if (glIsEnabled(GL_SECONDARY_COLOR_ARRAY))
1025 error_msg +=
" - GL_SECONDARY_COLOR_ARRAY was enabled!\n";
1026 glDisable(GL_SECONDARY_COLOR_ARRAY);
1032 error_msg +=
" - GL_COLOR_ARRAY was enabled!\n";
1033 glDisable(GL_COLOR_ARRAY);
1038 error_msg +=
" - GL_EDGE_FLAG_ARRAY was enabled!\n";
1039 glDisable(GL_EDGE_FLAG_ARRAY);
1044 error_msg +=
" - GL_INDEX_ARRAY was enabled!\n";
1045 glDisable(GL_INDEX_ARRAY);
1050 error_msg +=
" - GL_NORMAL_ARRAY was enabled!\n";
1051 glDisable(GL_NORMAL_ARRAY);
1056 error_msg +=
" - GL_VERTEX_ARRAY was enabled!\n";
1057 glDisable(GL_VERTEX_ARRAY);
1060 if (glIsEnabled(GL_SCISSOR_TEST))
1062 error_msg +=
" - GL_SCISSOR_TEST was enabled!\n";
1063 glDisable(GL_SCISSOR_TEST);
1066 GLint max_vert_attribs = 0;
1068 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max_vert_attribs);
1069 for(
int i=0; i<max_vert_attribs; ++i)
1071 GLint is_enabled = 0;
1072 glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &is_enabled);
1075 error_msg +=
Say(
" - GL_VERTEX_ATTRIB_ARRAY #%n is enabled!\n") << i;
1079 if (Has_GL_ARB_imaging)
1081 if (glIsEnabled(GL_HISTOGRAM))
1083 error_msg +=
" - GL_HISTOGRAM was enabled!\n";
1084 glDisable(GL_HISTOGRAM);
1087 if (glIsEnabled(GL_MINMAX))
1089 error_msg +=
" - GL_MINMAX was enabled!\n";
1090 glDisable(GL_MINMAX);
1095 #if defined(VL_OPENGL_ES2) 1096 GLint blend_src = 0;
1097 GLint blend_dst = 0;
1098 glGetIntegerv( GL_BLEND_SRC_RGB, &blend_src );
VL_CHECK_OGL();
1099 glGetIntegerv( GL_BLEND_DST_RGB, &blend_dst );
VL_CHECK_OGL();
1100 if (blend_src != GL_SRC_ALPHA)
1102 error_msg +=
" - GL_BLEND_SRC is not GL_SRC_ALPHA!\n";
1103 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1105 if (blend_dst != GL_ONE_MINUS_SRC_ALPHA)
1107 error_msg +=
" - GL_BLEND_DST is not GL_ONE_MINUS_SRC_ALPHA!\n";
1108 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1111 GLint blend_src = 0;
1112 GLint blend_dst = 0;
1113 glGetIntegerv( GL_BLEND_SRC, &blend_src );
VL_CHECK_OGL();
1114 glGetIntegerv( GL_BLEND_DST, &blend_dst );
VL_CHECK_OGL();
1115 if (blend_src != GL_SRC_ALPHA)
1117 error_msg +=
" - GL_BLEND_SRC is not GL_SRC_ALPHA!\n";
1118 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1120 if (blend_dst != GL_ONE_MINUS_SRC_ALPHA)
1122 error_msg +=
" - GL_BLEND_DST is not GL_ONE_MINUS_SRC_ALPHA!\n";
1123 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1132 glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &buf_bind);
VL_CHECK_OGL();
1135 error_msg +=
" - GL_ARRAY_BUFFER_BINDING should be 0!\n";
1138 glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &buf_bind);
VL_CHECK_OGL();
1141 error_msg +=
" - GL_ELEMENT_ARRAY_BUFFER_BINDING should be 0!\n";
1147 glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &buf_bind);
VL_CHECK_OGL();
1150 error_msg +=
" - GL_PIXEL_PACK_BUFFER_BINDING should be 0!\n";
1153 glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &buf_bind);
VL_CHECK_OGL();
1156 error_msg +=
" - GL_PIXEL_UNPACK_BUFFER_BINDING should be 0!\n";
1159 if (Has_GL_ARB_uniform_buffer_object)
1162 glGetIntegerv(GL_UNIFORM_BUFFER_BINDING, &buf_bind);
VL_CHECK_OGL();
1165 error_msg +=
" - GL_UNIFORM_BUFFER_BINDING should be 0!\n";
1171 glGetIntegerv(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, &buf_bind);
VL_CHECK_OGL();
1174 error_msg +=
" - GL_TRANSFORM_FEEDBACK_BUFFER_BINDING should be 0!\n";
1180 GLint viewport[4] = {0,0,0,0};
1181 glGetIntegerv(GL_VIEWPORT, viewport);
1182 if (viewport[2] * viewport[3] == 1)
1184 error_msg +=
" - Viewport dimension is 1 pixel!\n" 1185 "Did you forget to call camera()->viewport()->setWidth()/setHeight() upon window resize event?\n";
1189 GLboolean write_mask[4];
1190 glGetBooleanv(GL_COLOR_WRITEMASK, write_mask);
VL_CHECK_OGL();
1191 if( !write_mask[0] || !write_mask[1] || !write_mask[2] || !write_mask[3] )
1193 error_msg +=
" - Color write-mask should be glColorMask(GL_TRUE ,GL_TRUE, GL_TRUE, GL_TRUE)!\n";
1194 glColorMask(GL_TRUE ,GL_TRUE, GL_TRUE, GL_TRUE);
1197 glGetBooleanv(GL_DEPTH_WRITEMASK, write_mask);
VL_CHECK_OGL();
1198 if ( !write_mask[0] )
1200 error_msg +=
" - Depth write-mask should be glDepthMask(GL_TRUE)!\n";
1201 glDepthMask(GL_TRUE);
1204 #if defined(VL_OPENGL) 1205 GLint poly_mode[] = { GL_FILL, GL_FILL };
1206 glGetIntegerv(GL_POLYGON_MODE, poly_mode);
VL_CHECK_OGL();
1207 if ( poly_mode[0] != GL_FILL || poly_mode[1] != GL_FILL )
1209 error_msg +=
" - Polygon mode should be glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)!\n";
1210 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
VL_CHECK_OGL();
1214 if (!error_msg.
empty() && verbose)
1218 Log::error(
"To disable this check use globalSettings()->setCheckOpenGLStates(false);\n");
1220 << glGetString(GL_VENDOR) << glGetString(GL_RENDERER) << glGetString(GL_VERSION) );
1225 return error_msg.
empty();
1234 std::set<std::string> name_set;
1235 for(
size_t i=0; i<u1->
uniforms().size(); ++i )
1236 name_set.insert( u1->
uniforms()[i]->name() );
1240 for(
size_t j=0; j<u2->
uniforms().size(); ++j )
1241 if ( name_set.find( u2->
uniforms()[j]->name() ) != name_set.end() )
1261 VL_glBindFramebuffer( GL_FRAMEBUFFER, 0 );
VL_CHECK_OGL();
1264 #if defined(VL_OPENGL) 1265 if ( hasDoubleBuffer() )
1283 resetRenderStates();
1297 const unsigned char* ptr = 0;
1298 bool enabled =
false;
1303 if ( mVertexArray.mEnabled || enabled )
1317 if ( mVertexArray.mPtr != ptr || mVertexArray.mBufferObject != buf_obj )
1319 if (!mVertexArray.mEnabled)
1327 VL_glBindBuffer(GL_ARRAY_BUFFER, buf_obj);
VL_CHECK_OGL();
1329 mVertexArray.mPtr = ptr;
1330 mVertexArray.mBufferObject = buf_obj;
1336 mVertexArray.mPtr = 0;
1337 mVertexArray.mBufferObject = 0;
1339 mVertexArray.mEnabled = enabled;
1345 if ( mNormalArray.mEnabled || enabled )
1359 if ( mNormalArray.mPtr != ptr || mNormalArray.mBufferObject != buf_obj )
1361 if (!mNormalArray.mEnabled)
1365 VL_glBindBuffer(GL_ARRAY_BUFFER, buf_obj);
VL_CHECK_OGL();
1367 mNormalArray.mPtr = ptr;
1368 mNormalArray.mBufferObject = buf_obj;
1376 glNormal3f( mNormal.x(), mNormal.y(), mNormal.z() );
1378 mNormalArray.mPtr = 0;
1379 mNormalArray.mBufferObject = 0;
1381 mNormalArray.mEnabled = enabled;
1387 if ( mColorArray.mEnabled || enabled )
1401 if ( mColorArray.mPtr != ptr || mColorArray.mBufferObject != buf_obj )
1403 if (!mColorArray.mEnabled)
1407 VL_glBindBuffer(GL_ARRAY_BUFFER, buf_obj);
VL_CHECK_OGL();
1409 mColorArray.mPtr = ptr;
1410 mColorArray.mBufferObject = buf_obj;
1418 glColor4f( mColor.r(), mColor.g(), mColor.b(), mColor.a() );
1420 mColorArray.mPtr = 0;
1421 mColorArray.mBufferObject = 0;
1423 mColorArray.mEnabled = enabled;
1429 if ( mSecondaryColorArray.mEnabled || enabled )
1443 if ( mSecondaryColorArray.mPtr != ptr || mSecondaryColorArray.mBufferObject != buf_obj )
1445 if (!mSecondaryColorArray.mEnabled)
1447 glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
VL_CHECK_OGL();
1449 VL_glBindBuffer(GL_ARRAY_BUFFER, buf_obj);
VL_CHECK_OGL();
1451 mSecondaryColorArray.mPtr = ptr;
1452 mSecondaryColorArray.mBufferObject = buf_obj;
1457 glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
VL_CHECK_OGL();
1460 VL_glSecondaryColor3f( mSecondaryColor.r(), mSecondaryColor.g(), mSecondaryColor.b() );
1462 mSecondaryColorArray.mPtr = 0;
1463 mSecondaryColorArray.mBufferObject = 0;
1465 mSecondaryColorArray.mEnabled = enabled;
1471 if ( mFogArray.mEnabled || enabled )
1485 if ( mFogArray.mPtr != ptr || mFogArray.mBufferObject != buf_obj )
1487 if (!mFogArray.mEnabled)
1489 glEnableClientState(GL_FOG_COORD_ARRAY);
VL_CHECK_OGL();
1491 VL_glBindBuffer(GL_ARRAY_BUFFER, buf_obj);
VL_CHECK_OGL();
1493 mFogArray.mPtr = ptr;
1494 mFogArray.mBufferObject = buf_obj;
1499 glDisableClientState(GL_FOG_COORD_ARRAY);
VL_CHECK_OGL();
1501 mFogArray.mBufferObject = 0;
1503 mFogArray.mEnabled = enabled;
1508 for(
int tex_coord_i=0; tex_coord_i<textureCoordCount(); ++tex_coord_i)
1514 if ( mTexCoordArray[tex_coord_i].mEnabled ) {
1515 VL_glClientActiveTexture(GL_TEXTURE0 + tex_coord_i);
VL_CHECK_OGL();
1516 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
VL_CHECK_OGL();
1517 mTexCoordArray[tex_coord_i].mEnabled =
false;
1518 mTexCoordArray[tex_coord_i].mPtr = 0;
1519 mTexCoordArray[tex_coord_i].mBufferObject = 0;
1522 if ( ! mTexCoordArray[tex_coord_i].mEnabled ) {
1523 VL_glClientActiveTexture(GL_TEXTURE0 + tex_coord_i);
VL_CHECK_OGL();
1524 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
VL_CHECK_OGL();
1525 mTexCoordArray[tex_coord_i].mEnabled = 1;
1538 if ( mTexCoordArray[tex_coord_i].mPtr != ptr || mTexCoordArray[tex_coord_i].mBufferObject != buf_obj )
1540 mTexCoordArray[tex_coord_i].mPtr = ptr;
1541 mTexCoordArray[tex_coord_i].mBufferObject = buf_obj;
1543 VL_glBindBuffer(GL_ARRAY_BUFFER, buf_obj);
VL_CHECK_OGL();
1552 const unsigned char* ptr = 0;
1554 for(
int idx=0; idx<vertexAttribCount(); ++idx)
1562 if ( mVertexAttrib[idx].mEnabled ) {
1564 mVertexAttrib[idx].mEnabled =
false;
1565 mVertexAttrib[idx].mPtr = 0;
1566 mVertexAttrib[idx].mBufferObject = 0;
1568 glVertexAttrib4fv( idx, mVertexAttribValue[idx].ptr() );
VL_CHECK_OGL();
1571 #if !defined(NDEBUG) 1573 glGetVertexAttribiv( idx, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &enabled);
VL_CHECK(!enabled);
1580 if ( ! mVertexAttrib[idx].mEnabled ) {
1582 mVertexAttrib[idx].mEnabled =
true;
1585 #if !defined(NDEBUG) 1587 glGetVertexAttribiv( idx, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &enabled);
VL_CHECK(enabled);
1600 if ( mVertexAttrib[idx].mPtr != ptr || mVertexAttrib[idx].mBufferObject != buf_obj )
1602 mVertexAttrib[idx].mPtr = ptr;
1603 mVertexAttrib[idx].mBufferObject = buf_obj;
1604 VL_glBindBuffer(GL_ARRAY_BUFFER, buf_obj);
VL_CHECK_OGL();
1628 mGLSLUpdated =
true;
1630 for(
int i=0; i<mVertexAttribCount; ++i) {
1634 for(
int i=0; i<vertexAttribCount(); ++i)
1636 mVertexAttrib[i].mEnabled =
false;
1637 mVertexAttrib[i].mPtr = 0;
1638 mVertexAttrib[i].mBufferObject = 0;
1641 for(
int i=0; i<textureCoordCount(); ++i)
1643 mTexCoordArray[i].mEnabled =
false;
1644 mTexCoordArray[i].mPtr = 0;
1645 mTexCoordArray[i].mBufferObject = 0;
1648 mVertexArray.mEnabled =
false;
1649 mVertexArray.mPtr = 0;
1650 mVertexArray.mBufferObject = 0;
1652 mNormalArray.mEnabled =
false;
1653 mNormalArray.mPtr = 0;
1654 mNormalArray.mBufferObject = 0;
1656 mColorArray.mEnabled =
false;
1657 mColorArray.mPtr = 0;
1658 mColorArray.mBufferObject = 0;
1660 mSecondaryColorArray.mEnabled =
false;
1661 mSecondaryColorArray.mPtr = 0;
1662 mSecondaryColorArray.mBufferObject = 0;
1664 mFogArray.mEnabled =
false;
1666 mFogArray.mBufferObject = 0;
1671 VL_glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
VL_CHECK_OGL();
1678 for (
int i=mTextureCoordCount; i--; )
1680 VL_glClientActiveTexture(GL_TEXTURE0 + i);
VL_CHECK_OGL();
1681 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
VL_CHECK_OGL();
1688 glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
VL_CHECK_OGL();
1689 glDisableClientState(GL_FOG_COORD_ARRAY);
VL_CHECK_OGL();
1699 if ( vas != mCurVAS || mGLSLUpdated || force )
1703 if ( ! vas || force )
1710 if ( mGLSLProgram && mGLSLProgram->vl_VertexPosition() != -1 ) {
1712 if ( mVertexArray.mEnabled ) {
1715 bindVAS_Attribs( vas, use_bo );
1723 bindVAS_Fixed( vas, use_bo );
1739 mGLSLUpdated =
false;
1746 mGLSLUpdated =
true;
1775 mGLSLProgram = glsl;
1780 mGLSLProgram =
NULL;
1786 mGLSLProgram =
NULL;
static void debug(const String &message)
Use this function to provide extra information useful to investigate and solve problems.
virtual const ArrayAbstract * vertexArray() const =0
Conventional vertex array.
The ArrayAbstract class defines an abstract interface to conveniently manipulate data stored in a Buf...
bool Has_GLES_Version_1_1
virtual void addedListenerEvent(OpenGLContext *)=0
Event generated whenever a listener is bound to an OpenGLContext context.
RenderState wrapping the OpenGL function glPointParameter(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPointParameter.xml for more information.
RenderState wrapping the OpenGL function glStencilOp() and glStencilOpSeparate(), see also http://www...
Abstract interface to manipulate OpenGL's vertex attribute arrays.
virtual const ArrayAbstract * normalArray() const =0
Conventional normal array.
Vector3< float > fvec3
A 3 components vector with float precision.
bool Has_Cubemap_Textures
void setVSyncEnabled(bool enable)
If the OpenGL context is a widget this function enabled/disables double buffer swapping to the monito...
void resetContextStates(EResetContextStates start_or_finish)
Resets the OpenGL states necessary to begin and finish a rendering. - For internal use only...
const GLenum Translate_Enable[]
bool Has_Texture_Multisample
RenderState wrapping the OpenGL function glDepthFunc(), see also http://www.opengl.org/sdk/docs/man/xhtml/glDepthFunc.xml for more information.
size_t renderStatesCount() const
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.
The UIEventListener class listens to the events emitted by an OpenGLContext.
A simple String formatting class.
const char * Translate_Enable_String[]
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.
static void warning(const String &message)
Use this function to provide information about situations that might lead to errors or loss of data...
VLGRAPHICS_EXPORT void * getGLProcAddress(const char *name)
Returns the address of the specified OpenGL function if supported by the active OpenGL driver and pro...
void applyEnables(const EnableSet *cur)
Applies an EnableSet to an OpenGLContext - Typically for internal use only.
RenderState wrapping the OpenGL function glNormal(), see also http://www.opengl.org/sdk/docs/man/xhtm...
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
RenderState wrapping the OpenGL function glLogicOp(), see also http://www.opengl.org/sdk/docs/man/xht...
void eraseAllEventListeners()
Removes all UIEventListener previously registered.
virtual const ArrayAbstract * texCoordArray(int tex_unit) const =0
Conventional texture coords arrays.
Data will be sent using glVertexAttribIPointer(), that is, values are always left as integer values...
RenderState wrapping the OpenGL function glLightModel(), see also http://www.opengl.org/sdk/docs/man/xhtml/glLightModel.xml for more information.
RenderState wrapping the OpenGL function glBlendFunc(), see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml for more information.
bool linked() const
Returns true if the program has been succesfully linked.
void logOpenGLInfo()
Logs some information about the OpenGL context.
Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard...
RenderState wrapping the OpenGL function glPolygonStipple(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPolygonStipple.xml for more information.
If enabled, dither color components or indices before they are written to the color buffer...
RenderState wrapping the OpenGL function glFrontFace(), see also http://www.opengl.org/sdk/docs/man/xhtml/glFrontFace.xml for more information.
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.
void bindVAS_Fixed(const IVertexAttribSet *vas, bool use_vbo)
void resetEnables()
Resets all the interanal enable-tables - For internal use only.
void * getProcAddress(const char *function_name)
Returns the address of an OpenGL extension function.
virtual size_t glSize() const =0
Returns the number of scalar components for the array, ie 3 for ArrayFloat3, 1 for ArrayUInt1 etc...
Wraps a GLSL program to which you can bind vertex, fragment and geometry shaders. ...
bool Has_Texture_Rectangle
void addEventListener(UIEventListener *el)
Adds an UIEventListener to be notified of OpenGLContext related events.
RenderState wrapping the OpenGL function glDepthMask(), see also http://www.opengl.org/sdk/docs/man/xhtml/glDepthMask.xml for more information.
bool Is_OpenGL_Core_Profile
OpenGL: true if the current context has been created with the WGL_CONTEXT_CORE_PROFILE_BIT_ARB or equ...
EVertexAttribInterpretation interpretation() const
How the data is interpreted by the OpenGL, see EVertexAttribInterpretation.
void destroyAllFramebufferObjects()
Removes all FramebufferObjects belonging to an OpenGLContext.
RenderState wrapping the OpenGL function glPixelTransfer(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPixelTransfer.xml for more information.
bool vsyncEnabled() const
If the OpenGL context is a widget this function returns whether vsync is enabled or not...
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.
const BufferObject * bufferObject() const
The TextureImageUnit class associates a Texture object to an OpenGL texture unit. ...
void bindVAS_Attribs(const IVertexAttribSet *vas, bool use_vbo)
virtual void normalize()=0
Normalizes the vectors contained in the buffer.
OpenGLContext(int w=0, int h=0)
Constructor.
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 const ArrayAbstract * secondaryColorArray() const =0
Conventional secondary color array.
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
static void bug(const String &message)
Use this function to provide information about programming errors: wrong parameter initialization...
bool Has_Transform_Feedback
FramebufferObject * createFramebufferObject()
Equivalent to "createFramebufferObject(0,0);".
Wraps the OpenGL function glClipPlane().
void useGLSLProgram(const GLSLProgram *glsl)
Activates the given GLSLProgram or unbinds the current one if glsl is NULL.
virtual const ArrayAbstract * vertexAttribArray(int attrib_location) const =0
Returns a generic vertex attribute's info.
RenderState wrapping the OpenGL function glColorMask(), see also http://www.opengl.org/sdk/docs/man/xhtml/glColorMask.xml for more information.
Data will be sent using glVertexAttribLPointer(), that is, it will be associated with a shader attrib...
virtual void removedListenerEvent(OpenGLContext *)=0
Event generated whenever a listener is unbound from an OpenGLContext context.
VLGRAPHICS_EXPORT bool initializeOpenGL()
To test whether OpenGL has been initialized at least once check vl::Is_OpenGL_Initialized.
virtual const ArrayAbstract * fogCoordArray() const =0
Conventional fog array.
void destroyAllOpenGLResources()
Removes all OpenGL resources handled by the OpenGLContext.
bool isExtensionSupported(const char *ext_name)
Returns true if the given extension is supported.
bool empty() const
Returns true if length() == 0.
virtual void apply(const Camera *camera, OpenGLContext *ctx) const
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.
~OpenGLContext()
Destructor.
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.
virtual void initEvent()=0
Event generated when the bound OpenGLContext bocomes initialized or when the event listener is bound ...
void applyRenderStates(const RenderStateSet *cur, const Camera *camera)
Applies a RenderStateSet to an OpenGLContext - Typically for internal use only.
Data will be sent using glVertexAttribPointer(), that is, data will be converted to floating point pr...
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.
A set of RenderState objects managed by a Shader.
RenderState wrapping the OpenGL function glMaterial() and glColorMaterial(), see also http://www...
void destroyFramebufferObject(FramebufferObject *fbort)
Destroys the specified FramebufferObject.
void bindVAS(const IVertexAttribSet *vas, bool use_vbo, bool force)
Activates the specified vertex attribute set - For internal use only.
bool isCleanState(bool verbose)
Checks whether the OpenGL state is clean or not.
EEnable
Constant that enable/disable a specific OpenGL feature, see also Shader, Shader::enable(), Shader::disable(), Shader::isEnabled()
virtual GLenum glType() const =0
Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFloat3, GL_UNSIGNED_INT for ArrayUInt1 et...
RenderState wrapping the OpenGL function glPointSize(), see also http://www.opengl.org/sdk/docs/man/xhtml/glPointSize.xml for more information.
unsigned int handle() const
const std::string & objectName() const
The name of the object, by default set to the object's class name.
Implements a framebuffer object to be used as a rendering target as specified by the ARB_framebuffer_...
If enabled, use multiple fragment samples in computing the final color of a pixel.
RenderState wrapping the OpenGL function glAlphaFunc(), see also http://www.opengl.org/sdk/docs/man/xhtml/glAlphaFunc.xml for more information.
ERenderState type() const
Wraps the OpenGL function glLight().
bool Has_Fixed_Function_Pipeline
OpenGL: true if !Is_OpenGL_Forward_Compatible && !Is_OpenGL_Core_Profile OpenGL ES 1: always true Ope...
bool Has_Primitive_Restart
OpenGLContext * openglContext()
Returns the OpenGLContext to which this UIEventListener is bound or NULL if no context is bound...
void resetRenderStates()
Resets all the interanal render-states-tables - For internal use only.
virtual void setEnabled(bool enabled)
Enables or disables a UIEventListener.
Represents a virtual camera defining, among other things, the point of view from which scenes can be ...
bool Is_Enable_Supported[EN_EnableCount]
void removeEventListener(UIEventListener *el)
Removes an UIEventListener.
unsigned int handle() const
The handle of the GLSL program as returned by glCreateProgram()
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.
const RenderStateSlot * renderStates() const
bool initGLContext(bool log=true)
Initializes the supported OpenGL extensions.
int shaderCount() const
Returns the number of GLSLShader objects bound to this GLSLProgram.
static bool areUniformsColliding(const UniformSet *u1, const UniformSet *u2)
Returns true if the two UniformSet contain at least one Uniform variable with the same name...
VLCORE_EXPORT GlobalSettings * globalSettings()
Returns VisulizationLibrary's global settings.
RenderState wrapping the OpenGL function glFog(), see also http://www.opengl.org/sdk/docs/man/xhtml/g...
RenderState wrapping the OpenGL function glSecondaryColor(), see also http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml for more information.
virtual const ArrayAbstract * colorArray() const =0
Conventional color array.
A set of enables managed by Shader.
const std::vector< EEnable > & enables() const
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.