summaryrefslogtreecommitdiff
path: root/main.py
blob: c33a1201d64e164d4bf2aee078e815c4e4a9f333 (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
35
import glfw
from vulkan import *
from glfw.GLFW import *

from txtgameengine.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
    extensions = vkEnumerateInstanceExtensionProperties(None)
    print([e.name for e in extensions])
    while not glfw.window_should_close(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):
        pass


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