Skip to content

Commit

Permalink
Merge pull request #71 from odin-lang/better-structure
Browse files Browse the repository at this point in the history
Better structure and new README
  • Loading branch information
karl-zylinski authored Jan 13, 2025
2 parents 745fa3d + 51bf1b9 commit d135d81
Show file tree
Hide file tree
Showing 27 changed files with 47 additions and 70 deletions.
48 changes: 26 additions & 22 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,21 @@ jobs:
run: |
FLAGS="-vet -strict-style -vet-tabs -disallow-do -warnings-as-errors"
odin check by_example/dir_info $FLAGS
odin check by_example/dynamic_arrays $FLAGS
odin check by_example/hellope $FLAGS
odin check by_example/os_args $FLAGS
odin check by_example/raw_console $FLAGS
odin check by_example/raw_console -target:windows_amd64 $FLAGS
odin check by_example/read_console_input $FLAGS
odin check by_example/strings $FLAGS
odin check basics/dir_info $FLAGS
odin check basics/dynamic_arrays $FLAGS
odin check basics/hellope $FLAGS
odin check basics/os_args $FLAGS
odin check basics/raw_console $FLAGS
odin check basics/raw_console -target:windows_amd64 $FLAGS
odin check basics/read_console_input $FLAGS
odin check basics/strings $FLAGS
odin check glfw/window $FLAGS
odin check json/load_json $FLAGS
odin check json/load_json_unmarshal $FLAGS
odin check json/odin_info $FLAGS
odin check learn_metal/00-window $FLAGS
odin check learn_metal/01-primitive $FLAGS
odin check learn_metal/02-argbuffers $FLAGS
odin check learn_metal/02-argbuffers-no-sdl $FLAGS
odin check learn_metal/03-animation $FLAGS
odin check learn_metal/04-instancing $FLAGS
odin check learn_metal/05-perspective $FLAGS
odin check learn_metal/06-lighting $FLAGS
odin check learn_metal/07-texturing $FLAGS
odin check learn_metal/08-compute $FLAGS
odin check learn_metal/09-compute-to-render $FLAGS
odin check math/noise/draw_texture $FLAGS
Expand All @@ -74,12 +63,27 @@ jobs:
odin check raylib/ports/textures/textures_gif_player.odin -file $FLAGS
odin check raylib/tetroid $FLAGS
odin check directx/d3d11_minimal_sdl2 -target:windows_amd64 $FLAGS
odin check opengl/minimal_sdl2 $FLAGS
odin check metal/minimal_sdl2 $FLAGS
odin check metal/learn_metal/00-window $FLAGS
odin check metal/learn_metal/01-primitive $FLAGS
odin check metal/learn_metal/02-argbuffers $FLAGS
odin check metal/learn_metal/02-argbuffers-no-sdl $FLAGS
odin check metal/learn_metal/03-animation $FLAGS
odin check metal/learn_metal/04-instancing $FLAGS
odin check metal/learn_metal/05-perspective $FLAGS
odin check metal/learn_metal/06-lighting $FLAGS
odin check metal/learn_metal/07-texturing $FLAGS
odin check metal/learn_metal/08-compute $FLAGS
odin check metal/learn_metal/09-compute-to-render $FLAGS
odin check sdl2/chase_in_space $FLAGS
odin check sdl2/d3d11 -target:windows_amd64 $FLAGS
odin check sdl2/hellope $FLAGS
odin check sdl2/metal $FLAGS
odin check sdl2/microui $FLAGS
odin check sdl2/opengl $FLAGS
odin check wgpu/microui -target:windows_amd64 $FLAGS
Expand Down
69 changes: 21 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,32 @@
# Odin Examples

This repository contains examples of how certain things can be accomplished in idiomatic [Odin](https://github.com/odin-lang/Odin), allowing you learn its semantics, as well as how to use parts of the `core` and `vendor` package collections.
Learn [Odin](https://github.com/odin-lang/Odin) through idiomatic examples that show you how to:
- Use the language
- Use `core` libraries
- Use `vendor` libraries

The code examples are published in the hope they are found useful, and are in the [Public Domain](https://unlicense.org) or under [Odin's BSD-3 license](https://github.com/odin-lang/Odin/blob/master/LICENSE), per your choice.
The examples are meant to be well written while following Odin best practices.

Assets and third-party libraries are provided under their own license. If in doubt, check the `LICENSE*` and `COPYING*` file(s) in a particular directory for clarification.

## By Example

1) [Hellope](https://github.com/odin-lang/examples/tree/master/by_example/hellope)
2) [Strings](https://github.com/odin-lang/examples/blob/master/by_example/strings/basic_string_example.odin)
3) [Dynamic Arrays](https://github.com/odin-lang/examples/blob/master/by_example/dynamic_arrays/dynamic_arrays.odin)
4) [Command Line Arguments](https://github.com/odin-lang/examples/tree/master/by_example/os_args)
5) [Read Console Input](https://github.com/odin-lang/examples/tree/master/by_example/read_console_input)
6) [Directory Info](https://github.com/odin-lang/examples/tree/master/by_example/dir_info)

## Formats

* [JSON](https://github.com/odin-lang/examples/tree/master/json/load_json)
## Running the examples

## Graphics
Clone this repository. Most examples can be run by navigating into the folder and executing: `odin run .`

* [D3D11 with SDL](https://github.com/odin-lang/examples/blob/master/sdl2/d3d11)
* [Metal with SDL](https://github.com/odin-lang/examples/tree/master/sdl2/metal)
* [OpenGL with SDL](https://github.com/odin-lang/examples/tree/master/sdl2/opengl)
* [GLFW (Simple Window)](https://github.com/odin-lang/examples/tree/master/glfw/window)
* [SDL with PNG loader using `core:image`](https://github.com/odin-lang/examples/tree/master/sdl2/hellope)
* [MicroUI with SDL](https://github.com/odin-lang/examples/tree/master/sdl2/microui)
* [MicroUI with Raylib](https://github.com/odin-lang/examples/tree/master/raylib/microui)
* [Nanovg Examples](https://github.com/odin-lang/examples/tree/master/nanovg)
Some examples have a `README` with additional information and instructions.

## Math
## License
The contents of this repository is available under two licenses. Choose the one that you prefer:

* [Simplex Noise Generation](https://github.com/odin-lang/examples/tree/master/math/noise/draw_texture)
- [Public Domain](https://unlicense.org)
or
- [Odin's BSD-3 license](https://github.com/odin-lang/Odin/blob/master/LICENSE)

## Games

* [Tetroid (Tetris-like Game) with Raylib](https://github.com/odin-lang/examples/tree/master/raylib/tetroid)
* [Chase in Space with SDL2](https://github.com/odin-lang/examples/tree/master/sdl2/chase_in_space)

## Learn Metal

* [00-window](https://github.com/odin-lang/examples/tree/master/learn_metal/00-window)
* [01-primitive](https://github.com/odin-lang/examples/tree/master/learn_metal/01-primitive)
* [02-argbuffers](https://github.com/odin-lang/examples/tree/master/learn_metal/02-argbuffers)
* [03-animation](https://github.com/odin-lang/examples/tree/master/learn_metal/03-animation)
* [04-instancing](https://github.com/odin-lang/examples/tree/master/learn_metal/04-instancing)
* [05-perspective](https://github.com/odin-lang/examples/tree/master/learn_metal/05-perspective)
* [06-lighting](https://github.com/odin-lang/examples/tree/master/learn_metal/06-lighting)
* [07-texturing](https://github.com/odin-lang/examples/tree/master/learn_metal/07-texturing)
* [08-compute](https://github.com/odin-lang/examples/tree/master/learn_metal/08-compute)
* [09-compute-to-render](https://github.com/odin-lang/examples/tree/master/learn_metal/09-compute-to-render)
Assets and third-party libraries are provided under their own license. If in doubt, check the `LICENSE*` and `COPYING*` file(s) in a particular directory for clarification.

## Orca
## Contributions
Contributions via Pull Requests are warmly welcome. Before submitting your Pull Request, make sure of the following:

* [breakout](https://github.com/odin-lang/examples/tree/master/orca/breakout)
* [clock](https://github.com/odin-lang/examples/tree/master/orca/clock)
* [ui](https://github.com/odin-lang/examples/tree/master/orca/ui)
- The example compiles with flags `-vet -strict-style -vet-tabs -disallow-do -warnings-as-errors`
- Add the example to `.github/workflows/check.yml`
- The example follows Odin best practices. Look at code in `core` for inspiration on how to write idiomatic Odin.
- Your code follows the Odin naming convention: https://github.com/odin-lang/Odin/wiki/Naming-Convention (exception can be made for direct ports of examples that need to match 1:1 to the source of the port).
- Note that your code will fall under the licenses listed above. Only for third-party dependencies are other licenses allowed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added directx/d3d11_minimal_sdl2/SDL2.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d135d81

Please sign in to comment.