Skip to content

Instantly share code, notes, and snippets.

$ spatial diagnose --log_level=debug
Looking for a 'spatial' configuration file at 'C:\Users\ppero\AppData\Local\.improbable\spatial\config.pb.json'
Read 'spatial' configuration: enable_plugins:true .
Detected legacy project structure at D:\code2\Improbable_UE4\Samples\UnrealGDKExampleProject\spatial
Enabling plugins for supported SDK version '13.8.1'
using local event logger
starting wrapper services endpoint
health-check message from wrapper service received
wrapper service started successfully in 1.9902ms after 1 attempt(s)
Importing the SDK plugin for project SDK version '13.8.1'.
#include <stdio.h>
#include "bgfx/bgfx.h"
#include "bgfx/platform.h"
#include "bx/math.h"
#include "GLFW/glfw3.h"
#define GLFW_EXPOSE_NATIVE_WIN32
#include "GLFW/glfw3native.h"
#define WNDW_WIDTH 1600
#define WNDW_HEIGHT 900
@pperon
pperon / hi-res-clock.cpp
Last active July 18, 2017 22:10
An example of a high resolution clock.
#include <stdio.h>
#include <time.h>
#include <errno.h>
#include <string.h>
int main()
{
clockid_t clock;
if(clock_getcpuclockid(0, &clock) != 0) {
strerror(errno);
@pperon
pperon / openAndReadFile.c
Created March 24, 2015 21:18
I'm tired of in-lining shader code and forgot how to read the contents of a file in C.
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
int main()
{
const char *FILENAME = "shader.glsl";
FILE *shader;
#ifdef _WIN32
@pperon
pperon / ring.erl
Created December 22, 2011 18:23
My solution to the Erlang Process Ring Exercise 4-2 in Programming Erlang
-module(ring).
-export([start/3, loop/0]).
%%%
%%% An implementation of an Erlang process ring. This is probably the
%%% Erlang equivalent of breaking your first board in Karate class.
%%%
start(NumMsgs, NumProcs, Msg) ->
UnlinkedRing = create_process([], NumProcs),