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
// | |
// This Source Code Form is subject to the terms of the Mozilla Public | |
// License, v. 2.0. If a copy of the MPL was not distributed with this | |
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
// | |
// Author: Jonas Everaert | |
// | |
// You can change these however you like | |
#define _TU_TYPE_PREFIX(Type) T_##Type |
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
use winit::{ | |
window::Window, | |
event::{Event, WindowEvent, self}, | |
event_loop, | |
}; | |
use wgpu::util::DeviceExt; | |
use anyhow::Result; | |
#[repr(C)] | |
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] |
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
require 'beaver' | |
project = Project.new("MyProject") | |
project.set_configs("Debug", "Release") | |
# Set configuration options for the C language | |
project.c_configs = { | |
"Debug" => C::Configuration.new(cflags: ["-DDEBUG"]), | |
"Release" => C::Configuration.new(cflags: ["-DRELEASE"]) | |
} | |
project.default_config = "Debug" |
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 <stdio.h> | |
#include <stdlib.h> | |
#define Array(Type) struct array_##Type | |
#define DefineArray(Type) struct array_##Type { Type* elements; int len; int cap; } | |
#define array_get(array, index) (array).elements[index] | |
#define array_set(array, value, index) (array).elements[index] = value | |
#define create_Array(Type, cap) (struct array_##Type) { (Type*) malloc(cap * sizeof(Type)), 0, cap } | |
#define destroy_Array(array) free((array).elements) | |
#define array_append(array, value) (array).elements[(array).len++] = value |
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 <stdio.h> | |
#include <stdlib.h> | |
typedef void*(*allocator_alloc_fn)(void* userData, size_t cap); | |
typedef void (*allocator_free_fn)(void* userData, void* ptr); | |
typedef void*(*allocator_realloc_fn)(void* userData, void* ptr, size_t cap); | |
typedef struct _allocator { | |
allocator_alloc_fn alloc; | |
allocator_free_fn free; |
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
clang++ main.cpp $(pkg-config libcamera --libs --cflags) -std=gnu++20 |
OlderNewer