Skip to content

Instantly share code, notes, and snippets.

@XANOZOID
Created August 9, 2020 23:42
Show Gist options
  • Save XANOZOID/b45baff2b0824b8e1567c05c329d8d3b to your computer and use it in GitHub Desktop.
Save XANOZOID/b45baff2b0824b8e1567c05c329d8d3b to your computer and use it in GitHub Desktop.
template do_draw(w:int, color:uint, body:untyped) =
kinc_g4_begin(w)
body
kinc_g4_end(w)
kinc_g4_swap_buffers()
proc nim_update() {.exportc.} =
do_draw 0, 0:
nimPipeline.kinc_g4_set_pipeline()
var matrix:KincMatrix3x3 = kinc_matrix3x3_identity()
kinc_g4_set_vertex_buffer(nVertices)
kinc_g4_set_index_buffer(nIndices)
kinc_g4_set_matrix3(nOffset, matrix)
kinc_g4_set_texture(nTexunit, nimTexture)
kinc_g4_draw_indexed_vertices()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment