This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Based on the Anti-aliased Euclidean distance transform described by Stefan Gustavson and | |
Robin Strand. For further information, see https://contourtextures.wikidot.com/ and | |
https://web.archive.org/web/20220503051209/https://weber.itn.liu.se/~stegu/edtaa/ | |
The algorithm is an adapted version of Stefan Gustavson's code, it inherits the copyright | |
statement below, which applies to this file only. | |
The rewrite with Unity Burst support makes the execution 40 times faster by default, | |
and 75 times faster if the passed in textures are both of type TextureFormat.RGBAFloat. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package vendor_wgpu_example_fontstash | |
import intr "base:intrinsics" | |
import "core:fmt" | |
import "core:math/linalg" | |
import sa "core:container/small_array" | |
import fs "vendor:fontstash" | |
import "vendor:wgpu" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bgfx | |
import "base:intrinsics" | |
import "base:runtime" | |
import cffi "core:c" | |
when ODIN_OS == .Linux { | |
@require foreign import bgfx { | |
"libs/windows/bgfx.a", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "core:fmt" | |
import "core:io" | |
import "core:odin/ast" | |
import "core:odin/parser" | |
import "core:os" | |
import "core:path/filepath" | |
import "core:slice" | |
import "core:strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <stdio.h> | |
#include <time.h> | |
#define COBJMACROS | |
#include <windows.h> | |
#include <d3d11_1.h> | |
#include <d3dcompiler.h> | |
////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "core:fmt" | |
import "core:mem" | |
import "core:os" | |
import "core:runtime" | |
import "core:strconv" | |
import "core:sys/windows" | |
import "core:time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Octahedral mapping visualization in Odin and Raylib | |
// by Jakub Tomšů (@jakubtomsu_) | |
// | |
// Build and run with 'odin run octsphere.odin -file'. | |
// No additional dependencies required. | |
// | |
// Sources: | |
// https://gpuopen.com/learn/fetching-from-cubes-and-octahedrons/ | |
// https://knarkowicz.wordpress.com/2014/04/16/octahedron-normal-vector-encoding/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// D3D12 single-function triangle sample. | |
// | |
// Usage: | |
// - copy SDL2.dll from Odin/vendor/sdl2 to your project directory | |
// - odin run . | |
// | |
// Contributors: | |
// - Jakub Tomšů (updated to newest Odin version) | |
// - Karl Zylinski <[email protected]> (Initial port) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "core:fmt" | |
import "core:math" | |
import "core:math/linalg" | |
import rl "vendor:raylib" | |
main :: proc() { | |
rl.SetConfigFlags({.VSYNC_HINT, .WINDOW_RESIZABLE, .MSAA_4X_HINT}) | |
rl.InitWindow(800, 600, "collision") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Complete stuff: | |
https://xmonader.github.io/letsbuildacompiler-pretty/ | |
Lexers + DFAs: | |
https://gist.github.com/pervognsen/218ea17743e1442e59bb60d29b1aa725 | |
Parsing: | |
https://eli.thegreenplace.net/2012/08/02/parsing-expressions-by-precedence-climbing | |
Backend: |
NewerOlder