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
#ifndef TYPES_H | |
#define TYPES_H | |
#include <stdint.h> | |
typedef uint32_t uint; | |
typedef uint8_t bool; | |
#define true 1 | |
#define false 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
#include <string> | |
#include <fstream> | |
#include <sstream> | |
#include "core/tgEngine.h" | |
#include "core/tgLog.h" | |
#include "core/tgInput.h" | |
#include "graphics/tgSpriteBatch.h" |
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 mouse.events[events.LEFTMOUSE] == 1: | |
hit = P.mOver.hitObject | |
if hit is not None: | |
mesh = hit.meshes[0] | |
for v in range(mesh.getVertexArrayLength()): | |
vert = mesh.getVertex(0, v) | |
uv = vert.getUV() | |
uv[0] += 0.5 | |
vert.setUV(uv) |
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
from bge import types, render, logic | |
class CustomTechnique(types.KX_RenderTechnique): | |
def __init__(self): | |
super(CustomTechnique, self).__init__() | |
self.normals_shader = types.BL_Shader(...) | |
def apply(self): | |
# render all the meshes with a specific shader |
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
import org.lwjgl.BufferUtils; | |
import java.nio.FloatBuffer; | |
import static org.lwjgl.opengl.GL11.*; | |
public class Mat4 { | |
public static final Mat4 IDENTITY = new Mat4().identity(); | |
private float[][] m; |
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
class Game : public GameWindow { | |
public: | |
Game() | |
: GameWindow(640, 480, "Test Game") | |
{ | |
} | |
void OnLoad() override { | |
GetCurrentScene()->GetSpriteBatch()->SetAmbientColor(Color(0.01f, 0.02f, 0.07f)); |
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
/* | |
* The MIT License | |
* | |
* Copyright 2016 twisterge. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
void SpriteBatch::Render() { | |
glBindVertexArray(m_vao); | |
/// 1. Draw normal maps to the buffer | |
glEnable(GL_DEPTH_TEST); | |
m_gbuffer->Bind(); | |
glDepthFunc(GL_LESS); | |
glDepthMask(true); | |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
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
/* | |
* File: Collections.h | |
* Author: twisterge | |
* | |
* Created on December 5, 2016, 11:50 PM | |
*/ | |
#ifndef COLLECTIONS_H | |
#define COLLECTIONS_H |
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
/* | |
* The MIT License | |
* | |
* Copyright 2016 twisterge. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |