This file contains 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
const int TICKS_PER_SECOND = 25; | |
const int MS_PER_TICK = 1000 / TICKS_PER_SECOND; | |
const int MAX_SKIPPED_FRAMES = 5; | |
void EngineInstance::run() { | |
this->last_tick_time = getTime() - TICKS_PER_SECOND; | |
while (this->shouldKeepRunning()) { | |
this->checkForUpdate(); |
This file contains 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
//Based on http://www.geeksforgeeks.org/manachers-algorithm-linear-time-longest-palindromic-substring-part-4/ | |
// A C program to implement Manacher’s Algorithm | |
#include <stdio.h> | |
#include <string.h> | |
char text[100]; | |
int min(int a, int b) | |
{ | |
int res = a; | |
if (b < a) |
This file contains 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
typedef struct{ | |
ALuint ID; | |
stb_vorbis* stream; | |
stb_vorbis_info info; | |
ALuint buffers[2]; | |
ALuint source; | |
ALenum format; |
This file contains 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
#version 330 core | |
#extension GL_ARB_shading_language_420pack: require | |
#extension GL_ARB_separate_shader_objects: require | |
#extension GL_ARB_shader_image_load_store: require | |
#extension GL_ARB_bindless_texture: require | |
#define ENABLE_BINDLESS_TEX | |
#define FRAGMENT_SHADER 1 | |
#define ps_main main | |
#define PS_FST 0 | |
#define PS_WMS 0 |
This file contains 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
/* | |
TreeGen for 3DSMax written by Ryan James Smith aka "Virtuosic" on polycount forums. | |
This is creative commons, edit and redistribute as you please, just remember to give original credit | |
also, if you add some cool stuff, email me at [email protected] and let me know what you did so | |
i can be jealous i didn't think of it... Oh, and if you add something cool, sign your name below mine :D | |
*/ |
This file contains 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 <immintrin.h> | |
#include <intrin.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
union Mat44 { | |
float m[4][4]; | |
__m128 row[4]; | |
}; |
This file contains 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
http://www.gamedev.net/topic/622047-early-z/ |
This file contains 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
in vec2 v_texcoord; // texture coords | |
in vec3 v_normal; // normal | |
in vec3 v_binormal; // binormal (for TBN basis calc) | |
in vec3 v_pos; // pixel view space position | |
out vec4 color; | |
layout(std140) uniform Transforms | |
{ | |
mat4x4 world_matrix; // object's world position |
This file contains 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 <GL/glew.h> | |
#include <GLFW/glfw3.h> | |
#include <vector> | |
#include <cmath> | |
#include <cstdio> | |
#include <limits> | |
#include <chrono> | |
#include <thread> | |
#include <mutex> |
This file contains 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 GL_ES | |
precision mediump float; | |
#endif | |
#extension GL_EXT_gpu_shader4 : enable | |
uniform sampler2D u_texture; | |
uniform vec2 g_Resolution; | |
varying vec2 v_texCoords; |
OlderNewer