Skip to content

Instantly share code, notes, and snippets.

View fkaa's full-sized avatar

Felix Nemo Kaaman fkaa

  • 18:16 (UTC +11:00)
View GitHub Profile
<?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>
@fkaa
fkaa / other.h
Created September 25, 2014 16:52
#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;
// 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;
local anim8 = require 'lib/anim8'
Entity = {
x = 0, y = 0,
w = 0, h = 0,
vx = 0, vy = 0,
drawable = nil
}
local EntityMT = {__index = Entity}
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)
/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
#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
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];
if (velocity.x > 0) {
velocity.x -= fminf(velocity.x, kFriction);
} else {
velocity.x += fminf(fabs(velocity.x), kFriction);
}
#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.");
}