The programs below illustrate OpenGL functions in Odin using the wrappers in "vendor:OpenGL"
. The programs start very basic and get progressively more complicated.
The glfw library wrappers for Odin in "vendor:glfw"
are also illustrated.
Building the examples is trivial; the standard Odin distribution is the ONLY dependency.
Simply call odin run DIRECTORY -o:speed
where DIRECTORY is the name of one of the project's directories to build and run an example. (E.g. odin run Rainbow-Triangle -o:speed
.)
A window which oscillates between pink and blue.
An RGB triangle which rotates over time.
A cube with different faces which rotates over time.
An image of the Earth changes color over time.
A character moves in a counter-clockwise circle over time.
The characters of a sentence move in the form of a sine wave over time.
Triangles which together form an animal are revealed when the mouse cursor passes over them.