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
# Function for setting up precompiled headers. Usage: | |
# | |
# add_library/executable(target | |
# pchheader.c pchheader.cpp pchheader.h) | |
# | |
# add_precompiled_header(target pchheader.h | |
# [FORCEINCLUDE] | |
# [SOURCE_C pchheader.c] | |
# [SOURCE_CXX pchheader.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
// float->half variants. | |
// by Fabian "ryg" Giesen. | |
// | |
// I hereby place this code in the public domain, as per the terms of the | |
// CC0 license: | |
// | |
// https://creativecommons.org/publicdomain/zero/1.0/ | |
// | |
// float_to_half_full: This is basically the ISPC stdlib code, except | |
// I preserve the sign of NaNs (any good reason not to?) |
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
// float->sRGB8 conversions - two variants. | |
// by Fabian "ryg" Giesen | |
// | |
// I hereby place this code in the public domain. | |
// | |
// Both variants come with absolute error bounds and a reversibility and monotonicity | |
// guarantee (see test driver code below). They should pass D3D10 conformance testing | |
// (not that you can verify this, but still). They are verified against a clean reference | |
// implementation provided below, and the test driver checks all floats exhaustively. | |
// |
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
// Tokenahead.less | |
// --------------- | |
.tokenahead { | |
cursor: text; | |
overflow: hidden; | |
height: auto; | |
padding-bottom: 0; | |
border-color: @inputBorder; | |
} |
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
# Xcode 4.3.3 | |
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn) | |
Target: x86_64-apple-darwin11.4.0 | |
Thread model: posix | |
# Xcode 4.3.2 | |
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) | |
Target: x86_64-apple-darwin11.4.0 | |
Thread model: posix |
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 for non-nullable pointers | |
template<class T> | |
class ptr | |
{ | |
private: | |
T* m_ptr; | |
ptr(nullptr_t); // avoids init with nullptr | |
ptr(int); // avoids init with 0 or NULL | |
public: | |
explicit ptr(T* ptr) throw() : m_ptr(ptr) { assert(ptr != nullptr); }; |
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
#ifndef SSVU_FASTFUNC | |
#define SSVU_FASTFUNC | |
#include <cstring> | |
#include <type_traits> | |
#include <cassert> | |
#include <cstddef> | |
#include <memory> | |
#include <new> | |
#include <utility> |
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
static void check_for_leaks() | |
{ | |
GLuint max_id = 10000; // better idea would be to keep track of assigned names. | |
GLuint id; | |
// if brute force doesn't work, you're not applying it hard enough | |
for ( id = 1 ; id <= max_id ; id++ ) | |
{ | |
#define CHECK( type ) if ( glIs##type( id ) ) fprintf( stderr, "GLX: leaked " #type " handle 0x%x\n", (unsigned int) id ) | |
CHECK( Texture ); |
OlderNewer