mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 21:21:59 -04:00
Show better renderer information.
This commit is contained in:
parent
63d42bca55
commit
f9d83a2add
|
@ -38,7 +38,7 @@ def main():
|
|||
if hasattr(config, '_attribute_names'):
|
||||
print('OpenGL configuration:')
|
||||
for key in config._attribute_names:
|
||||
print(' %-17s %s' % (key + ':', getattr(config, key)))
|
||||
print(' %-22s %s' % (key + ':', getattr(config, key)))
|
||||
|
||||
world_options = {
|
||||
'normal': args.normal,
|
||||
|
|
|
@ -51,28 +51,34 @@ class Applet(pyglet.window.Window):
|
|||
texture.init()
|
||||
|
||||
if hasattr(self.config, '_attribute_names'):
|
||||
info = [' %-22s %s' % (key + ':', getattr(self.config, key))
|
||||
for key in self.config._attribute_names]
|
||||
info = [' %-22s %s' % (key + ':', value)
|
||||
for key, value in self.config.get_gl_attributes()]
|
||||
info = ['%-30s %-30s' % group for group in
|
||||
zip_longest(info[::2], info[1::2], fillvalue='')]
|
||||
info = 'OpenGL configuration:\n' + '\n'.join(info)
|
||||
else:
|
||||
info = 'Unknown OpenGL configuration'
|
||||
|
||||
info = '\n'.join([
|
||||
'Graphics Vendor: ' + gl_info.get_vendor(),
|
||||
'Graphics Version: ' + gl_info.get_version(),
|
||||
'Graphics Renderer: ' + gl_info.get_renderer(),
|
||||
]) + '\n\n' + info
|
||||
|
||||
self.loaded = False
|
||||
self.__load_started = False
|
||||
self._loading_phase = pyglet.text.Label(
|
||||
font_name='Consolas', font_size=20, x=10, y=self.height - 80,
|
||||
font_name='Consolas', font_size=20, x=10, y=self.height - 50,
|
||||
color=(255, 255, 255, 255), width=self.width - 20, align='center',
|
||||
multiline=True, text='Punyverse is starting...'
|
||||
)
|
||||
self._loading_label = pyglet.text.Label(
|
||||
font_name='Consolas', font_size=16, x=10, y=self.height - 150,
|
||||
font_name='Consolas', font_size=16, x=10, y=self.height - 120,
|
||||
color=(255, 255, 255, 255), width=self.width - 20, align='center',
|
||||
multiline=True
|
||||
)
|
||||
self._info_label = pyglet.text.Label(
|
||||
font_name='Consolas', font_size=13, x=10, y=self.height - 250,
|
||||
font_name='Consolas', font_size=13, x=10, y=self.height - 220,
|
||||
color=(255, 255, 255, 255), width=self.width - 20,
|
||||
multiline=True, text=info
|
||||
)
|
||||
|
@ -376,7 +382,7 @@ class Applet(pyglet.window.Window):
|
|||
self._loading_phase.draw()
|
||||
self._loading_label.draw()
|
||||
if progress is not None:
|
||||
progress_bar(10, self.height - 170, self.width - 20, 50, progress)
|
||||
progress_bar(10, self.height - 140, self.width - 20, 50, progress)
|
||||
self._info_label.draw()
|
||||
|
||||
def on_draw(self, glMatrixBuffer=GLfloat * 16):
|
||||
|
|
|
@ -74,12 +74,7 @@ def init():
|
|||
buf = c_int()
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, byref(buf))
|
||||
max_texture = buf.value
|
||||
badcard = gl_info.get_renderer() in ('GDI Generic',)
|
||||
if badcard:
|
||||
import warnings
|
||||
warnings.warn('Please update your graphics drivers if possible')
|
||||
|
||||
# bgra = gl_info.have_extension('GL_EXT_bgra')
|
||||
bgra = gl_info.have_extension('GL_EXT_bgra')
|
||||
|
||||
if power_of_two is None:
|
||||
power_of_two = gl_info.have_version(2) or gl_info.have_extension('GL_ARB_texture_non_power_of_two')
|
||||
|
@ -229,11 +224,6 @@ def load_texture(file):
|
|||
|
||||
glBindTexture(GL_TEXTURE_2D, id)
|
||||
|
||||
if badcard:
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, mode, width, height, 0, mode, GL_UNSIGNED_BYTE, texture)
|
||||
else:
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR)
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, depth, width, height, mode, GL_UNSIGNED_BYTE, texture)
|
||||
|
|
Loading…
Reference in a new issue