本文整理汇总了Python中opengltk.OpenGL.GL.glDisableClientState方法的典型用法代码示例。如果您正苦于以下问题:Python GL.glDisableClientState方法的具体用法?Python GL.glDisableClientState怎么用?Python GL.glDisableClientState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opengltk.OpenGL.GL
的用法示例。
在下文中一共展示了GL.glDisableClientState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: drawVertexArray
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glDisableClientState [as 别名]
#.........这里部分代码省略.........
if DejaVu.enableVBO is True:
from opengltk.extent import _glextlib
# vertices
_glextlib.glBindBufferARB(_glextlib.GL_ARRAY_BUFFER_ARB,
int(self.vertexArrayFlagBufferList[0]))
_gllib.glVertexPointer(len(self.vertexSet.vertices.array[0]),
GL.GL_FLOAT, 0, 0)
# normals
if len(self.vertexSet.normals.array) > 0:
_glextlib.glBindBufferARB(_glextlib.GL_ARRAY_BUFFER_ARB,
int(self.vertexArrayFlagBufferList[1]))
_gllib.glNormalPointer(GL.GL_FLOAT, 0, 0)
# colors
if hasattr(self, 'colorPointerIsOn') and self.colorPointerIsOn is True:
_glextlib.glBindBufferARB(_glextlib.GL_ARRAY_BUFFER_ARB,
int(self.vertexArrayFlagBufferList[3]))
_gllib.glColorPointer(4, GL.GL_FLOAT, 0, 0)
else:
# vertices
_gllib.glVertexPointer(len(self.vertexSet.vertices.array[0]),
GL.GL_FLOAT, 0, self.vertexSet.vertices.array)
# normals
if len(self.vertexSet.normals.array) > 0:
_gllib.glNormalPointer(GL.GL_FLOAT, 0, self.vertexSet.normals.array)
# colors
if hasattr(self, 'colorPointerIsOn') and self.colorPointerIsOn is True:
_gllib.glColorPointer(4, GL.GL_FLOAT, 0, self.colorArray)
# Draw faces
if self.primitiveType == GL.GL_LINE_STRIP:
lPrimitiveType = GL.GL_LINES
elif self.primitiveType == GL.GL_TRIANGLES:
#print "triangles' length:", len(self.faceSet.faces.array[0])
lPrimitiveType = GL.GL_TRIANGLES
elif self.primitiveType == GL.GL_QUADS:
#print "quads' length:", len(self.faceSet.faces.array[0])
lPrimitiveType = GL.GL_QUADS
else:
#print "what's that ?" , self.primitiveType
lPrimitiveType = self.primitiveType
lNumOfNonHighlightedIndices = len(self.faceSet.faces.array) - self.numOfHighlightedIndex
if DejaVu.enableVBO is True:
_glextlib.glBindBufferARB(_glextlib.GL_ELEMENT_ARRAY_BUFFER,
int(self.vertexArrayFlagBufferList[2])) #this protect from unexplained segfault
if self.disableStencil is False and self.numOfHighlightedIndex > 0:
# highlighted
GL.glStencilFunc(GL.GL_ALWAYS, 1, 1)
_gllib.glDrawElements(lPrimitiveType,
self.numOfHighlightedIndex*len(self.faceSet.faces.array[0]),
GL.GL_UNSIGNED_INT,
0
)
GL.glStencilFunc(GL.GL_ALWAYS, 0, 1)
# non highlighted
_gllib.glDrawElements(lPrimitiveType,
lNumOfNonHighlightedIndices * len(self.faceSet.faces.array[0]),
GL.GL_UNSIGNED_INT,
self.numOfHighlightedIndex * len(self.faceSet.faces.array[0]) * 4
)
else:
_gllib.glDrawElements(lPrimitiveType,
len(self.faceSet.faces.array)*len(self.faceSet.faces.array[0]),
GL.GL_UNSIGNED_INT,
0
)
_glextlib.glBindBufferARB(_glextlib.GL_ELEMENT_ARRAY_BUFFER, 0 ) #this protect from unexplained segfault
else:
if self.disableStencil is False and self.numOfHighlightedIndex > 0:
# highlighted
GL.glStencilFunc(GL.GL_ALWAYS, 1, 1)
_gllib.glDrawElements(lPrimitiveType,
self.numOfHighlightedIndex*len(self.faceSet.faces.array[0]),
GL.GL_UNSIGNED_INT,
self.faceSet.faces.array
)
GL.glStencilFunc(GL.GL_ALWAYS, 0, 1)
# non highlighted
_gllib.glDrawElements(lPrimitiveType,
lNumOfNonHighlightedIndices * len(self.faceSet.faces.array[0]),
GL.GL_UNSIGNED_INT,
self.faceSet.faces.array[self.numOfHighlightedIndex: ]
)
else:
_gllib.glDrawElements(lPrimitiveType,
len(self.faceSet.faces.array)*len(self.faceSet.faces.array[0]),
GL.GL_UNSIGNED_INT,
self.faceSet.faces.array
)
if hasattr(self, 'colorPointerIsOn') and self.colorPointerIsOn is True:
GL.glDisable( GL.GL_COLOR_MATERIAL )
GL.glDisableClientState(GL.GL_COLOR_ARRAY)
if len(self.vertexSet.normals.array) > 0:
GL.glDisableClientState(GL.GL_NORMAL_ARRAY)
GL.glDisableClientState(GL.GL_VERTEX_ARRAY)
return 1