set up best config WIP
This commit is contained in:
parent
3a643d9864
commit
ea57844c33
2 changed files with 29 additions and 5 deletions
|
@ -8,6 +8,25 @@ def get_config() -> dict:
|
||||||
return config.init
|
return config.init
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_best_config(self):
|
||||||
|
configs = None
|
||||||
|
try_configs = [pyggl.Config(double_buffer=True, depth_size=24, major_version=3, minor_version=3),
|
||||||
|
gl.Config(double_buffer=True, depth_size=16, major_version=3, minor_version=3),
|
||||||
|
None]
|
||||||
|
for tryc in try_configs:
|
||||||
|
try:
|
||||||
|
configs = (tryc)
|
||||||
|
break
|
||||||
|
except window.NoSuchConfigException:
|
||||||
|
pass
|
||||||
|
if not configs:
|
||||||
|
raise window.NoSuchConfigException()
|
||||||
|
return configs[0]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def init_window() -> None:
|
def init_window() -> None:
|
||||||
global window
|
global window
|
||||||
|
|
||||||
|
@ -25,6 +44,9 @@ def init_window() -> None:
|
||||||
# an available resolution
|
# an available resolution
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
display = pyglet.canvas.get_display()
|
||||||
|
screens = display.get_screens()
|
||||||
window = pyglet.window.Window()
|
windows = []
|
||||||
|
for screen in screens:
|
||||||
|
windows.append(window.Window(fullscreen=True, screen=screen))
|
||||||
|
window = pyglet.window.Window())
|
|
@ -2,7 +2,9 @@ import pyglet
|
||||||
import engine
|
import engine
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
unittest.main()
|
unittest.main(exit=False)
|
||||||
|
|
||||||
|
print("Hello!!!")
|
||||||
|
|
||||||
engine.screen.init_window()
|
engine.screen.init_window()
|
||||||
|
|
||||||
|
@ -12,7 +14,7 @@ label = pyglet.text.Label('Hello, world',
|
||||||
x=window.width//2, y=window.height//2,
|
x=window.width//2, y=window.height//2,
|
||||||
anchor_x='center', anchor_y='center')
|
anchor_x='center', anchor_y='center')
|
||||||
|
|
||||||
@window.event
|
@pyglet.window.event
|
||||||
def on_draw():
|
def on_draw():
|
||||||
engine.screen.window.clear()
|
engine.screen.window.clear()
|
||||||
label.draw()
|
label.draw()
|
||||||
|
|
Loading…
Add table
Reference in a new issue