+*.sublime-project
*.sublime-workspace
*.wasm
#!/bin/sh
-onyx -r js -V --use-post-mvp-features test/basic.onyx -o imgui.wasm
\ No newline at end of file
+onyx -r js -V --use-post-mvp-features test/basic.onyx -o imgui.wasm
vertex_shader, _ := compile_shader(vertex_source, gl.VERTEX_SHADER);
fragment_shader, _ := compile_shader(fragment_source, gl.FRAGMENT_SHADER);
- // @Robustness: Errors in linkning the program are ignored right now.
+ // @Robustness: Errors in linking the program are ignored right now.
shader_program, _ := link_program(vertex_shader, fragment_shader);
program = shader_program;
package imgui
+#load "lib/gl/gl_utils"
#load "lib/immediate_renderer"
+
verticies = memory.make_slice(Immediate_Vertex, max_verticies);
}
+ // As a small note, I love the pattern matching style of programming that
+ // can be done in situtations like this. Now, this isn't the most efficient
+ // because it is mostly just marshalling the arguments around, but the
+ // pattern matching at compile-time is very cool, I think at least.
push_vertex :: proc {
// If a color is not provided, the previous color is used.
(use ir: ^Immediate_Renderer, position: Vector2) {
vertex_ptr.position = position;
vertex_ptr.color = color;
+ vertex_ptr.texture = Vector2.{ 0, 0 };
},
}
+
+// While the immediate renderer can be used on its own, below is a set of wrapping functions
+// that operate on a global immediate renderer. This is probably the most common way that
+// it will be used.
+
#private
immediate_renderer : Immediate_Renderer;
"path": "."
},
{
- "path": "C:\\dev\\onyx\\core"
+ "path": "/home/brendan/dev/c/onyx/core"
}
]
}
}
draw :: () {
+ use imgui;
+
+ immediate_vertex(.{ 0, 0 }, color=.{ 1, 0, 0, 1 });
+ immediate_vertex(.{ 1, 0 });
+ immediate_vertex(.{ 0, 1 });
}
loop :: () {
poll_events();
- //update();
- //draw();
+ update();
+ draw();
}
main :: (args: [] cstr) {