Skip to content

Instantly share code, notes, and snippets.

void DisplayWindowsError()
{
LPVOID lpMsgBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
@LordTocs
LordTocs / OriginalContextCreation.cpp
Last active August 29, 2015 14:03
Original Context Creation
GraphicsContext::GraphicsContext(ContextTarget &target)
: Target (target)
{
PIXELFORMATDESCRIPTOR pfd= // pfd Tells Windows How We Want Things To Be
{
sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
1, // Version Number
PFD_DRAW_TO_WINDOW | // Format Must Support Window
PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
PFD_DOUBLEBUFFER, // Must Support Double Buffering
@LordTocs
LordTocs / MeshBuilder
Created September 5, 2013 04:18
A crappy mesh builder.
#pragma once
#include <vector>
#include <memory>
#include <Tocs/Math/Vector3.h>
#include <Tocs/Math/Vector2.h>
#include <Tocs/Core/MemberMacro.h>
#include <Tocs/Rendering/Mesh.h>
namespace Tocs {
namespace MeshTools {
@LordTocs
LordTocs / gist:6032547
Last active December 19, 2015 23:08
Asset Managment
#pragma once
#include <map>
#include <string>
#include <memory>
namespace Tocs {
template <class T>
class Asset