Skip to content

Instantly share code, notes, and snippets.

View fkaa's full-sized avatar

Felix Nemo Kaaman fkaa

  • 18:40 (UTC +11:00)
View GitHub Profile
void Game::render() {
GLenum buffers[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 };
glViewport(0, 0, w, h);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glDrawBuffers(2, buffers);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, t_col, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, t_norm, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, t_depth, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
#pragma mark -
#pragma mark Default shader
/***
* ____ _ _
* / ___|| |__ __ _ __| | ___ _ __
* \___ \| '_ \ / _` |/ _` |/ _ \ '__|
* ___) | | | | (_| | (_| | __/ |
* |____/|_| |_|\__,_|\__,_|\___|_|
*
*/
for (int x = 0; x < CX; x++) {
for (int y = 0; y < CY; y++) {
for (int z = 0; z < CZ; z++) {
if (!contents[x][y][z]) continue;
uint8_t type = contents[x][y][z];
// -x
if (!get(x - 1, y, z)) {
vertices[i++] = vec3b(x, y, z ); vertices[i++] = vec3b(x - 1, y, z);
vertices[i++] = vec3b(x, y, z + 1); vertices[i++] = vec3b(x - 1, y, z);
// header
private:
Chunk* chunks[SCX][SCY][SCZ];
//
// ctor
#ifndef __SHTEST_BATCH_H__
#define __SHTEST_BATCH_H__
#include <stdarg.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "glutil.h"
class SpriteBatch {
public:
RAW USER user irc.esper.net bla :Blabla
RAW NICK Blabla
RAW JOIN #foobar
:aperture.esper.net NOTICE * :*** Looking up your hostname...
:aperture.esper.net NOTICE * :*** Checking Ident
:aperture.esper.net NOTICE * :*** Found your hostname
:aperture.esper.net NOTICE * :*** No Ident response
495 virtualenv treeoflife; cd treeoflife; git clone https://github.com/lahwran/tree-of-life. tree-of-life; source ../bin/activate; python setup.py develop; open .; python cocoa.py
496 source bin/activate; python setup.py develop; open .; python cocoa.py
497 source bin/activate
498 git clone https://github.com/lahwran/tree-of-life tree-of-life;
499 source bin/activate; python setup.py develop; open .; python cocoa.py
500 source bin/activate; python setup.py develop; open .; python cocoa.py
501 history | tail -n 50 | curl -F 'sprunge=<-' http://sprunge.us
/*@strictfp*/def init() {
var f: Float = 0f
for (i <- 0 until 10000) {
f += 0.1f
}
println(10000 * 0.1f)
println(f)
}
package ee.tmtu.shototsu
class Pointer[T](value: T) {
private[this] val _arr = new Array[T](1)
def apply(): T = _arr(0)
def update(value: T): Unit = _arr(0) = value
}
object Font {
val left: String = "left"
val right: String = "right"
val center: String = "center"
val colors: mutable.HashMap[String, Color] = mutable.HashMap[String, Color](
"白" -> Color.WHITE, // Shiro
"黒" -> Color.BLACK, // Kuro
"赤" -> Color.RED, // Aka
"青" -> Color.BLUE, // Ao
"緑" -> Color.GREEN // Midori