Skip to content

Instantly share code, notes, and snippets.

@raysan5
raysan5 / raylib_vs_sdl.md
Last active November 14, 2024 18:25
raylib vs SDL - A libraries comparison

raylib_vs_sdl

In the last years I've been asked multiple times about the comparison between raylib and SDL libraries. Unfortunately, my experience with SDL was quite limited so I couldn't provide a good comparison. In the last two years I've learned about SDL and used it to teach at University so I feel that now I can provide a good comparison between both.

Hope it helps future users to better understand this two libraries internals and functionality.

Table of Content

@rafaelpadovezi
rafaelpadovezi / git-bash-fish.md
Last active November 16, 2024 15:20
Using fish shell with git bash on windows

Using fish shell with git bash on windows

To install fish shell on windows the options are:

  • Cygwin
  • WSL
  • MSYS2

Since git bash is based on MSYS2 it seems a good fit to install fish. The problem is that git bash is a lightweight version of MSYS2 which does not include pacman as a package management, used to install fish.

This OS thread has great suggestions on how to solve this problem including using the full MSYS2. But the best solution for me was this answer by Michael Chen which installs pacman on git bash.

@rafaskb
rafaskb / DistortedTvEffect.java
Last active August 26, 2019 00:42
Distorted TV Effect for libGDX and libgdx-postprocessing-contribs or gdx-vfx. Example: https://www.shadertoy.com/view/Mt2XDV
package com.grashers.core.postprocessing;
import com.badlogic.gdx.graphics.glutils.FrameBuffer;
import com.bitfire.postprocessing.PostProcessorEffect;
public final class DistortedTvEffect extends PostProcessorEffect {
private DistortedTvFilter distortion;
public DistortedTvEffect(int effectsSupport) {
distortion = new DistortedTvFilter(effectsSupport);
@zeevro
zeevro / README.md
Last active November 8, 2021 08:30
Pebble SDK installation script

Now that Pebble servers are gone, some old components in the SDK need to be patched or replaced so they can fetch what they need from Rebble.

This script downloads and installes everything needed to build projects and also run the emulator.

Was tested on Ubuntu 18.04.2 on WSL.

@WesThorburn
WesThorburn / adding_wasm_MIME.md
Last active July 30, 2023 04:35
Webassembly, wasm files, webservers and MIME types

When compiling client files to webassembly, usually you'll end up with both .js and .wasm files. By default, most webservers don't know about the wasm MIME type. You'll likely see the following error: wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

Here is how to add the wasm MIME type (on linux systems, apache + nginx):

Open /etc/mime.types You'll see two columns, media type on the left, file type on the right Add the line application/wasm wasm

@fospathi
fospathi / quadratic_bezier_plane_intersections.txt
Last active June 10, 2024 15:03
Intersection points of a quadratic Bezier curve and a plane
Find the values of the parameter t (in the range 0..1 inclusive) at the intersection points of a quadratic Bezier curve
and a plane in three dimensions.
Let P₀, P₁, and P₂ be the control points of a quadratic Bezier curve B such that
B{t} = (1-t)²P₀ + 2(1-t)(t)P₁ + (t²)P₂
Let A be a unit normal vector to the plane where Q is any position vector on the plane such that
A⋅Q = d
@mattatz
mattatz / Matrix.hlsl
Last active November 2, 2024 14:10
Matrix operations for HLSL
#ifndef __MATRIX_INCLUDED__
#define __MATRIX_INCLUDED__
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
float4x4 inverse(float4x4 m) {
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0];
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1];
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2];
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3];
@EgoMoose
EgoMoose / quadraticBezierLength.lua
Created December 9, 2017 21:51
Calculates the arc length of a quadratic Bezier curve from 0 to t
local abs = math.abs;
local log = math.log;
local sqrt = math.sqrt;
-- calculates length from 0 to t (where t is a percentage eg 1 = 100%).
local function quadraticBezierLength(t, p0, p1, p2)
local a = p0 - 2*p1 + p2;
local b = 2*(p1 - p0);
local A = 4*(a:Dot(a));
local B = 4*(a:Dot(b));
@okapies
okapies / t470s.md
Last active October 28, 2021 16:45
Ubuntu 16.04 on ThinkPad T470s

This is a document describing how to install Ubuntu 16.04 LTS on ThinkPad T470s.

My Hardware

  • CPU: Intel Core i7-7600U (2.80GHz, 4MB cache)
  • Graphics: Intel HD Graphics 620
  • Display: 14” WQHD (2560 X 1440) IPS Non-Touch Anti-Glare
  • Memory: 24GB DDR4 2133 MHz (8GB Onboard + 16GB)
  • SSD: PCIe-NVMe 256G OPAL 2.0
  • Wireless: Intel Dual Band Wireless AC (2x2) 8265 Bluetooth 4.1
  • Fingerprint Reader
@fongreecss
fongreecss / gulpfile.js
Last active April 29, 2020 12:08
Typescript, watchify, gulp - minimal conf with error logging on the console
var gulp = require('gulp');
var ts = require('gulp-typescript');
var browserify = require("browserify");
var source = require('vinyl-source-stream');
var watchify = require("watchify");
var tsify = require("tsify");
var gutil = require("gulp-util");
gulp.task('typescript', function () {
return gulp.src('./app/src/**/*.ts')