Skip to content

Instantly share code, notes, and snippets.

View Gpinchon's full-sized avatar
🖥️
Hardly working hard

Gpinchon

🖥️
Hardly working hard
View GitHub Profile
@pissang
pissang / filter.glsl
Last active February 2, 2023 19:22
Shader Code from Edge-Avoiding À-Trous Wavelet Transform for fast Global Illumination Filtering https://github.com/LWJGL/lwjgl3-demos/blob/master/res/org/lwjgl/demo/opengl/raytracing/tutorial8/atrous.fs.glsl
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
*/
/**
* This is a 1:1 implementation/copy of the GLSL algorithm shown at the
* end of the 2010 paper "Edge-Avoiding À-Trous Wavelet Transform for
* fast Global Illumination Filtering"
*
* https://jo.dreggn.org/home/2010_atrous.pdf
@arthurafarias
arthurafarias / README.md
Last active May 20, 2024 14:46
Encoding URI and URI Component in C++

Encode and Decode HTTP URIs and URI components in C++

What is a URI?

A Uniform Resource Identifier (URI) is a string of characters that unambiguously identifies a particular resource. To guarantee uniformity, all URIs follow a predefined set of syntax rules,[1] but also maintain extensibility through a separately defined hierarchical naming scheme (e.g. "http://").

Such identification enables interaction with representations of the resource over a network, typically the World Wide Web, using specific protocols. Schemes specifying a concrete syntax and associated protocols define each URI. The most common form of URI is the Uniform Resource Locator (URL), frequently referred to informally as a web address. More rarely seen in usage is the Uniform Resource Name (URN), which was designed to complement URLs by providing a mechanism for the identification of resources in particular namespaces.

The common parts of a URI are described below.

  • void glEnableVertexAttribArray​(GLuint attribIndex);
  • void glDisableVertexAttribArray​(GLuint attribIndex);
  • void glVertexAttribPointer(GLuint attribIndex, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer);
  • void glVertexAttribFormat(GLuint attribIndex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
  • void glVertexAttribBinding(GLuint attribIndex, GLuint bindingIndex);
  • void glBindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset, GLintptr stride);
parameter Details
attribIndex the location for the vertex attribute to which the vertex array will feed data
@armornick
armornick / playwav.c
Created August 24, 2012 07:31
Play a sound with SDL2 (no SDL_Mixer)
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played