Skip to content

Instantly share code, notes, and snippets.

@sinannar
sinannar / readingCharFromKeyboardWithoutEntering.c
Created March 23, 2012 22:20
Here is a function that implement in c,you can use it if you need a function that takes a character from user without enter
#include <termios.h>
#include <unistd.h>
char mygetch(void);
int main()
{
/*
DRIVER SOURCE CODES HERE
@endolith
endolith / minbleps.cpp
Created May 10, 2012 18:20
MinBLEPs (by Daniel Werner)
// MinBLEP Generation Code
// By Daniel Werner
// This Code Is Public Domain
#include <math.h>
#define PI 3.14159265358979f
// SINC Function
inline float SINC(float x)
@naftulikay
naftulikay / ManualVideoCompile.java
Created June 27, 2012 19:43
Generate a video from scratch with Xuggler
package org.tkassembled.xuggle;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@msg555
msg555 / 3dhull.cpp
Last active April 1, 2023 17:39
3D Convex Hull
#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cassert>
using namespace std;
@banderson623
banderson623 / monitor.c
Last active December 5, 2020 16:29
Here is my final (?) monitor implementation in C.
/**
* Brian Anderson, Spring 2013
* Com S 352, Assignment 7
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* INTRODUCTION & PURPOSE
* -------------------------------------------------------------------
* Create a monitor library fashioned after the slides shown in class.
* It solves the producer/consumer problem by making sure their
* execution happens in a safe manner, even across multiple threads
@kbjorklu
kbjorklu / waveOut.cpp
Created August 23, 2013 09:27
Sample code for the waveOutWrite function.
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
int main()
{
HWAVEOUT hWaveOut = 0;
WAVEFORMATEX wfx = { WAVE_FORMAT_PCM, 1, 8000, 8000, 1, 8, 0 };
waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfx, 0, 0, CALLBACK_NULL);
char buffer[8000 * 60] = {};
@CaptainJH
CaptainJH / FFMpeg_player.cpp
Created June 15, 2014 11:35
a basic FFmpeg player based on SFML
//
// a basic FFMpeg video player
// FFMpeg 2.2.2
// SFML 2.1
// XCode 5.1.1
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-color.md
Last active August 29, 2022 15:54
GLSL color functions

RGB - YUB

mat3 yuv2rgb = mat3(1.0, 0.0, 1.28033, 1.0, -0.21482, -0.38059, 1.0, 2.12798, 0.0);
mat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);

RGB - HSV

@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active July 27, 2024 18:25
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@t-mat
t-mat / minimal_vst2x_host.cpp
Last active June 7, 2024 06:22
WIN32 : Minimal VST 2.x host in C++11.
// Win32 : Minimal VST 2.x Synth host in C++11.
//
// This is a simplified version of the following project by hotwatermorning :
// A sample VST Host Application for C++ Advent Calendar 2013 5th day.
// https://github.com/hotwatermorning/VstHostDemo
//
// Usage :
// 1. Compile & Run this program.
// 2. Select your VST Synth DLL.
// 3. Press QWERTY, ZXCV, etc.