def draw(self): #print(str(self.pos)) if self.crouching: glCommands.changeUniform(self.pos, self.crouchScale) else: glCommands.changeUniform(self.pos) #super().draw(Player.tex) glCommands.drawElement(glCommands.GL_TRIANGLES, len(Player.ibuff), Player.vao, Player.tex, 0, 0)
def draw(self, position, scale, texture, slice): glCommands.changeUniform(position, scale) #setPosition and Scale glCommands.drawElement( glCommands.GL_TRIANGLES, #Mode Entity.ibuffSize, #number of indicies Entity.vao, #vao texture, #texture passed Entity.ibuffStart, #start in indicies slice) #slice of image
def draw(self): if self.alive(): oldprog = ParticleSystem.prog.current ParticleSystem.prog.use() alpha = 1 - (self.currentTime / self.life) Program.setUniform("totalElapsed", self.currentTime) Program.setUniform("pointSize", globs.particleSize) Program.setUniform("worldMatrix", self.worldMatrix) Program.setUniform("speedDivisor", globs.speedDivisor) Program.setUniform("alpha", alpha) Program.updateUniforms() glEnable(GL_BLEND) glCommands.drawElement(glCommands.GL_POINTS, ParticleSystem.vSize, ParticleSystem.vao, ParticleSystem.tex) glDisable(GL_BLEND) if oldprog != None: oldprog.use()
def draw(self, position, scale, texture, slice): if self.alive(): alpha = 1 - (self.fadeTime / self.deathFadeT) Entity.prog.use() Program.setUniform("alpha", alpha) Program.updateUniforms() glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glCommands.changeUniform(position, scale) #setPosition and Scale glCommands.drawElement( glCommands.GL_TRIANGLES, #Mode Entity.ibuffSize, #number of indicies Entity.vao, #vao texture, #texture passed Entity.ibuffStart, #start in indicies slice) #slice of image glDisable(GL_BLEND)
def draw(self, texture, slice=0, drawPoint=False): if self.alive(): self.setProgUniforms() glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) if not drawPoint: if not self.centered: glCommands.drawElement( glCommands.GL_TRIANGLES, # Mode Entity.ibuffSize, # number of indicies Entity.vao, # vao texture, # texture passed Entity.ibuffStart, # start in indicies slice) # slice of image else: glCommands.drawElement( glCommands.GL_TRIANGLES, # Mode Entity.ibuffCenterSize, # number of indicies Entity.centerVao, # vao texture, # texture passed Entity.ibuffStart, # start in indicies slice) # slice of image else: glCommands.drawElement(glCommands.GL_POINT, 1, Entity.centerVao, None) glDisable(GL_BLEND)
def draw(self): StarBackground.prog.use() glCommands.changeUniform(self.pos) glCommands.drawElement(glCommands.GL_POINTS, len(StarBackground.vbuff), StarBackground.vao, StarBackground.tex)
def draw(self): glCommands.changeUniform(self.pos) glCommands.drawElement(glCommands.GL_TRIANGLES, len(Bullet.ibuff), Bullet.vao, self.tex, 0, 0)
def draw(self, texture): glCommands.drawElement(glCommands.GL_TRIANGLES, Entity.ibuffSize, Entity.vao, texture, 0, 0)