This file contains hidden or 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
using System; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using Generic = System.Collections.Generic; | |
public unsafe class LinearArena : IDisposable { | |
public byte* _buffer; | |
nint _offset; | |
nint _capacity; | |
nint _generation; |
This file contains hidden or 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
const std = @import("std"); | |
const math = @import("math.zig"); | |
const ObjLineType = enum { | |
Vertex, | |
Normal, | |
Texcoord, | |
Face, | |
}; |
This file contains hidden or 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
@group(0) @binding(0) var gBufferNormal: texture_2d<f32>; | |
@group(0) @binding(1) var gBufferAlbedo: texture_2d<f32>; | |
@group(0) @binding(2) var gBufferDepth: texture_depth_2d; | |
struct LightData { | |
position : vec4<f32>, | |
color : vec3<f32>, | |
radius : f32, | |
} |
This file contains hidden or 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
using System; | |
using System.Runtime.InteropServices; | |
using System.Runtime.CompilerServices; | |
using Range = System.Range; | |
public unsafe struct Arena { | |
UnmanagedArray<Optional<Block>> _blocks; | |
int _currentBlockIndex; |
This file contains hidden or 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" | |
DangerStruct :: struct { | |
guid: u128, | |
value: u64, | |
} | |
SafeStruct1 :: struct { |
This file contains hidden or 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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
using UnityEngine; | |
using Object = UnityEngine.Object; | |
// This is a System.Guid, except it can be serialized by Unity, | |
// so it can be used to permanently store the ID of an entity. |
This file contains hidden or 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 "vendor:directx/d3d11" | |
import "vendor:directx/d3d_compiler" | |
import "vendor:directx/dxgi" | |
import SDL "vendor:sdl2" | |
import "core:unicode/utf16" | |
WINDOW_WIDTH : i32 = 1280 |
This file contains hidden or 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
use std::borrow::Cow; | |
use winit::{ | |
event::*, | |
event_loop::{ControlFlow, EventLoop}, | |
window::Window, | |
}; | |
struct AppState { | |
surface: wgpu::Surface, | |
device: wgpu::Device, |
This file contains hidden or 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
using UnityEngine; | |
using Unity.Mathematics; | |
using static Unity.Mathematics.math; | |
[ExecuteInEditMode] | |
public class Bezier : MonoBehaviour { | |
public Vector3 a; | |
public Vector3 b; | |
public Vector3 c; |
This file contains hidden or 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
using Unity.Mathematics; | |
using UnityEngine; | |
using System.Diagnostics; | |
public class MathematicsTests : MonoBehaviour { | |
const int NUM_TESTS = 1_000_000; | |
void Test() { | |
Matrix4x4 identityMatrix4x4 = Matrix4x4.identity; |
NewerOlder