This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // gcc bootstrap_raylib.c -o bootstrap_raylib && ./bootstrap_raylib --project-path ./demo | |
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/stat.h> | |
| #ifdef _WIN32 | |
| #include <direct.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // gcc bootstrap.c -o bootstrap && ./bootstrap --project-path ./sample | |
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/stat.h> | |
| #ifdef _WIN32 | |
| #include <direct.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // color1 and color2 are R4G4B4 12bit RGB color values, alpha is 0-255 | |
| uint16_t blend_12bit( uint16_t color1, uint16_t color2, uint8_t alpha ) { | |
| uint64_t c1 = (uint64_t) color1; | |
| uint64_t c2 = (uint64_t) color2; | |
| uint64_t a = (uint64_t)( alpha >> 4 ); | |
| // bit magic to alpha blend R G B with single mul | |
| c1 = ( c1 | ( c1 << 12 ) ) & 0x0f0f0f; | |
| c2 = ( c2 | ( c2 << 12 ) ) & 0x0f0f0f; | |
| uint32_t o = ( ( ( ( c2 - c1 ) * a ) >> 4 ) + c1 ) & 0x0f0f0f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ------------------------------------------------------------------------------ | |
| Licensing information can be found at the end of the file. | |
| ------------------------------------------------------------------------------ | |
| bass_and_treble.h - v1.0 - Simple audio filter to boost bass and treble. | |
| Do this: | |
| #define BASS_AND_TREBLE_IMPLEMENTATION | |
| before you include this file in *one* C/C++ file to create the implementation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef struct filter_t { | |
| double a0, a1, a2; // Feedforward coefficients | |
| double b1, b2; // Feedback coefficients | |
| double z1, z2; // Filter state (history) | |
| } filter_t; | |
| void filter_init(filter_t *filter, double cutoff, double sample_rate) { | |
| double const PI = 3.14159265358979323846; | |
| double omega = 2.0 * PI * cutoff / sample_rate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import soundfile as sf | |
| from scipy.fftpack import fft, ifft | |
| def rotateSignal(signal,flip): | |
| if flip: | |
| signal = signal[::-1] | |
| x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft | |
| rotSig = ifft(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <stdbool.h> | |
| #include <windows.h> | |
| #pragma comment( lib, "user32.lib" ) | |
| #pragma comment( lib, "gdi32.lib" ) | |
| #define SCRW 640 | |
| #define SCRH 480 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| // ----------------------------------------------------------------------------- | |
| // Cross platform high resolution timer | |
| // From https://gist.github.com/ForeverZer0/0a4f80fc02b96e19380ebb7a3debbee5 | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #if defined(__linux) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "shared:shaderc" | |
| import "vendor:glfw" | |
| import vk "vendor:vulkan" | |
| MAX_FRAMES_IN_FLIGHT :: 2 | |
| Context :: struct | |
| { | |
| instance: vk.Instance, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define STR_NEW( pool, str ) ( pool = memcpy( (char*) memcpy( malloc( ( str ? strlen( str ) : 0 ) + 1 + \ | |
| sizeof( char* ) ), &pool, sizeof( char* ) ) + sizeof( char*), str ? str : "", ( str ? strlen( str ) : 0 ) + 1 ) ) | |
| #define STR_FREE( pool ) while( pool ) { char* STR_FREE_TMP = ( pool - sizeof( char* ) ); \ | |
| pool = ( *(char**)STR_FREE_TMP ); free( STR_FREE_TMP ); } | |
| //--------------------------- | |
| char* strpool = NULL; |
NewerOlder