Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- img = Image.open(name)
- img_data =numpy.array(list(img.getdata()), numpy.uint8)
- id = glGenTextures(1)
- glPixelStorei(GL_UNPACK_ALIGNMENT,1)
- glBindTexture(GL_TEXTURE_2D, id)
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP)
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP)
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img.size[0], img.size[1], 0, GL_RGB, GL_UNSIGNED_BYTE, img_data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement