Skip to content

Instantly share code, notes, and snippets.

@Redchards
Redchards / Platform.hxx
Created November 28, 2015 08:23
Simple definition file to ease multi-platform compilation in C++
#ifndef PLATFORM
#define PLATFORM
#define GCC_COMPILER 1
#define MVSC_COMPILER 2
#define ICC_COMPILER 3
#define BORLAND_COMPILER 4
#define LINUX 1
#define WINDOWS 2
@mazurio
mazurio / gist:5092dc53bd4a4db956a1
Created April 19, 2015 17:52
Basic SDL2 Template
#include <iostream>
#include <SDL.h>
using namespace std;
int main() {
if(SDL_Init(SDL_INIT_VIDEO) != 0) {
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active April 4, 2026 04:30
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@richard-to
richard-to / x11_screen_grab.cpp
Created April 7, 2014 10:30
X11 Example code for grabbing screenshots of window and sending key events
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <X11/Xlib.h>