- Use as much existing functionality as possible for implementation
- No new APIs, no new language bindings
- Use Clang for state-of-the-art C++11 support and diagnostics
- Keep It Simple, Stupid
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
/home/mosra/Code/magnum/src/DebugTools/Implementation/CapsuleRendererTransformat | |
ion.h:62: error: could not convert ‘{{Magnum::Math::Matrix3< <template-parameter | |
-1-1> >::translation [with T = float](((const Magnum::Math::Vector2<float>&)((co | |
nst Magnum::Math::Vector2<float>*)(&((const Magnum::Vector2*)a)->Magnum::Math::V | |
ector2< <template-parameter-1-1> >::operator+ [with T = float](((const Magnum::M | |
ath::Vector<2ul, float>&)((const Magnum::Math::Vector<2ul, float>*)(& capDistanc | |
e.Magnum::Math::Vector2<float>::<anonymous>)))))))).Magnum::Math::Matrix3< <temp | |
late-parameter-1-1> >::operator* [with T = float](((const Magnum::Math::Matrix<3 | |
ul, float>&)(& rotationScaling.Magnum::Math::Matrix3<float>::<anonymous>))), Mag | |
num::Math::Matrix3< <template-parameter-1-1> >::translation [with T = float](((c |
Inspired by http://madebyevan.com/obscure-cpp-features/. Compile and run using g++
or clang++
.
$ g++ -std=c++11 -Wall -pedantic -Wextra wat.cpp
$ ./a.out
hello! I'm called ./a.out and 5 + 3 is 8
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
void RigidBodyGroup::physicsStep(GLfloat timeDelta) { | |
for(RigidBody* body: bodies) { | |
/* Compute force at current position */ | |
body->force = _gravity; | |
body->physicsStep(); | |
GLfloat accelerationHalfTimeDelta = (body->force/(body->_mass*2))*timeDelta; | |
/* New position */ | |
body->transformation()[3].setXyz(body->transformation()[3].xyz() + (body->velocity + accelerationHalfTimeDelta)*timeDelta); |
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 | |
uniform mat4 transformationMatrix; | |
uniform mat4 projectionMatrix; | |
out vec2 texCoord; | |
const vec2 data[4] = vec2[]( | |
vec2(-1.0, 1.0), | |
vec2(-1.0, -1.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
queue<unsigned int> cache; | |
unordered_set<unsigned int> map; | |
size_t misses = 0; | |
size_t maxSize = 24; | |
for(unsigned int index: builder.indices()) { | |
if(map.find(index) != map.end()) continue; | |
/* Not in cache */ | |
++misses; |
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
#ifndef BigFoot_Big_h | |
#define BigFoot_Big_h | |
#include <string> | |
#include <algorithm> | |
#include "TypeTraits.h" | |
#include "BigPrivate.h" | |
/** @brief BigFoot, aribitrary length integer library */ |
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 "Bourne.h" | |
#define forever for(;;) | |
using namespace std; | |
namespace Bourne { | |
void AbstractValue::ignorespace(istream& in) { | |
while(isspace(in.peek())) |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<!-- kate: indent-width 1 --> | |
<!-- | |
State: | |
<!DOCTYPE html> | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
- FF, Webkit, Opera: OK | |
- IE8, IE9: takes height: 100% as 100% viewport height, thus enabling | |
unnecessary scrollbar. | |
(no doctype) |
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
<html> | |
<body> | |
<style> | |
.scrollable { | |
height: 100%; | |
overflow: auto; | |
} | |
html, body { | |
min-height: 100%; | |
margin: 0px; |