summaryrefslogtreecommitdiff
path: root/txtgameengine/__main__.py
blob: bed29724210768bf9b1638382987ca2075062f0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import glfw
from glfw.GLFW import *

from .app import TxtGameApp


def main():
    glfw.init()
    glfw.window_hint(GLFW_CLIENT_API, GLFW_NO_API)
    window = glfw.create_window(640, 480, "Vulkan window", None, None)
    if not window:
        glfw.terminate()
        return
    glfw.swap_interval(1)
    while not glfw.window_should_close(window):
        glfw.swap_buffers(window)
        glfw.poll_events()
    glfw.destroy_window(window)
    glfw.terminate()


class TestApp(TxtGameApp):
    def __init__(self):
        super().__init__((640, 480), "Vulkan window")
        self.requested_validation_layers += ["VK_LAYER_KHRONOS_validation"]

    def update(self, delta: float):
        super().update(delta)


if __name__ == '__main__':
    # main()
    a = TestApp()
    a.start()