-
Notifications
You must be signed in to change notification settings - Fork 0
/
context.py
34 lines (24 loc) · 1.08 KB
/
context.py
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 shader_handling
class TronContext:
def __init__(self):
self.materials = []
self.textures = []
self.structures = []
self.windows = []
self.cameras = []
self.objects = []
self.lights = []
self.num_active_lights = 0
self.shader_texture = shader_handling.TronShader()
self.shader_common = shader_handling.TronShader()
self.current_window = None
self.current_camera = None
self.path_to_res_folder = ""
def activate(self):
self.load_shaders()
def load_shaders(self):
self.shader_texture.compile_shader(self.path_to_res_folder + "res/shaders/textured_object_vertex_shader.glsl",
self.path_to_res_folder + "res/shaders/textured_object_fragment_shader.glsl")
self.shader_common.compile_shader(self.path_to_res_folder + "res/shaders/common_object_vertex_shader.glsl",
self.path_to_res_folder + "res/shaders/common_object_fragment_shader.glsl")
main_context = TronContext()