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 <iostream> | |
#include <oauth/oauth.h> | |
#include <sys/socket.h> | |
#include <curl/curl.h> | |
#include <iostream> | |
#include <fstream> | |
#include <vector> |
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 <iostream> | |
#include <soft-ieee754/ieee754.hpp> | |
using namespace std; | |
int main() | |
{ | |
typedef IEEE754<10, 5, 15> fp16; | |
fp16 foo; |
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 <iostream> | |
#include <cassert> | |
#define GLFW_INCLUDE_GL3 | |
#include <GL/glfw.h> | |
#include <lgsl/runtime.hpp> | |
#include <gfx/mat4.h> |
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
struct uniform_info | |
{ | |
std::string name; | |
std::string type; | |
int component_count; | |
bool is_matrix; | |
int array_count; | |
GLint location; | |
pfn_void parameter_setting_function; | |
uniform_info() |
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
//Projection Matrix | |
mat4x4 mP = perspective_matrix(45.0, 1, 0.1, 100); | |
mP = transpose(mP); | |
//Translation | |
mat4x4 mT = mat4x4::translation(float3(0, 0, -14)); | |
//Rotation | |
mat4x4 mR = rotation_matrix_degrees(Rotation, float3(0, 1, 0)); | |
//View matrix | |
mat4x4 mV = lookat_matrix(float3(0.0, 0.0, -3.0), float3(0, 0, -3), float3(0, 1, 0)); | |
mV = transpose(mV); |
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
//Projection Matrix | |
mat4x4 mP = perspective_matrix(45.0, 1, 0.1, 100); | |
//Translation | |
mat4x4 mT = mat4x4::translation(float3(0, 0, -14)); | |
//Rotation | |
mat4x4 mR = rotation_matrix_degrees(Rotation, float3(0, 1, 0)); | |
//View matrix | |
mat4x4 mV = lookat_matrix(float3(0.0, 0.0, -3.0), float3(0, 0, -3), float3(0, 1, 0)); | |
mV = transpose(mV); | |
//WorldViewProjection |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
int main(int argc, const char * argv[]) | |
{ | |
Assimp::Importer importer; | |
unsigned int ppsteps = | |
aiProcess_FindInvalidData | // detect invalid model data, such as invalid normal vectors | |
0; | |
// And have it read the given file with some example postprocessing |
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
class uniform_extractor | |
{ | |
public: | |
std::vector<uniform_info> uniforms; | |
void operator()(const semparse::semantic_graph_node& Node) | |
{ | |
if(is_uniform_node(Node)) | |
{ | |
//Extract info | |
uniform_info Info; |
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
/////// | |
check_al_error(); | |
alGetSourcei(SourceID, AL_BUFFERS_PROCESSED, &SourceBuffersProcessed); | |
alGetSourcei(SourceID, AL_BUFFERS_QUEUED, &SourceBuffersQueued); | |
check_al_error(); | |
// | |
printf("\tfill_and_queue_buffers pre-q - AL_BUFFERS_QUEUED: %d\n", SourceBuffersQueued); | |
printf("\tfill_and_queue_buffers pre-q - AL_BUFFERS_PROCESSED: %d\n", SourceBuffersProcessed); | |
check_al_error(); | |
///////// |
OlderNewer