Skip to content

Instantly share code, notes, and snippets.

View gszauer's full-sized avatar
💻
Living life 16.6 ms at a time

Gabor Szauer gszauer

💻
Living life 16.6 ms at a time
View GitHub Profile
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);
/************************************************************************************
* 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
#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;
#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>
#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
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();
#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
#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
#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) {
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 {