if schematic == null do return null;
entity := schematic.create(this);
- entity.schematic = schematic_name;
+ entity.schematic = schematic.name;
return entity;
}
+// #inject runtime.vars.Onyx_Enable_Operator_Methods :: true
use core
use opengles
window = window_create(1200, 900, #cstr "Bar Simulator");
window_use(^window);
- shaders_init();
- fonts_init();
- immediate_init();
+ ogre_init();
editor_init();
game_init();
shader_make :: (shader_path: str) -> Shader {
shader_source := os.get_contents(shader_path);
+ return shader_make_from_source(shader_source);
+}
+
+shader_make_from_source :: (shader_source: str) -> Shader {
vs := compile_shader(shader_source, GL_VERTEX_SHADER);
fs := compile_shader(shader_source, GL_FRAGMENT_SHADER);
location := glGetUniformLocation(shader.prog, uniform);
set_uniform_internal(location, value);
-
+
set_uniform_internal :: #match {
macro (location: GLint, value: u32) do glUniform1i(location, value); ,
macro (location: GLint, value: f32) do glUniform1f(location, value); ,
bottom := cast(f32) height;
far := 10.0f;
near := 0f;
-
+
matrix[0] = 2 / (right - left);
matrix[5] = 2 / (top - bottom);
matrix[10] = -2 / (far - near);
return prog;
}
}
-