This file contains hidden or 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
SHADERS | |
When not explicity specifying what texture target to use, OF uses GL_TEXTURE_RECTANGLE_ARB by default. | |
This results in shaders having to use sampler2DRect for the texture type and real texture coordinates. | |
By calling ofDisableArbTex() texture targets are switched to GL_TEXTURE_2D. | |
This results in shaders having to use sampler2D as texture type and Normalized coordinates. |
This file contains hidden or 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
float f = -0.123456; | |
size_t n = sizeof(f); //number of bytes in a float | |
unsigned char buffer[n]; //create buffer of n bytes | |
memcpy(&buffer, &f, n); // copy underlying bytes from float to buffer | |
string str((char *)buffer, n); //instantiate new string with contents of buffer | |
float f2; | |
memcpy(&f2, str.data(), n); //copy bytes from string data prop to f2 | |
printf("%f\n", f2); // prints -0.123456 |
This file contains hidden or 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
(function ($) | |
{ | |
var superBind = $.fn.bind; | |
var superUnbind = $.fn.unbind; | |
var touchHandlersKey = "clicktouchHandlers"; | |
// override bind | |
$.fn.bind = function () | |
{ | |
var $window = $(window); |
This file contains hidden or 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
var tree = function(map) | |
{ | |
var treeStructure = {}; | |
var names; | |
var name; | |
var i; | |
var numNames; | |
var currentObject = treeStructure; | |
var lastIndex; |