Exemple #1
0
    def __init__(self,
                 width=640,
                 height=480,
                 title='Frame3D',
                 *,
                 io_async_executor=None,
                 loop=None,
                 fps_limit=0):
        self._loop = loop or asyncio.get_event_loop()
        self._io_async_executor = io_async_executor or AsyncExecutor(
            4, self._loop)

        self._title = title
        self._window = create_window(width, height, title)
        self._width, self._height = width, height
        self._viewport_actual = False

        self._gl_executor = RenderingAsyncExecutor(GLFWContext(self._window),
                                                   self._loop)
        self._executor = AsyncExecutor(1, self._loop)
        self._renderer = SimpleRenderer(self._gl_executor)

        self._initialized = False

        self._camera = Camera(aspect=height / width, course=-180)
        self._fps_limiter = FPSLimiter(fps_limit)
        self._double_clicks = DoubleClickHandler()

        self._on_keyboard_callbacks = {}

        self._last_mouse_xy = None
        self._mouse_buttons_down = set()
        self._keyboard_buttons_down = {}

        self._to_do = []

        self.scene = Scene(show_axis=True)
Exemple #2
0
 def get_gl_executor(self):
     if self.gl_executor is None:
         self.gl_executor = RenderingAsyncExecutor()
     return self.gl_executor