Skip to content

Instantly share code, notes, and snippets.

View superwills's full-sized avatar

William superwills

View GitHub Profile
@superwills
superwills / buildCurliOS.sh
Last active April 12, 2024 01:40
Build Curl for iOS
# IF SOMETHING IS NOT WORKING, BLOW AWAY YOUR CURL DOWNLOAD FOLDER AND THEN RE-UN-ZIP IT BECAUSE IT CACHES
# STATE BEYOND WHAT make clean CAN GET RID OF
# iPhone
export ARCH=arm64
export SDK=iphoneos
export DEPLOYMENT_TARGET=12.0
sudo xcode-select --switch /Applications/Xcode.app
export CFLAGS="-arch $ARCH -isysroot $(xcrun -sdk $SDK --show-sdk-path) -m$SDK-version-min=$DEPLOYMENT_TARGET"
@superwills
superwills / StopWatch.h
Created March 22, 2024 02:08
StopWatch / Every
#pragma once
#include <chrono>
struct StopWatch {
std::chrono::high_resolution_clock::time_point start;
StopWatch() {
reset();
}
@superwills
superwills / RenderToTextureMain.cpp
Created March 5, 2024 16:20
OpenGL renderbuffer Render to texture
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define GLEW_STATIC
#include <GL/glew.h>
#include <gl/gl.h>
#include <gl/glu.h>
@superwills
superwills / firstRun.cpp
Created February 19, 2024 19:27
First run
#include <stdio.h>
int main(int argc, const char * argv[]) {
struct FirstRun {
bool hasRun = 0;
operator bool() {
bool firstRun = !hasRun;
hasRun = 1;
@superwills
superwills / clean.bat
Created October 23, 2021 21:26
Visual Studio 2019 cleanup script
REM put this in the ROOT of your Visual Studio 2019 project folder.
rd .vs /s /q
rd Debug /s /q
rd Release /s /q
rd x64 /s /q
REM OpenGL is the name of your project
rd OpenGL\Debug /s /q
rd OpenGL\Release /s /q
rd OpenGL\x64 /s /q
@superwills
superwills / Source.cpp
Last active September 17, 2021 02:52
Why is glTexImage2D() backwards?
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#include <stdio.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <map>
#include <vector>
using namespace std;
@superwills
superwills / index.html
Last active October 7, 2019 03:32 — forked from tiffany352/index.html
Twitter archive browser
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Twitter Archive Browser</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
<style>
@superwills
superwills / PerlinNoise.cpp
Created April 27, 2016 16:00
This is an implementation of Perlin simplex noise by Stefan Gustavson
// Noise1234
// Author: Stefan Gustavson (stegu@itn.liu.se)
//
// This library is public domain software, released by the author
// into the public domain in February 2011. You may do anything
// you like with it. You may even remove all attributions,
// but of course I'd appreciate it if you kept my name somewhere.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@superwills
superwills / GDI+PNGJPG.cpp
Last active September 7, 2021 17:56
GDI+, Gdiplus Image Loading and Saving PNG or JPG
#include <windows.h>
#include <gdiplus.h>
#include <stdio.h>
using namespace Gdiplus;
#pragma comment( lib, "gdiplus.lib" )
#pragma warning( disable : 4018 )
#pragma warning( disable : 4996 )
LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );
@superwills
superwills / info.h
Last active August 29, 2015 14:26
Info,warning,error functions
#include <stdio.h>
#include <stdarg.h>
// bitfield because some error messages can
// be categorized as Info | Warning | Error
enum ErrorLevel{
Info = 1 << 0, Warning = 1 << 1, Error = 1 << 2
};
const char* ErrorLevelName[] = {
"None", //0