Skip to content

Instantly share code, notes, and snippets.

// CFLAGS=`wx-config --cflags`
// LDFLAGS=`wx-config --libs gl`
#ifndef _FRAME_H
#define _FRAME_H
#include <wx/wx.h>
#include <wx/glcanvas.h>
#ifdef _MSC_VER
#pragma comment(lib, "opengl32.lib")
#endif
// g++ main.cpp -lGL -lGLU -lglut
#include <cmath>
#include <iostream>
#include <GL/glut.h>
#include <boost/shared_ptr.hpp>
//------------------------------------------------------------//
// vector, quaternion
//------------------------------------------------------------//
struct Quaternion;
@ousttrue
ousttrue / wxAui_sample.cpp
Created April 6, 2009 12:39
wxAui event sample
#include <wx/wx.h>
#include <wx/aui/aui.h>
#include <map>
class CursorView: public wxPanel
{
wxTextCtrl *x_;
wxTextCtrl *y_;
public:
// g++ `pkg-config cairo-ft --cflags --libs` -lglut main.cpp
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#ifdef _MSC_VER
#include <windows.h>
#include <cairo.h>
#pragma comment(lib, "cairo.lib")
@ousttrue
ousttrue / gist:282897
Created January 21, 2010 15:50
c++ dds loader
#include <iostream>
#include <fstream>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/static_assert.hpp>
///////////////////////////////////////////////////////////////////////////////
// RGBA
///////////////////////////////////////////////////////////////////////////////
struct RGBA
@ousttrue
ousttrue / irrlicht_tps_camera.cpp
Created March 1, 2010 19:38
irrlicht tps camera & joy pad test.
#include <irrlicht.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <cassert>
#define MEDIA_PATH "E:/vc/irrlicht-1.7.1/media/"
using namespace irr;
package mqo
import java.io.File
import scala.io.Source
import scala.collection.mutable.ArrayBuffer
class Vector2(val x :Float, val y :Float)
object Vector2 {
def apply(x :Float, y :Float) :Vector2=new Vector2(x, y)
def apply(
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.BufferedInputStream;
import java.io.IOException;
import javax.imageio.ImageIO;
import java.awt.image.Raster;
import java.awt.image.DataBufferByte;
public class TargaReader
@ousttrue
ousttrue / w32window.py
Created December 27, 2011 18:32
ctypes SetWindowLongPtr/GetWindowLongPtr sample
#!/usr/bin/env python
# coding: utf-8
import win32con
from ctypes import *
##############################################################################
# Windows types
##############################################################################
def ErrorIfZero(handle):
@ousttrue
ousttrue / mpd-0.16.tag_id3.patch
Created November 29, 2012 22:35
id3v2 character encoding patch for mpd
--- src/tag_id3.c.orig 2012-11-28 09:27:00.009431866 +0900
+++ src/tag_id3.c 2012-11-28 10:16:23.205446028 +0900
@@ -78,38 +78,72 @@
}
/* This will try to convert a string to utf-8,
- */
+*/
static id3_utf8_t *
-import_id3_string(bool is_id3v1, const id3_ucs4_t *ucs4)