1. Toni Ruža
  2. glutton

Commits

Toni Ruža  committed e5d6fb9

Option to ignore alpha when initializing textures.

  • Participants
  • Parent commits 2aff930
  • Branches default

Comments (0)

Files changed (1)

File glutton/utils.py

View file
 
 
 class Texture2D:
-    def __init__(self, bitmap, linear=True):
+    def __init__(self, bitmap, linear=True, ignore_alpha=False):
         self.width = bitmap.Width
         self.height = bitmap.Height
 
         self.name = glGenTextures(1)
         self.bind()
 
-        if bitmap.HasAlpha():
+        if bitmap.HasAlpha() and not ignore_alpha:
             kind = GL_RGBA
             data = array.array('B', [0] * self.width * self.height * 4)
             bitmap.CopyToBuffer(data, wx.BitmapBufferFormat_RGBA)