Skip to content

Instantly share code, notes, and snippets.

View colbyhall's full-sized avatar

Colby colbyhall

View GitHub Profile
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.g.have_nerd_font = true
-- Manually add C++ becuase conform for some reason does not work for it.
vim.api.nvim_create_autocmd('BufWritePre', {
pattern = { '*.c', '*.cpp', '*.h', '*.hpp', '*.m', '*.mm', '*.rs' },
callback = function()
require('conform').format { lsp_fallback = true }

Newport Research Document

As I've been working on this project I've realized that I need a space to throw a bunch of information regarding design patterns, API's, and system architecture. I can't retain all of this in my head and I've found some deep hidden blogs/research that have been extremely helpful. There will be "basic" information in this doc. I want a place where someone can start picking up on Game Engine Programming.

API Selection

Name Platform Reason
Vulkan Windows, Linux, Switch Hardware Abstraction Layer
DirectX12 Windows, XBOX Hardware Abstraction Layer
DirectXCompiler Windows, Linux, XBOX Runtime Shader Compilation
SPIRV Reflect Windows, Linux, Switch Vulkan Description Layout
#define FNV_OFFSET_BASIC 0xcbf29ce484222325
#define FNV_PRIME 0x100000001b3
inline u64 fnv1_hash(const void* s, usize size) {
u64 hash = FNV_OFFSET_BASIC;
const u8* const casted_s = s;
for (usize i = 0; i < size; ++i) {
hash *= FNV_PRIME;
hash = hash ^ casted_s[i];
}
#include "vulkan.h"
#include "string.h"
// #include <glslang/Public/ShaderLang.h>
// #include <glslang/Include/glslang_c_interface.h>
Render_Context* g_render_context = nullptr;
static const char* const instance_layers[] = {
"VK_LAYER_KHRONOS_validation",
struct TLimits {
bool nonInductiveForLoops;
bool whileLoops;
bool doWhileLoops;
bool generalUniformIndexing;
bool generalAttributeMatrixVectorIndexing;
bool generalVaryingIndexing;
bool generalSamplerIndexing;
bool generalVariableIndexing;
bool generalConstantMatrixVectorIndexing;
@colbyhall
colbyhall / .vimrc
Created April 30, 2020 01:10
my vimrc
syntax on
set noerrorbells
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set nu
set nowrap
set smartcase
#![feature(trait_alias)]
#![feature(box_syntax)]
use std::thread;
use std::sync::{
Arc,
Mutex,
Condvar,
};
use std::sync::atomic::{ AtomicBool, Ordering };
use std::fs;
use std::io::prelude::*;
const EXTENSION: &str = "md";
const HEADER: &str =
"
<!doctype htmls>
<html>
<head>
<meta chaset=\"utf8\">
#ifndef MEMORY_H
#define MEMORY_H
#include "language_layer.h"
#include <string.h>
struct Memory_Arena {
u8 *base;
usize used;
usize total;
std::string get_std_string() {
return "foo bar";
}
void do_thing_with_c_str(const char* c_str) {
// something
}
int main() {
char* c_str = get_std_string().c_str();