Пример #1
0
    def showWindow(self):
        GLFW.glfwMakeContextCurrent(self.__window)
        self.__initialize()

        while not GLFW.glfwWindowShouldClose(self.__window):
            self.__loop(self)

        GLFW.glfwTerminate()
Пример #2
0
    def __init__(self):
        if not GLFW.glfwInit():
            raise EnvironmentError("Could not initialize the library.")

        GLFW.glfwWindowHint(GLFW.GLFW_SAMPLES, 8)
        self.__window = GLFW.glfwCreateWindow(self.width, self.height, "Path",
                                              None, None)

        if not self.__window:
            GLFW.glfwTerminate()
            raise RuntimeError("Could create a window.")
Пример #3
0
    def close(self):
        if not self._window:
            return

        glfw.glfwRestoreWindow(self._window)

        del self.gui[:]
        self.gui.terminate()
        glfw.glfwDestroyWindow(self._window)
        glfw.glfwTerminate()

        del self.gui
        self._window = None