Skip to content

Instantly share code, notes, and snippets.

View beaumanvienna's full-sized avatar
😇

JC beaumanvienna

😇
  • jc techno labs
  • Sacramento, California
View GitHub Profile
@TheCherno
TheCherno / Instrumentor.h
Last active April 6, 2024 12:44
Basic Instrumentation Profiler
//
// Basic instrumentation profiler by Cherno
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like:
//
// Instrumentor::Get().BeginSession("Session Name"); // Begin session
// {
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling
// // Code
// }
@jordandee
jordandee / sdl2_opengl.cpp
Last active April 30, 2024 14:19
Simple SDL2/OpenGL example
// To compile with gcc: (tested on Ubuntu 14.04 64bit):
// g++ sdl2_opengl.cpp -lSDL2 -lGL
// To compile with msvc: (tested on Windows 7 64bit)
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>