pjako / sokol-samples

Sample code for https://github.com/floooh/sokol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sokol-samples

Sample code for https://github.com/floooh/sokol

asm.js/wasm live demos: https://floooh.github.io/sokol-html5/index.html

Work In Progress

Build Status:

Platform Build Status
Windows Build status
OSX Build Status

How to build

Make sure that the following tools are in the path. Exact versions shouldn't matter:

> python --version
Python 2.7.10
> cmake --version
cmake version 3.8.2
# make is only needed for building through emscripten
> make --version
GNU Make 3.81
# on OSX (on Windows you just need a recent VS)
> xcodebuild -version
Xcode 9.0

Clone, build and run the native samples:

> mkdir ~/scratch
> cd ~/scratch
> git clone git@github.com:floooh/sokol-samples
> cd sokol-samples
> ./fips build
...
> ./fips list targets
...
> ./fips run triangle-glfw
...

To open the project in Xcode or Visual Studio:

> cd ~/scratch/sokol-samples
> ./fips open

To build for emscripten:

> cd ~/scratch/sokol-samples
> ./fips setup emscripten
[...this will take a while]
> ./fips set config webgl2-emsc-make-release
> ./fips build
...
> ./fips list targets
...
> ./fips run triangle-emsc
...

To build for Metal on OSX:

> cd ~/scratch/sokol-samples
> ./fips set config metal-osx-xcode-debug
> ./fips build
...
> ./fips list targets
...
> ./fips run triangle-metal

To build for D3D11 on Windows:

> cd /scratch/sokol-samples
> fips set config d3d11-win64-vstudio-debug
> fips build
...
> fips list targets
...
> fips run triangle-d3d11

To build for Linux:

> cd ~/scratch/sokol-samples
> ./fips set config linux-make-debug
> ./fips build
...
> ./fips list targets
...
> ./fips run triangle-glfw
...

You may need to install some dev-packages required for GLFW on Linux, see here: http://www.glfw.org/docs/latest/compile.html#compile_deps_x11

Type ./fips help for more build system options.

Thanks to:

Enjoy!

About

Sample code for https://github.com/floooh/sokol

License:MIT License


Languages

Language:C 61.6%Language:C++ 32.9%Language:Objective-C 2.1%Language:Python 1.2%Language:CMake 0.9%Language:CSS 0.5%Language:HTML 0.4%Language:JavaScript 0.3%Language:Metal 0.1%Language:Mercury 0.1%Language:Shell 0.0%Language:Batchfile 0.0%