This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "imgui_internal.h" | |
int rotation_start_index; | |
void ImRotateStart() | |
{ | |
rotation_start_index = ImGui::GetWindowDrawList()->VtxBuffer.Size; | |
} | |
ImVec2 ImRotationCenter() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This program is a simple demonstration of the speed difference between standard hashmap from C++ STL library vs. my simple hashmap allocated on the stack. My version is severely limited in for general use, but it is faster and can be run on Arduino devices, whereas there's no STL available for the arduino. | |
//To compile: g++ -std=c++11 StackHash.cpp | |
#include <iostream> | |
#include <unordered_set> | |
#include <ctime> | |
using namespace std; | |
//This default hash assumes T can be converted to int implicitly. | |
//The user can define how to map T to int with template specializations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Globalization; | |
namespace Awesomium.Core | |
{ | |
/// <summary> | |
/// Utility class that allows loading of Awesomium.NET assemblies, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in vec2 v_texcoord; // texture coords | |
in vec3 v_normal; // normal | |
in vec3 v_binormal; // binormal (for TBN basis calc) | |
in vec3 v_pos; // pixel view space position | |
out vec4 color; | |
layout(std140) uniform Transforms | |
{ | |
mat4x4 world_matrix; // object's world position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* License: WTFPL - http://www.wtfpl.net/ | |
* | |
* Usage: element.addEventListener('keydown', inputHistory()); | |
*/ | |
function inputHistory(max_history) { | |
var PREV = 38, NEXT = 40, ENTER = 13, | |
history = [''], current = 0; | |
if (!max_history) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Number.isFinite | |
* Copyright (c) 2014 marlun78 | |
* MIT License, https://gist.github.com/marlun78/bd0800cf5e8053ba9f83 | |
* | |
* Spec: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite | |
*/ | |
if (typeof Number.isFinite !== 'function') { | |
Number.isFinite = function isFinite(value) { | |
// 1. If Type(number) is not Number, return false. |