View ascii-2d.cpp
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 <string> | |
#include <array> | |
#include <algorithm> | |
#include <functional> | |
using namespace std; | |
// assumes that values returned by data is normalized between 0.0 and 1.0 | |
string get_grayscale_image(int width, int height, function<float(int,int)> data){ | |
const int size = 10; |
View floatingpoint.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
// from https://code.google.com/p/googletest/source/browse/trunk/include/gtest/internal/gtest-internal.h | |
#pragma once | |
#include <ctype.h> | |
#include <float.h> | |
#include <string.h> | |
#include <iomanip> | |
#include <limits> | |
#include <set> |
View ObjFile.cpp
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
// | |
// Created by Morten Nobel-Jørgensen on 06/05/14. | |
// Copyright (c) 2014 Morten Nobel-Joergensen. All rights reserved. | |
// | |
#include "ObjFile.h" | |
#include <fstream> | |
#include <sstream> |
View sdl.cpp
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 <stdio.h> | |
#include <stdlib.h> | |
/* If using gl3.h */ | |
/* Ensure we are using opengl's core profile only */ | |
#define GL3_PROTOTYPES 1 | |
#include <OpenGL/gl3.h> | |
#include <iostream> | |
#include <SDL2/SDL.h> |
View MCSpacePartition.cs
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Simple space partition algorithm which stores two Z planes and swaps between these two planes | |
/// </summary> |
View MarchingCubes.cs
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class TRIANGLE { | |
public Vector3[] p = {Vector3.zero,Vector3.zero,Vector3.zero}; | |
} | |
public class GRIDCELL { | |
public Vector3[] p = {Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero,Vector3.zero}; |
View main.cpp
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://stackoverflow.com/a/21265197/420250 | |
#ifdef __GNUC__ | |
#define DEPRECATED __attribute__((deprecated)) | |
#elif defined(_MSC_VER) | |
#define DEPRECATED __declspec(deprecated) | |
#else | |
#pragma message("WARNING: You need to implement DEPRECATED for this compiler") | |
#define DEPRECATED | |
#endif |
View main.cpp
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
// | |
// Single file OpenGL example | |
// | |
// Created by Morten Nobel-Jørgensen on 06/11/14. | |
// Copyright (c) 2014 morten. All rights reserved. | |
// | |
#include <OpenGL/gl3.h> | |
#include <GLUT/glut.h> | |
#include <string> |
View sdl2-biicode.cpp
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
// Example program: | |
// Using SDL2 to create an application window | |
#include "SDL.h" | |
#include <iostream> | |
#include <ostream> | |
#include "SDL_opengl.h" | |
int main(int argc, char* argv[]) { |
View PerformanceTool.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
// | |
// PerformanceTool.h | |
// | |
// Created by Morten Nobel-Jørgensen on 1/23/13. | |
// Copyright (c) 2013 Morten Nobel-Joergensen. All rights reserved. | |
// | |
// Create simple performance meassures in ms | |
// | |
// Usage: | |
// |
OlderNewer