Skip to content

Instantly share code, notes, and snippets.

View PathogenDavid's full-sized avatar
🪄
Math goes in, pixels come out!

David Maas PathogenDavid

🪄
Math goes in, pixels come out!
View GitHub Profile
@PathogenDavid
PathogenDavid / main.cpp
Created July 10, 2014 16:14
WaitableTimerTest2
#include <Windows.h>
#include <stdio.h>
#include <assert.h>
#define NANOSECONDS_PER_SECOND ( 1000000000LL )
#define NANOSECONDS_PER_TIMER ( 100LL )
int main()
{
LARGE_INTEGER begin;
@PathogenDavid
PathogenDavid / main.cpp
Created July 10, 2014 16:11
WaitableTimerTest1
#include <Windows.h>
#include <stdio.h>
#include <assert.h>
#define NANOSECONDS_PER_SECOND ( 1000000000LL )
#define NANOSECONDS_PER_TIMER ( 100LL )
int main()
{
LARGE_INTEGER begin;
@PathogenDavid
PathogenDavid / Oculus.cs
Last active August 29, 2015 14:03
Quick and dirty LibOVR test in C#
using System;
using System.Runtime.InteropServices;
namespace Protoscratch
{
static class Oculus
{
[DllImport("LibOVRDll64.dll", EntryPoint = "ovr_Initialize", CallingConvention=CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]//LibOVR uses 1 byte booleans
public static extern bool Initialize();
@PathogenDavid
PathogenDavid / Texture.cs
Created June 14, 2014 03:34
Texture.Download method
/// <summary>
/// Downloads this texture from the GPU.
/// </summary>
/// <returns>A bitmap representing this texture. You are responsible for disposing it.</returns>
public Bitmap Download()
{
Bitmap bitmap = null;
try
{
bitmap = new Bitmap(Width, Height);
@PathogenDavid
PathogenDavid / gist:bdd313ad49d1990059d2
Created May 31, 2014 11:56
A small playground showing that extension methods do not win over generics like they would if they were part of the extended class.
using System;
namespace ObservedSerialization
{
/// <summary>
/// Like SerializerMode
/// </summary>
enum ThingMode
{
SwapValues,