Skip to content

Commit

Permalink
Merge branch 'floooh:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
thePHTest authored Aug 16, 2024
2 parents 0a81ae9 + fd0e6dc commit b420465
Show file tree
Hide file tree
Showing 79 changed files with 7,119 additions and 4,817 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,52 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
# NOTE: odin macos and ubuntu releases are zipped twice, so this is bit of a hack.
# The examples folder also conflicts with the sokol examples, so we just remove it.
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- if: runner.os == 'Linux'
name: prepare-linux
run: |
sudo apt-get update
sudo apt-get install libglu1-mesa-dev mesa-common-dev xorg-dev libasound-dev llvm-11
curl -L https://github.com/odin-lang/Odin/releases/download/dev-2023-07/odin-ubuntu-amd64-dev-2023-07.zip --output odin.zip
sudo apt-get install libglu1-mesa-dev mesa-common-dev xorg-dev libasound-dev
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
echo "/usr/lib/llvm-17/bin" >> $GITHUB_PATH
curl -L https://github.com/odin-lang/Odin/releases/download/dev-2024-04/odin-ubuntu-amd64-dev-2024-04.zip --output odin.zip
unzip odin.zip
unzip dist.zip
rm -r ./dist/examples
mv ./dist/* ./
chmod a+x ./odin
cd sokol
chmod a+x ./build_clibs_linux.sh
./build_clibs_linux.sh
cd ..
- if: runner.os == 'macOS'
name: prepare-macos
run: |
brew install llvm@11
curl -L https://github.com/odin-lang/Odin/releases/download/dev-2023-07/odin-macos-amd64-dev-2023-07.zip --output odin.zip
brew install llvm@17
curl -L https://github.com/odin-lang/Odin/releases/download/dev-2024-04/odin-macos-amd64-dev-2024-04.zip --output odin.zip
unzip odin.zip
unzip dist.zip
rm -r ./dist/examples
mv ./dist/* ./
chmod a+x ./odin
cd sokol
chmod a+x ./build_clibs_macos.sh
./build_clibs_macos.sh
cd ..
- if: runner.os == 'Windows'
name: prepare-windows
shell: cmd
run: |
curl -L https://github.com/odin-lang/Odin/releases/download/dev-2023-07/odin-windows-amd64-dev-2023-07.zip --output odin.zip
curl -L https://github.com/odin-lang/Odin/releases/download/dev-2024-04/odin-windows-amd64-dev-2024-04.zip --output odin.zip
unzip odin.zip
cd sokol
build_clibs_windows.cmd
cd ..
- name: build
run: |
./odin build examples/clear -debug
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ build/
*.obj
*.pdb
*.bin
*.exp
*.ilk
*.dll
*.dylib
*.exe
*.dSYM/
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## CHANGELOG

> NOTE: this changelog is only for changes to the sokol-odin 'scaffolding'.
For actual Sokol header changes, see the
[sokol changelog](https://github.com/floooh/sokol/blob/master/CHANGELOG.md).

### 13-Apr-2024

Merged PR https://github.com/floooh/sokol-odin/pull/11, this changes the
directory structure of the bindings repository, adds support to build
the Windows bindings as a DLL and a couple of smaller things
detailed here: https://github.com/floooh/sokol/pull/1023
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![Odin](https://github.com/floooh/sokol-odin/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-odin/actions/workflows/main.yml)

Auto-generated Odin bindings for the [sokol headers](https://github.com/floooh/sokol).
Auto-generated [Odin](https://github.com/odin-lang/odin) bindings for the [sokol headers](https://github.com/floooh/sokol).

To include sokol in your project you can copy the [sokol](sokol/) directory.

## BUILD

Expand All @@ -12,12 +14,14 @@ On Linux install the following packages: libglu1-mesa-dev, mesa-common-dev, xorg
1. First build the required static link libraries:

```
cd sokol
# on macOS:
./build_clibs_macos.sh
# on Linux:
./build_clibs_linux.sh
# on Windows with MSVC (from a 'Visual Studio Developer Command Prompt')
build_clibs_windows.cmd
cd ..
```
2. Create a build directory and cd into it:
Expand Down Expand Up @@ -47,6 +51,7 @@ On Linux install the following packages: libglu1-mesa-dev, mesa-common-dev, xorg
odin run ../examples/sgl -debug
odin run ../examples/sgl-points -debug
odin run ../examples/sgl-context -debug
odin run ../examples/vertexpull -debug
```
By default, the backend 3D API will be selected based on the target platform:
Expand Down
43 changes: 0 additions & 43 deletions build_clibs_linux.sh

This file was deleted.

127 changes: 0 additions & 127 deletions build_clibs_macos.sh

This file was deleted.

31 changes: 0 additions & 31 deletions build_clibs_windows.cmd

This file was deleted.

5 changes: 2 additions & 3 deletions build_shaders_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build_shader() {
shdc=$sokol_tools_root/bin/osx/sokol-shdc
fi
echo $dir
$shdc -i $dir/shader.glsl -o $dir/shader.odin -l glsl330:metal_macos:hlsl4 -f sokol_odin
$shdc -i $dir/shader.glsl -o $dir/shader.odin -l glsl430:metal_macos:hlsl5 -f sokol_odin
}

build_shader blend
Expand All @@ -26,5 +26,4 @@ build_shader quad
build_shader shapes
build_shader texcube
build_shader triangle


build_shader vertexpull
2 changes: 0 additions & 2 deletions c/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/blend/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//------------------------------------------------------------------------------
package main

import "core:runtime"
import "base:runtime"
import slog "../../sokol/log"
import sg "../../sokol/gfx"
import sapp "../../sokol/app"
Expand Down
Loading

0 comments on commit b420465

Please sign in to comment.