mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 21:21:59 -04:00
Use anisotropic filtering, if possible.
This commit is contained in:
parent
1524a6f27e
commit
338b7fb66c
|
@ -111,12 +111,16 @@ def image_info(data):
|
|||
return content_type, width, height
|
||||
|
||||
|
||||
def max_texture_size():
|
||||
def glGetInteger(index):
|
||||
buf = c_int()
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, byref(buf))
|
||||
glGetIntegerv(index, byref(buf))
|
||||
return buf.value
|
||||
|
||||
|
||||
def max_texture_size():
|
||||
return glGetInteger(GL_MAX_TEXTURE_SIZE)
|
||||
|
||||
|
||||
def check_size(width, height):
|
||||
max_texture = max_texture_size()
|
||||
|
||||
|
@ -206,6 +210,9 @@ def load_texture(file, clamp=False):
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
|
||||
|
||||
if gl_info.have_extension('GL_EXT_texture_filter_anisotropic'):
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, glGetInteger(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT))
|
||||
|
||||
cache[path] = id
|
||||
return id
|
||||
|
||||
|
|
Loading…
Reference in a new issue