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
public static void SetDoubleBuffered(System.Windows.Forms.Control c) { | |
if (System.Windows.Forms.SystemInformation.TerminalServerSession) | |
return; | |
System.Reflection.PropertyInfo aProp = | |
typeof(System.Windows.Forms.Control).GetProperty( | |
"DoubleBuffered", | |
System.Reflection.BindingFlags.NonPublic | | |
System.Reflection.BindingFlags.Instance); |
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
/************************************************************************************ | |
* High Resolution Windows Timer | |
* ----------------------------- | |
* code by : bobby anguelov - banguelov@cs.up.ac.za | |
* downloaded from : takinginitiative.wordpress.org | |
* | |
* code is free for use in whatever way you want, however if you work for a game | |
* development firm you are obliged to offer me a job :P (haha i wish) | |
************************************************************************************/ | |
#ifndef HRTIMER |
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 "BackBuffer.h" | |
#pragma comment (lib,"Gdiplus.lib") | |
using namespace Gdiplus; | |
GDIBackBuffer* g_pBackBuffer = 0; | |
void InitGDIBitmap(GDIBitmap& b) { | |
b.path.clear(); | |
b.refCount = 0; | |
b.width = 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
#define Bit(number) (1 << number) | |
#define BitValue(variable, bitmask) (variable & bitmask) | |
#define BitOn(variable, bitmask) (variable |= bitmask) | |
#define BitOff(variable, bitmask) (variable &= ~bitmask) | |
#define BitToggle(variable, bitmask) (variable ^ bitmask) | |
#define PowerOfTwo(integer) (!(integer - 1) & integer) | |
template <typename T> |
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 __gl_h_ | |
#define __gl_h_ | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
/* | |
** License Applicability. Except to the extent portions of this file are | |
** made subject to an alternative license as permitted in the SGI Free |
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 FitMeshInFrustum(float distanceFromCamera) { | |
currentWidth = Screen.width; | |
if (initialSize && (prevWidth == currentWidth)) return; | |
initialSize = true; | |
float scaleX = 1.0f, scaleY = 1.0f; | |
// Find mesh bounds | |
cachedTransform.localScale = Vector3.one; | |
Mesh mesh = GetComponentInChildren<MeshFilter>().mesh; | |
mesh.RecalculateBounds(); |
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 <cmath> | |
#include <vector> | |
#include <map> | |
#include <iostream> | |
#include <OpenGL/gl.h> | |
#include <GLUT/glut.h> | |
#define WINFOW_TITLE "Window Template" | |
#define WINDOW_WIDTH 400 | |
#define WINDOW_HEIGHT 250 |
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 <cmath> | |
#include <vector> | |
#include <map> | |
#include <iostream> | |
#include <OpenGL/gl.h> | |
#include <GLUT/glut.h> | |
#include <sys/time.h> | |
#define WINFOW_TITLE "Window Template" | |
#define WINDOW_WIDTH 800 |
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 <fstream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include "HexChar.h" | |
#include "LodePng.h" | |
/* HexChar | |
std::ostream& operator<<(std::ostream& o, const HexCharStruct& hs) { |
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 System.Windows.Forms; | |
using System.Drawing; | |
// http://zetcode.com/gui/csharpwinforms/introduction/ | |
// http://www.codeproject.com/Articles/9407/Introduction-to-Mono-Your-first-Mono-app | |
// gmcs -r:System.Windows.Forms.dll -r:System.Drawing.dll MonoWindow.cs | |
// macpack -n:MonoWindow -a:MonoWindow.exe | |
public class Program : Form { |