Skip to content

Instantly share code, notes, and snippets.

View dimenus's full-sized avatar

Ryan Saunderson dimenus

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

package sample
import "core:sys/win32"
import "core:fmt"
import plat "./d3d"
WIN_STYLE :: win32.WS_CLIPSIBLINGS | win32.WS_CLIPCHILDREN | win32.WS_CAPTION |
win32.WS_SYSMENU | win32.WS_MINIMIZEBOX | win32.WS_MAXIMIZEBOX | win32.WS_SIZEBOX;
@dimenus
dimenus / dictionary.c
Last active August 10, 2017 15:30
traversal
if(counter == buf_len) {
//this bit (31) gets set when we've hit the end of a valid word
*current_slot |= (1 << 31);
break;
}
//if we're not at the end of a word and memory hasn't been allocated for the next level
//set bit 30 and get memory from the pool
if((*current_slot & (1 << 30)) == 0) {
*current_slot += MemoryPoolOffset + (1 << 30);
@dimenus
dimenus / file.c
Created May 23, 2017 15:16
dynamic array
struct IntArray
{
int Length;
int MaxLength;
int *Data;
};
void PushToIntArray(struct IntArray *int_array, int value)
{
if((int_array->Length + 1) >= int_array->MaxLength) {