资源描述:
《opengles中几个重要函数详细说明》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、OPENGLES中几个重要函数详细说明时间:2010-04-3014:47点击:2012次函数名:glVertexPointervoidglVertexPointer(GLintsize,GLenumtype,GLsizeistride,constGLvoid*pointer)ParameterssizeSpecifiesthenumberofcoordinatespervertex.Mustbe2,3,or4.Theinitialvalueis4.typeSpecifiesthe函数名:glVertexPointervoidglVertexPointer(GLintsi
2、ze,GLenumtype,GLsizeistride,constGLvoid*pointer)ParameterssizeSpecifiesthenumberofcoordinatespervertex.Mustbe2,3,or4.Theinitialvalueis4.typeSpecifiesthedatatypeofeachvertexcoordinateinthearray.SymbolicconstantsGL_BYTE,GL_SHORT,andGL_FIXED,areaccepted.However,theinitialvalueisGLFLOAT.Theco
3、mmonprofileacceptsthesymbolicconstantGLFLOATaswell.strideSpecifiesthebyteoffsetbetweenconsecutivevertices.Ifstrideis0,theverticesareunderstoodtobetightlypackedinthearray.Theinitialvalueis0.pointerSpecifiesapointertothefirstcoordinateofthefirstvertexinthearray.Theinitialvalueis0.参数:size:指定
4、了每个顶点对应的坐标个数,只能是2,3,4中的一个,默认值是4type:指定了数组中每个顶点坐标的数据类型,可取常量:GL_BYTE,GL_SHORT,GL_FIXED,GL_FLOAT;stride:指定了连续顶点间的字节排列方式,如果为0,数组中的顶点就会被认为是按照紧凑方式排列的,默认值为0pointer:制订了数组中第一个顶点的首地址,默认值为0,对于我们的android,大家可以不用去管什么地址的,一般给一个IntBuffer就可以了。DescriptionglVertexPointerspecifiesthelocationanddataofanarrayof
5、vertexcoordinatestousewhenrendering.sizespecifiesthenumberofcoordinatespervertexandtypethedatatypeofthecoordinates.stridespecifiesthebytestridefromonevertextothenextallowingverticesandattributestobepackedintoasinglearrayorstoredinseparatearrays.(Single-arraystoragemaybemoreefficientonsome
6、implementations.)Whenavertexarrayisspecified,size,type,stride,andpointeraresavedasclient-sidestate.Ifthevertexarrayisenabled,itisusedwhenglDrawArrays,orglDrawElementsiscalled.Toenableanddisablethevertexarray,callglEnableClientStateandglDisableClientStatewiththeargumentGLVERTEXARRAY.Thever
7、texarrayisinitiallydisabledandisn’taccessedwhenglDrawArraysorglDrawElementsiscalled.UseglDrawArraystoconstructasequenceofprimitives(allofthesametype)fromprespecifiedvertexandvertexattributearrays.UseglDrawElementstoconstructasequenceofprimitivesbyindexingverticesand