def loadImage(self, imageName): im = Image.open(imageName) ix, iy, image = im.size[0], im.size[1], im.tobytes() ID = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, ID) glPixelStorei(GL_UNPACK_ALIGNMENT, 1) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ix, iy, 0,GL_RGBA, GL_UNSIGNED_BYTE, image) return ID
def loadImage(self): if self.skin == 0: im = Image.open("img/Flores1.png") elif self.skin == 1: im = Image.open("img/Flores2.png") elif self.skin == 2: im = Image.open("img/Flores3.png") ix, iy, image = im.size[0], im.size[1], im.tobytes() ID = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, ID) glPixelStorei(GL_UNPACK_ALIGNMENT, 1) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ix, iy, 0, GL_RGBA, GL_UNSIGNED_BYTE, image) return ID