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 <karl@zylinski.se> (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: |
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
#pragma once | |
// uncompressed png writer & reader | |
// supports only 8-bit and 16-bit formats | |
// Performance comparison for 8192x8192 BGRA8 image (256MB) | |
// Compiled with "clang -O2", AVX2 requires extra "-mavx2" or "/arch:AVX2" argument | |
// | |
// For libpng (compressed) uses default libpng/zlib compression settings | |
// For libpng (uncompressed) case following two functions are used: |
NewerOlder