From 99ab218d9a0964a9de10cf621ff82d4fbaaf50b9 Mon Sep 17 00:00:00 2001 From: rom Date: Fri, 23 Apr 2021 21:13:33 +0200 Subject: fix shader locations --- txtgameengine/__main__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/txtgameengine/__main__.py b/txtgameengine/__main__.py index cc4c11c..38e9815 100644 --- a/txtgameengine/__main__.py +++ b/txtgameengine/__main__.py @@ -2,18 +2,21 @@ import numpy as np from .scenes import SceneTxtGameApp, Scene from OpenGL.GL import * +from pathlib import Path + +shader_path = Path(__file__).parent / 'base_shaders' class TriangleScene(Scene): TRIANGLE_DATA = [ -1.0, -1.0, 0.0, 1.0, -1.0, 0.0, - 0.0, 1.0, 0.0, + 0.0, 1.0, 0.0, ] def on_enter(self): self.default_shaders = self.app.shaders.load_shaders( - 'base_shaders/vertex.glsl', 'base_shaders/fragment.glsl') + str(shader_path / 'vertex.glsl'), str(shader_path / 'fragment.glsl')) self.tri_buffer = self.app.render.setup_triangle( np.array(self.TRIANGLE_DATA, np.float32)) @@ -32,9 +35,10 @@ class EvilTriangleScene(TriangleScene): TRIANGLE_DATA = [ -1.0, 1.0, 0.0, 1.0, 1.0, 0.0, - 0.0, -1.0, 0.0, + 0.0, -1.0, 0.0, ] + class TestApp(SceneTxtGameApp): MAIN_SCENE_T = TriangleScene -- cgit