Skip to content

Instantly share code, notes, and snippets.

@llandsmeer
llandsmeer / libtccdemo.c
Created March 9, 2020 20:38
LibTCC demo - usage example for live c code compilation & execution
#include <stdio.h>
#include <stdlib.h>
#include <libtcc.h>
void callme(int x) {
printf("hello, %d\n", x);
}
void error_func(void * user, const char * msg) {
printf("TCC Error: %s\n", msg);
@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>