本文整理匯總了Python中texture.Texture.unbind方法的典型用法代碼示例。如果您正苦於以下問題:Python Texture.unbind方法的具體用法?Python Texture.unbind怎麽用?Python Texture.unbind使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類texture.Texture
的用法示例。
在下文中一共展示了Texture.unbind方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: PointCloud
# 需要導入模塊: from texture import Texture [as 別名]
# 或者: from texture.Texture import unbind [as 別名]
class PointCloud(GLArray):
def __init__(self, vertex_data=None, color_data=None):
GLArray.__init__(self, vertex_data, color_data)
self._sprite_texture = None
def sprite(self, filename):
print " -- initializing point sprite {}".format(filename)
self._sprite_texture = Texture(filename)
def _pre_draw(self):
GLArray._pre_draw(self)
if self._sprite_texture == None:
return
glDepthMask(GL_FALSE)
glEnable(GL_POINT_SMOOTH)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE)
self._sprite_texture.bind()
glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE)
glEnable(GL_POINT_SPRITE)
glPointSize(15.0)
def _post_draw(self):
GLArray._post_draw(self)
if self._sprite_texture == None:
return
self._sprite_texture.unbind()
glDisable(GL_BLEND)
glDisable(GL_POINT_SPRITE)
def center(self):
try:
return self._center
except:
self._center = [0.0, 0.0, 0.0]
for i in range(3):
self._center[i] = sum(v[i] for v in self._vertex_data) / len(self._vertex_data)
return self._center