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
<?xml version="1.0" encoding="UTF-8"?> | |
<assets> | |
<texture id="sheet_1" ref="test.png" /> | |
<sprite id="testsprite" ref="sheet_1" clipx="0" clipy="0" clipw="10" cliph="10" /> | |
</assets> |
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
#include "stoff.h" | |
//expands into 'class stoff;' | |
//without the include guard (#ifndef), the following: | |
#include "stoff.h" | |
#include "stoff.h" | |
#include "stoff.h" | |
//would expand into: | |
class stoff; |
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
// original | |
output.normalDir = normalize(float3(mul(float4(input.normal, 0.0), modelMatrixInverse))); | |
// v1 | |
float4 a = float4(input.normal, 0.0); | |
float3 b = float3(mul(a, modelMatrixInverse)); | |
float3 n = normalize(a); | |
output.normalDir = n; |
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
local anim8 = require 'lib/anim8' | |
Entity = { | |
x = 0, y = 0, | |
w = 0, h = 0, | |
vx = 0, vy = 0, | |
drawable = nil | |
} | |
local EntityMT = {__index = Entity} |
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
Entity = { | |
x = 0, y = 0, | |
w = 0, h = 0, | |
vx = 0, vy = 0, | |
drawable = nil | |
} | |
function Entity:new(o) | |
local o = o or {} | |
setmetatable(o, self) |
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
/Applications/Microsoft Office 2011/ tmtu$ ls | |
Additional Tools/ | |
Icon?* | |
Microsoft Document Connection.app/ | |
Microsoft Excel.app/ | |
Microsoft Outlook.app/ | |
Microsoft PowerPoint.app/ | |
Microsoft Word.app/ | |
Office/ | |
Read Me.html |
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
#ifdef __APPLE__ | |
CGLContextObj kCGLContext = CGLGetCurrentContext(); | |
CGLShareGroupObj kCGLShareGroup = CGLGetShareGroup(kCGLContext); | |
cl_context_properties prop[] = { | |
CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE, (cl_context_properties)kCGLShareGroup, | |
CL_CONTEXT_PLATFORM, (cl_context_properties)platform, | |
0 | |
}; | |
#elif __WIN32 |
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
GLuint Program::load_shader(const char* path, GLenum type) { | |
std::vector<char> data; | |
if (FILE* fp = fopen(path, "r")) { | |
char buf[1024]; | |
while (size_t len = fread(buf, 1, sizeof(buf), fp)) { | |
data.insert(data.end(), buf, buf + len); | |
} | |
fclose(fp); | |
} | |
const char* src = &data[0]; |
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
if (velocity.x > 0) { | |
velocity.x -= fminf(velocity.x, kFriction); | |
} else { | |
velocity.x += fminf(fabs(velocity.x), kFriction); | |
} |
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
#include "graphics/fbo.h" | |
Framebuffer::Framebuffer(int width, int height) : width(width), height(height) { | |
glGenTextures(1, &col_id); | |
resize(width, height); | |
glGenFramebuffers(1, &id); | |
if (!id) { | |
Log::e("Failed to create framebuffer."); | |
} |