标签:
1.OpenGL查询拓展机制是否被支持
gltools函数库: int gltIsExtSupported(const char *extension) { #ifndef OPENGL_ES GLint nNumExtensions; glGetIntegerv(GL_NUM_EXTENSIONS, &nNumExtensions); for(GLint i = 0; i < nNumExtensions; i++) if(strcmp(extension, (const char *)glGetStringi(GL_EXTENSIONS, i)) == 0) return 1; #else GLubyte *extensions = NULL; const GLubyte *start; GLubyte *where, *terminator; where = (GLubyte *) strchr(extension, ‘ ‘); if (where || *extension == ‘\0‘) return 0; extensions = (GLubyte *)glGetString(GL_EXTENSIONS); start = extensions; for (;;) { where = (GLubyte *) strstr((const char *) start, extension); if (!where) break; terminator = where + strlen(extension); if (where == start || *(where - 1) == ‘ ‘) { if (*terminator == ‘ ‘ || *terminator == ‘\0‘) return 1; } start = terminator; } #endif return 0; }
2.基本概念:
1)顶点着色器:处理从客户端输入的数据,应用变换,或者进行其他类型的数学计算来计算光照效果、位移、颜色值等等。
我们得为顶点着色器提供数据,有三种方法:属性,uniform值和纹理。
标签:
原文地址:http://www.cnblogs.com/striver-zhu/p/4533287.html