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): glBindVertexArray(self.vao) tileHeight = len(self.tileList) for i in range(tileHeight): tmpI = tileHeight - i - 1 row = self.tileList[tmpI] tileWidth = len(row) yVal = self.pos.y + (i * (2 / tileHeight)) for j in range(tileWidth): xVal = self.pos.x + (j * (2 / tileWidth)) glCommands.changeUniform(math3d.vec2(xVal, yVal)) self.texList[row[j] - 1].bind(0) glDrawElements(GL_TRIANGLES, len(self.ibuff), GL_UNSIGNED_INT, 0)
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): 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)