Skip to content

Instantly share code, notes, and snippets.

View zergon321's full-sized avatar
🎮
Fan of Touhou Project

RedBull zergon321

🎮
Fan of Touhou Project
View GitHub Profile
@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@armornick
armornick / openicon.c
Created August 23, 2012 08:47
Draw an Image with SDL2
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#define WIDTH 800
#define HEIGHT 600
#define IMG_PATH "exit.png"
int main (int argc, char *argv[]) {
@roxlu
roxlu / GridDrawer.cpp
Created March 5, 2013 12:42
Probably the most basic example of using Texture Buffer Objects (TBOs) with openGL
#include "GridDrawer.h"
#include "Grid.h"
GridDrawer::GridDrawer(Grid& grid)
:grid(grid)
,grid_prog(0)
,grid_vbo(0)
,grid_vao(0)
,u_projection_matrix(0)
{
@mahan
mahan / gist:6256149
Last active January 7, 2021 16:19
Atomic boolean for golang
/* Atomic boolean for golang
A process-atomic boolean that can be used for signaling between goroutines.
Default value = false. (nil structure)
*/
package main
import "sync/atomic"
@steeve
steeve / _readme.md
Last active July 9, 2024 04:49
How to cross compile Go with CGO programs for a different OS/Arch

How to cross compile Go with CGO programs for a different OS/Arch

It is possible to compile Go programs for a different OS, even though go build says otherwise.

You'll need:

@rcolinray
rcolinray / gl_ffmpeg.cpp
Created November 19, 2013 20:54
OpenGL-FFMpeg integration
// Use OpenGL 3.0+, but don't use GLU
#define GLFW_INCLUDE_GL3
#define GLFW_NO_GLU
#include <GL/glfw.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
extern "C" {
@smukkejohan
smukkejohan / crossFade.frag
Created November 5, 2014 15:01
Simple crossfade shader gl2 GLSL version 120
#version 120
uniform sampler2DRect tex0;
uniform sampler2DRect tex1;
uniform vec2 aTexSize;
uniform vec2 bTexSize;
uniform float fadeToB;
varying vec2 texCoordVarying;
@bhollis
bhollis / webaudio.js.coffee
Last active September 6, 2022 11:35
A simple interface for playing raw audio samples via the Web Audio API. Meant to mimic the API from dynamicaudio.js.
# The WebAudio object can be used to write raw stereo sound samples.
#
# It has one property, "supported" which returns whether the Web Audio API
# is supported, and one method, "writeStereo" which will play sound samples.
class WebAudio
constructor: ->
if window.AudioContext? || window.webKitAudioContext?
@context = new (window.AudioContext ? window.webKitAudioContext)
@supported = true
else
// C program for Red-Black Tree insertion
#include<stdio.h>
#include<stdlib.h>
//A Red-Black tree node structure
struct node
{
int data; // for data part
char color; // for color property
@zchee
zchee / cgo.md
Last active July 14, 2024 14:58
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.