Commit 9136b843 authored by hybrid's avatar hybrid

Fix missing free on error. Reindentation.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1712 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 0831ad93
......@@ -49,6 +49,7 @@ COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize,
bool COpenGLDriver::initDriver(const core::dimension2d<s32>& screenSize,
HWND window, u32 bits, bool vsync, bool stencilBuffer)
{
// Set up ixel format descriptor with desired parameters
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
1, // Version Number
......@@ -70,6 +71,8 @@ bool COpenGLDriver::initDriver(const core::dimension2d<s32>& screenSize,
0, 0, 0 // Layer Masks Ignored
};
GLuint PixelFormat;
// get hdc
if (!(HDc=GetDC(window)))
{
......@@ -77,8 +80,6 @@ bool COpenGLDriver::initDriver(const core::dimension2d<s32>& screenSize,
return false;
}
GLuint PixelFormat;
for (u32 i=0; i<5; ++i)
{
if (i == 1)
......@@ -136,6 +137,7 @@ bool COpenGLDriver::initDriver(const core::dimension2d<s32>& screenSize,
if(!wglMakeCurrent(HDc, HRc))
{
os::Printer::log("Cannot activate GL rendering context", ELL_ERROR);
wglDeleteContext(HRc);
return false;
}
......
......@@ -25,6 +25,7 @@
#if defined(_IRR_WINDOWS_API_)
#include <GL/gl.h>
#include "glext.h"
#include "wglext.h"
#ifdef _MSC_VER
#pragma comment(lib, "OpenGL32.lib")
#pragma comment(lib, "GLu32.lib")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment