Skip to content

Instantly share code, notes, and snippets.

View Overv's full-sized avatar

Alexander Overvoorde Overv

View GitHub Profile
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
@Overv
Overv / HelloTriangle.cc
Created April 24, 2016 18:54
Vulkan hello triangle
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <chrono>
#include <functional>
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
@Overv
Overv / VulkanClear.cc
Last active April 8, 2023 05:30
Vulkan code for clearing the screen
#include <iostream>
#include <vector>
#define GLFW_INCLUDE_VULKAN
#define VK_USE_PLATFORM_WIN32_KHR
#include <GLFW/glfw3.h>
#define GLFW_EXPOSE_NATIVE_WIN32
#include <GLFW/glfw3native.h>
@Overv
Overv / clean.py
Last active October 28, 2015 13:11
import os
import re
def get_filepaths(directory):
file_paths = []
for root, directories, files in os.walk(directory):
for filename in files:
filepath = os.path.join(root, filename)
file_paths.append(filepath)
@Overv
Overv / main.cpp
Created April 15, 2015 19:15
Hello World
#include <iostream>
int main() {
std::cout << "Hello, world!" << std::endl;
return 0;
}
@Overv
Overv / main.cpp
Last active August 29, 2015 14:18
Triangle in OpenGL without vertex data
#include <SDL.h>
#define GLEW_STATIC
#include <GL/glew.h>
const char* vertShaderSrc =
"#version 440\n"
"void main() {"
"if (gl_VertexID == 0) gl_Position = vec4( 0.0, 0.5, 0, 1);"
"if (gl_VertexID == 1) gl_Position = vec4( 0.5, -0.5, 0, 1);"
@Overv
Overv / Makefile
Last active May 30, 2020 09:08
GPU backed BUSE block device
gpu: gpu.cpp
g++ -std=c++11 -O2 -flto -march=native -o gpu gpu.cpp -L. -lbuse -lOpenCL

Keybase proof

I hereby claim:

  • I am overv on github.
  • I am overv (https://keybase.io/overv) on keybase.
  • I have a public key whose fingerprint is 6FC5 3ADC 96B2 9E45 BACE DD87 1914 5C77 E4F4 3EB3

To claim this, I am signing this object:

@Overv
Overv / json.d
Last active January 2, 2016 09:19
Serialize D types to json
module json;
import std.conv;
import std.array;
import std.traits;
string json(T) (T obj) {
static if (is(typeof(obj) == string)) {
return "\"" ~ obj.replace("\\", "\\\\").replace("\"", "\\\"") ~ "\"";
} else static if (isBasicType!(typeof(obj))) {
@Overv
Overv / json.d
Last active January 2, 2016 09:19
Convert any D type to JSON automatically through trait/template magic
import std.stdio;
import std.conv;
import std.array;
import std.traits;
class Foo {
Bar nested;
this(Bar nested) {
this.nested = nested;