From e5a870d4ef6f1bdb7f85aba9321fb816f2bde9f4 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 17 Jan 2011 12:39:28 +0000 Subject: [PATCH] Fix compilation issue caused by WinDef.h defining "near" and "far" macros. --- src/video.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index 78172d43..4630c0cd 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -7,7 +7,7 @@ # include "config.h" #endif -#include +#include #ifdef WIN32 # define WIN32_LEAN_AND_MEAN @@ -41,6 +41,8 @@ void Video::Setup(int width, int height) void Video::SetFov(float theta) { +#undef near /* Fuck Microsoft */ +#undef far /* Fuck Microsoft again */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -113,7 +115,7 @@ void Video::Capture(uint32_t *buffer) glPixelStorei(GL_PACK_ROW_LENGTH, 0); glPixelStorei(GL_PACK_ALIGNMENT, 1); - glReadPixels(0, 0, width, height, GL_BGRA, GL_UNSIGNED_BYTE, buffer); + glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); for (int j = 0; j < height / 2; j++) for (int i = 0; i < width; i++)