Skip to content

Instantly share code, notes, and snippets.

View paulevans's full-sized avatar

Paul Evans paulevans

View GitHub Profile
@jonnyhopper
jonnyhopper / quadratic_bezier.cpp
Created May 30, 2017 20:00
How to make a quadratic bezier curve in like 4 lines, less if you put it all on one line and don't write the comments
// Assuming you have a 2d or 3d point datatype
// and a value t in 0..1, which is your point on the curve
point bezier_points[3] = { ... };
point q0 = lerp( t, bezier_points[0], bezier_points[1] );
point q1 = lerp( t, bezier_points[1], bezier_points[2] );
point b = lerp( t, q0, q1 );

Where you able to produce a binary directly from the Rust build tools that you could submit to the app/play store?


Not quite, but I tried to get as close to that as was reasonably possible. Alas, things ended up a little convoluted.

For iOS, I have a nearly empty Xcode project with a build script that copies my cargo produced executable into the .app that Xcode generates (before Xcode signs it). The build script also uses lipo to merge the executables for each architecture I’m targeting (e.g. armv7 and aarch64 for non-simulator devices) into a single, universal binary.

On top of that, there are various iOS-y things that need to happen before my application’s main method is called. SDL2 provides the Objective-C code that does all of that. In a C or C++ game, SDL2 renames main to SDL_main, and then [inserts its own mai

@jhaberstro
jhaberstro / gpu_arch_resources
Last active December 10, 2024 11:12
GPU Architecture Learning Resources
http://courses.cms.caltech.edu/cs179/
http://www.amd.com/Documents/GCN_Architecture_whitepaper.pdf
https://community.arm.com/graphics/b/blog
http://cdn.imgtec.com/sdk-documentation/PowerVR+Hardware.Architecture+Overview+for+Developers.pdf
http://cdn.imgtec.com/sdk-documentation/PowerVR+Series5.Architecture+Guide+for+Developers.pdf
https://www.imgtec.com/blog/a-look-at-the-powervr-graphics-architecture-tile-based-rendering/
https://www.imgtec.com/blog/the-dr-in-tbdr-deferred-rendering-in-rogue/
http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/opencl-optimization-guide/#50401334_pgfId-412605
https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/
https://community.arm.com/graphics/b/documents/posts/moving-mobile-graphics#siggraph2015
@lmeadows
lmeadows / .vimrc
Created February 12, 2017 22:59
my vimrc
set expandtab
set tabstop=4
set shiftwidth=4
set smarttab
set autoindent
set ruler
syntax on
autocmd BufNewFile,BufRead Gemfile,*.pp set filetype=ruby
autocmd BufNewFile,BufRead *.erb set filetype=eruby.html
@leonardo-m
leonardo-m / gist:6e9315a57fe9caa893472c2935e9d589
Last active October 13, 2024 14:40
A selection of 101 LINQ Samples converted to Rust
// Port of the C# 101 LINQ Samples rewritten into Apple's Swift 3.
#![feature(ordering_chaining, step_by)]
fn main() {
// linq5: Where - Indexed
/*
//c#
public void Linq5()
{
@kondrak
kondrak / soumik.md
Last active December 6, 2016 13:10
Anwsering some engine questions

Animation in particular is something I would like to know in detail. I checked out a book and I feel like there's a lot of groundwork I need to familiarize myself with before getting there (lot of math).

Animation and graphics is where math is KEY. Matrix and vector arithmetics must become your friends, same with trigonometry, linear algebra and quaternions. More advanced features in gfx/physics will require you to dive into new math areas but this is something you'll soon discover once you start research on a given topic.

At what point do you call the application an 'engine', as in what exactly are the bare essentials. Is that when you have a way to define game objects, have some physics system set up, and can have scripts running?

@kbariotis
kbariotis / main.yaml
Last active August 5, 2024 08:31
Ansible playbook for deploying a Node.js app to DigitalOcean
- name: DO
hosts: localhost
vars:
project_name: "PUT A NAME FOR YOUR PROJECT HERE"
do_token: "PUT YOUR DIGITAL OCEAN API KEY HERE ==> https://cloud.digitalocean.com/settings/api/tokens"
repository: "PUT YOUR REPOSITORY URL HERE"
tasks:
- name: LOCAL | Generate SSH key
shell: ssh-keygen -b 2048 -t rsa -f ~/.ssh/{{project_name}} -q -N ""
/**
* Author: David Asmuth
* Contact: [email protected]
* License: Public domain
*
* Converts the .fbx model
* from Blender orientation system (Z is up, Y is forward)
* to the Unity3D orientation system (Y is up, Z is forward)
*/
using System.IO;
@dwilliamson
dwilliamson / Doc.md
Last active April 23, 2023 14:17
Minimal Code Generation for STL-like Containers

This is my little Christmas-break experiment trying to (among other things) reduce the amount of generated code for containers.

THIS CODE WILL CONTAIN BUGS AND IS ONLY PRESENTED AS AN EXAMPLE.

The C++ STL is still an undesirable library for many reasons I have extolled in the past. But it's also a good library. Demons lie in this here debate and I have no interest in revisiting it right now.

The goals that I have achieved with this approach are:

@bluekvirus
bluekvirus / manjaro-mbp-early2011.md
Last active November 9, 2022 20:36
Manjaro (Arch Linux) on MacBook Pro (early 2011) post install notes