summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrom <romangraef@gmail.com>2021-04-23 21:13:33 +0200
committerrom <romangraef@gmail.com>2021-04-23 23:59:11 +0200
commit99ab218d9a0964a9de10cf621ff82d4fbaaf50b9 (patch)
tree4beae576eb87e25be20e02c460bf65e61369b6b7
parent48348f90d186fdb16dbbc4429371db8d19eb105c (diff)
downloadtxtgameengine-99ab218d9a0964a9de10cf621ff82d4fbaaf50b9.tar.gz
txtgameengine-99ab218d9a0964a9de10cf621ff82d4fbaaf50b9.tar.bz2
txtgameengine-99ab218d9a0964a9de10cf621ff82d4fbaaf50b9.zip
fix shader locations
-rw-r--r--txtgameengine/__main__.py10
1 files 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