Skip to content

Instantly share code, notes, and snippets.

View MSylvia's full-sized avatar
💭
Compiling ....

Matt Sylvia MSylvia

💭
Compiling ....
View GitHub Profile
@samfromcadott
samfromcadott / raylib-bullet.cc
Created June 11, 2023 16:10
Example of using Bullet Physics with raylib
// raylib+Bullet physics
// Sam Jackson
// Partially based off this: https://github.com/bulletphysics/bullet3/blob/master/examples/HelloWorld/HelloWorld.cpp
#include <vector>
#include <btBulletDynamicsCommon.h>
#include <raylib.h>
btDefaultCollisionConfiguration* collision_configuration;
@JettMonstersGoBoom
JettMonstersGoBoom / textures_bpplimit_dither
Last active March 23, 2023 01:27
triangle rasterizer with psx style dither and bpp per gun.
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <math.h>
#include "tigr.h"
#include "vec2.h"
// extension of this code
// https://github.com/gustavopezzi/triangle-rasterizer-float
@kageurufu
kageurufu / 20220210ChiTu L Jupiter english.gcode
Created July 23, 2022 20:44
Elegoo Jupiter stock config
; remove all parameters
M8513
; [[The text after the semicolon is a comment, please modify the corresponding parameters according to the description of the comment, the command after the semicolon will be ignored]]
; The basic format is Mxxx Ixxx, Mxxx Txxx or Mxxx Sxxx, where Ixx (is the letter I, the first letter of integer, not the number 1) followed by an integer, which can be decimal or hexadecimal (starting with 0x) , Pxx, Sxx are followed by floating point numbers
; [Direction control of stepper motor] The directions of I1 and I-1 are just opposite, so if the direction of the motor is wrong, either change the wiring or change this direction parameter
; Z stepper motor direction
M8004 I1
import os
import sys
"""
This (pure!) python script streams a gzip-compressed YUV4MPEG video to stdout.
It easily runs at 1080p60fps on my machine.
Pipe it into a media player like this:
python3 gzip_swar_life.py | mbuffer | gunzip - | mpv -
@ggorlen
ggorlen / index.c
Created May 8, 2022 23:38
sdl2 + emscripten
// emcc -s USE_SDL=2 index.c -o index.html
// For images, see https://lyceum-allotments.github.io/2016/06/emscripten-and-sdl2-tutorial-part-4-look-owl/
// See also https://github.com/paked/sdl2-cmake-emscripten/blob/master/src/main.cpp
#include <emscripten.h>
#include <SDL2/SDL.h>
SDL_Surface *screen;
SDL_Window *window;
SDL_Renderer *renderer;
@DGriffin91
DGriffin91 / bevy_texture_to_png.rs
Last active January 5, 2024 20:12
Bevy Texture to PNG
// License: Apache-2.0 / MIT
use bevy::core_pipeline::{
draw_3d_graph, node, AlphaMask3d, Opaque3d, RenderTargetClearColors, Transparent3d,
};
use bevy::prelude::*;
use bevy::reflect::TypeUuid;
use bevy::render::camera::{ActiveCamera, CameraTypePlugin, RenderTarget};
use bevy::render::render_asset::RenderAssets;
use bevy::render::render_graph::{NodeRunError, RenderGraph, RenderGraphContext, SlotValue};
@inc0der
inc0der / basic_fps_controller.gd
Last active October 12, 2022 05:34
Basic FPS Controller for Godot 4
# For Godot 4 Alpha 2
# The head node should contain the camera, flashlight and other things that require a pivot/rotation
class_name BasicFpsController
extends CharacterBody3D
@export var MOVE_SPEED := 4.0
@export var JUMP_FORCE := 4.5
@export var SPRINT_SPEED := 6.0
@flaviut
flaviut / Setting up Emporia Vue 2 with ESPHome.md
Last active June 6, 2024 06:00
Setting up Emporia Vue 2 with ESPHome

FLIPS_choose_game

Game Porting Adventures

This article details my adventures and disadventures while porting my +9 years old XNA games, originally developed for Windows Phone, to multiple other frameworks (SharpDX, PSM, MonoGame...), for PSVita, Android and Desktop (Windows, Linux, macOS) platforms.

The article is divided in 3 parts:

@trikko
trikko / raylib-video.c
Last active November 5, 2023 00:34
How to render a video with raylib and gstreamer
#include "raylib.h"
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
GstElement* createPipeline(const char* filename)
{
GError *error;
gchar *pipelineString = g_strdup_printf ("filesrc location=%s ! tee name=t ! queue ! decodebin ! videoconvert ! appsink name=output caps=video/x-raw,format=RGBA,pixel-aspect-ratio=1/1 t. ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink", filename);
GstElement *pipeline = gst_parse_launch (pipelineString, &error);