Skip to content

Instantly share code, notes, and snippets.

View oreyg's full-sized avatar

Joe oreyg

  • CD Projekt RED
  • Warszawa
View GitHub Profile
#include "hscript.h"
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <assert.h>
HSId HScript_new_id()
{
// Stream-like archive, that treats data as a flat blob
template<typename TArchive>
concept TStreamArchiveConcept = requires(TArchive& archive,
char& c8,
b8& b8,
u16& u16,
u32& u32,
u64& u64,
i16& i16,
i32& i32,
@oreyg
oreyg / gist:1255bca96e24edb5a549b0d8dcf735ce
Last active January 14, 2023 19:52
ECS EnTT transform
#pragma once
struct DirtyComponent
{
};
/*
struct VectorizeComponent
{
};
@oreyg
oreyg / gist:13069248a9f7ffe3962d882cf9123c03
Last active November 14, 2021 00:04
Example of game engine tick loop
static constexpr uint64_t g_fixed_frame_rate = 60;
static constexpr double g_fixed_delta_time = 1.0 / g_fixed_frame_rate;
// Time counters
uint64_t m_start_tick = 0;
uint64_t m_prev_tick = 0;
uint64_t m_delta_tick = 0;
// Last processed frame number
uint64_t m_fixed_last_frame = 0;