Skip to content

Instantly share code, notes, and snippets.

@marcclintdion
marcclintdion / rAF.js
Created November 3, 2023 20:50 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@marcclintdion
marcclintdion / main.cpp
Created March 6, 2018 21:33 — forked from mosra/main.cpp
First Triangle in Vulkan
#include <Corrade/Utility/Assert.h>
#include <Corrade/PluginManager/Manager.h>
#include <Magnum/Magnum.h>
#include <Magnum/ImageView.h>
#include <Magnum/PixelFormat.h>
#include <Magnum/Math/Color.h>
#include <Magnum/Trade/AbstractImageConverter.h>
#include <MagnumExternal/Vulkan/flextVk.h>
#include "spirv.h"
@marcclintdion
marcclintdion / ImageFadeIn.cs
Created February 27, 2018 07:55 — forked from miguelSantirso/ImageFadeIn.cs
Erosion fade in shader used in "La Última Flor de Lazlar"
using UnityEngine;
using UnityEngine.UI;
// Set _ScaleAndOffset in the shader so that our math works as expected with textures in atlases :)
[ExecuteInEditMode]
public class ImageFadeIn : MonoBehaviour
{
[SerializeField]
private Image target;
@marcclintdion
marcclintdion / EditorGUILayoutExtensions.cs
Created November 14, 2017 11:47 — forked from yagero/EditorGUILayoutExtensions.cs
EditorGUILayout Fields which properly handles multi-object editing
using System;
using UnityEngine;
using UnityEditor;
public static class EditorGUILayoutExtensions
{
/// <summary>
/// Add a EditorGUILayout.ToggleLeft which properly handles multi-object editing
/// </summary>
public static void ToggleLeft(this SerializedProperty prop, GUIContent label, params GUILayoutOption[] options)