Skip to content

Instantly share code, notes, and snippets.

@PDeveloper
PDeveloper / Main.hx
Last active December 17, 2015 00:39
Null reference error when using DYNAMIC_AABB_TREE after bodies fall asleep: Compile + Run project Wait for all bodies to fall asleep Press space IT WREAKS HAVOC! :S
package ;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.Lib;
import nape.geom.Vec2;
import nape.phys.Body;
import nape.phys.BodyType;
import nape.shape.Polygon;
import nape.space.Broadphase;
@PDeveloper
PDeveloper / gist:7813754
Created December 5, 2013 20:57
Setup with assets that come with the Demo sample. On Neko and Cpp, button rollover button states don't work!
package ;
import flash.display.Sprite;
import flash.events.Event;
import flash.Lib;
import ru.stablex.ui.UIBuilder;
import ru.stablex.ui.widgets.Button;
import ru.stablex.ui.widgets.Floating;
/**
-abstracts do not have the underlying type generated:
source:
@:enum abstract ClampType(Int) from Int to Int {}
generated:
@:enum abstract ClampType {}
-generates individual file per definition rather than module:
source path structure:
import org.Types.MyType;
@PDeveloper
PDeveloper / glTypeToString.cpp
Created May 1, 2018 17:04
GLenum GLSL type to std::string
std::string glTypeToString(GLenum type)
{
switch (type)
{
case GL_FLOAT: return "GL_FLOAT";
case GL_FLOAT_VEC2: return "GL_FLOAT_VEC2";
case GL_FLOAT_VEC3: return "GL_FLOAT_VEC3";
case GL_FLOAT_VEC4: return "GL_FLOAT_VEC4";
case GL_FLOAT_MAT2: return "GL_FLOAT_MAT2";
case GL_FLOAT_MAT3: return "GL_FLOAT_MAT3";