Skip to content

Instantly share code, notes, and snippets.

View joelpryde's full-sized avatar

Joel Pryde joelpryde

View GitHub Profile
#if SYSTEM_SOURCEGEN_ENABLED
using System.Linq;
using Mono.Cecil;
using Unity.Entities;
using Unity.Entities.CodeGen;
class Cloner : EntitiesILPostProcessor
{
protected override bool PostProcessImpl(TypeDefinition[] componentSystemTypes)
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
using Unity.Collections.LowLevel.Unsafe;
using System.Runtime.CompilerServices;
using Unity.Collections;
[CompilerGeneratedAttribute]
// IJobEntity also allows users to define a reactive job that will handle much of the management of system state for them.
// The interface has no abstract (or other) methods but it is assumed that users will define a set of common methods
// that will handle changes to state when they are detected (the methods will only get called when precise changes occurr).
//
// The methods are as follows:
// - OnAdd(out TState stateType, in TInputType inputType1, ...) - Called when all inputTypes are present, adds stateType
// before method is called from job.
// - OnChange(ref TState stateType, in TInputType inputType1, ...) - Called when any inputType has changed and stateType is
// present, allows user to update stateType based on inputs.
// - (Optional) OnRemove(ref TState stateType) - Called when only stateType exists but the inputTypes no longer do. This will
@joelpryde
joelpryde / gist:f0645fe1c9d757e5f211
Created December 23, 2015 04:03
Fix to Cinder parseDds
#if ! defined( CINDER_GL_ES ) || defined( CINDER_GL_ANGLE )
void parseDds( const DataSourceRef &dataSource, TextureData *resultData )
{
typedef struct { // DDCOLORKEY
uint32_t dw1;
uint32_t dw2;
} ddColorKey;
typedef struct { // DDSCAPS2
uint32_t dwCaps1;
@joelpryde
joelpryde / fadecandy.cs
Created May 21, 2014 19:33
FadeCandy IO C#
#region usings
using System;
using System.ComponentModel.Composition;
using VVVV.PluginInterfaces.V1;
using VVVV.PluginInterfaces.V2;
using VVVV.Utils.VColor;
using VVVV.Utils.VMath;
using VVVV.Core.Logging;
@joelpryde
joelpryde / GLee.c
Created April 23, 2014 20:32
GLee.c for Cinder with GLee 5.5
This file has been truncated, but you can view the full file.
/***************************************************************************
*
* GLee.c
* GLee (OpenGL Easy Extension library)
* Version : 5.5
*
* Copyright (c)2011 Ben Woodhouse All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@joelpryde
joelpryde / GLee.h
Created April 23, 2014 20:31
GLee.h for Cinder with GLee 5.5
This file has been truncated, but you can view the full file.
/***************************************************************************
*
* GLee.h
* GLee (OpenGL Easy Extension library)
* Version : 5.5
*
* Copyright (c)2011 Ben Woodhouse All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@joelpryde
joelpryde / Quicktime.cpp
Created November 13, 2013 22:27
Changes to allow Cinder to do multi-channel QT audio
+void MovieBase::setAudioDevice(const std::string& audioDeviceName, float audioBalance)
+{
+ // create a QT Audio Context and set it on a Movie
+ ::QTAudioContextRef audioContext;
+ ::CFStringRef deviceId = ::CFStringCreateWithCString( kCFAllocatorDefault, audioDeviceName.c_str(), kCFStringEncodingUTF8 );
+ OSStatus status = ::QTAudioContextCreateForAudioDevice(kCFAllocatorDefault, deviceId, NULL, &audioContext);
+ if (status)
+ throw QuickTimePathInvalidExc();
+
@joelpryde
joelpryde / flames.glsl
Created October 16, 2013 16:22
glsl good flames (screen space)
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
vec3 iResolution = vec3(resolution.x,resolution.y,100.);
vec4 iMouse = vec4(mouse.x,mouse.y,5.,5.);
@joelpryde
joelpryde / gist:5224151
Created March 22, 2013 19:42
GLSL clouds
/**
* @title Cloud Demo
* @version v0.3
* @author Mark Sleith
* @website www.cngames.co.uk/portfolio
* @date 15/08/2012
*
* @note Noise and fBm from iq's latest live coding video, "a simple eye ball".
*
* @todo Add varying cloud density, cloud illumination.