diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-14 20:37:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-14 22:26:28 +0300 |
commit | c3b8f951d6e16dfb48cb71bd7ad3d7c43ea56c0a (patch) | |
tree | 9963b756c78012cc4c14f935d9e67ff21a1fd232 /src/graphicsmanager.cpp | |
parent | b37522537cd7049e82172fbae87b4c240f80b07a (diff) | |
download | mv-c3b8f951d6e16dfb48cb71bd7ad3d7c43ea56c0a.tar.gz mv-c3b8f951d6e16dfb48cb71bd7ad3d7c43ea56c0a.tar.bz2 mv-c3b8f951d6e16dfb48cb71bd7ad3d7c43ea56c0a.tar.xz mv-c3b8f951d6e16dfb48cb71bd7ad3d7c43ea56c0a.zip |
Fix code style.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r-- | src/graphicsmanager.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 34b16989a..5a02b1776 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -20,16 +20,12 @@ #include "graphicsmanager.h" -#define GL_GLEXT_PROTOTYPES 1 #ifndef WIN32 +#define GL_GLEXT_PROTOTYPES 1 #include "GL/glx.h" // hack to hide warnings #undef GL_GLEXT_VERSION #undef GL_GLEXT_PROTOTYPES -//#else -//#include "GL/glext.h" -//#undef GL_GLEXT_VERSION -//#undef WIN32_LEAN_AND_MEAN #endif #include "configuration.h" @@ -56,7 +52,9 @@ GraphicsManager graphicsManager; GraphicsManager::GraphicsManager() : mMinor(0), - mMajor(0) + mMajor(0), + mPlatformMinor(0), + mPlatformMajor(0) { } @@ -253,7 +251,7 @@ void GraphicsManager::updatePlanformExtensions() return; HDC hdc = GetDC(info.window); - if (hdc > 0) + if (hdc) { const char *extensions = mwglGetExtensionsString (hdc); if (extensions) @@ -480,12 +478,16 @@ void GraphicsManager::createFBO(int width, int height, FBOInfo *fbo) // create a texture object glGenTextures(1, &fbo->textureId); glBindTexture(OpenGLImageHelper::mTextureType, fbo->textureId); - glTexParameterf(OpenGLImageHelper::mTextureType, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(OpenGLImageHelper::mTextureType, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(OpenGLImageHelper::mTextureType, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(OpenGLImageHelper::mTextureType, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage2D(OpenGLImageHelper::mTextureType, 0, GL_RGBA8, width, height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, nullptr); + glTexParameterf(OpenGLImageHelper::mTextureType, + GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(OpenGLImageHelper::mTextureType, + GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameterf(OpenGLImageHelper::mTextureType, + GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(OpenGLImageHelper::mTextureType, + GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexImage2D(OpenGLImageHelper::mTextureType, 0, GL_RGBA8, width, height, + 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); glBindTexture(OpenGLImageHelper::mTextureType, 0); // create a renderbuffer object to store depth info @@ -539,12 +541,14 @@ void GraphicsManager::deleteFBO(FBOInfo *fbo) } #ifdef WIN32 -#define getFunction(name) wglGetProcAddress(name); +#define getFunction(name) wglGetProcAddress(name) #else -#define getFunction(name) glXGetProcAddress((const GLubyte*)(name)) +#define getFunction(name) glXGetProcAddress(\ + reinterpret_cast<const GLubyte*>(name)) #endif -#define assignFunction(func, name) m##func = (func##_t)getFunction(name) +#define assignFunction(func, name) m##func \ + = reinterpret_cast<func##_t>(getFunction(name)) void GraphicsManager::initOpenGLFunctions() { |