Skip to content

Instantly share code, notes, and snippets.

@RomiTT
RomiTT / gist:2b4ccc7bca41a1d58ae14a130e28939d
Created March 17, 2020 15:12 — forked from Madsy/gist:6980061
Working multi-threading two-context OpenGL example with GLFW 3.0.3 and GLEW 1.8
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <vector>
#include <cmath>
#include <cstdio>
#include <limits>
#include <chrono>
#include <thread>
#include <mutex>
@RomiTT
RomiTT / TextureArrayShader.frag
Created March 4, 2020 14:34 — forked from mantissa/TextureArrayShader.frag
GL_TEXTURE_2D_ARRAY in OpenFrameworks
#version 150
#define MAX_TEXTURES 2
uniform sampler2DArray textures;
uniform int texID;
in vec2 vTexCoord;
@RomiTT
RomiTT / dxgl.c
Created March 4, 2020 14:11 — forked from mmozeiko/dxgl.c
WGL_NV_DX_interop2 example
#define COBJMACROS
#define INITGUID
#include <intrin.h>
#include <windows.h>
#include <d3d11.h>
#include <gl/GL.h>
#include "glext.h" // https://www.opengl.org/registry/api/GL/glext.h
#include "wglext.h" // https://www.opengl.org/registry/api/GL/wglext.h
@RomiTT
RomiTT / glfw_ship.cpp
Created March 3, 2020 17:06 — forked from ad8e/glfw_ship.cpp
instructions to use skia and glfw together. (download, installation, first program). works on Linux and Windows.
/* Note: this Google copyright notice only applies to the original file, which has large sections copy-pasted here. my changes are under CC0 (public domain).
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
The official instructions don't work well. These alternative instructions are intended to be the shortest path to get a minimal setup running.
@RomiTT
RomiTT / fragment_shader_NV12_to_RGB.frag
Created November 5, 2019 16:29 — forked from crearo/fragment_shader_NV12_to_RGB.frag
A fragment shader to convert NV12 to RGB.
/** A fragment shader to convert NV12 to RGB.
* Input textures Y - is a block of size w*h.
* texture UV is of size w*h/2.
* Remember, both U and V are individually of size w/2*h/2, but they are interleaved.
* The layout looks like this :
* ----------
* | |
* | Y | size = w*h
* | |
* |________|