Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-16 16:55:05 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-16 16:55:05 +0400
commit2144f20b04633ceb957ca9c8a82bbdbb85073503 (patch)
treecab49e236bd9a25e5669eabc0e1b91ab0e2f0854 /source/gameengine/Rasterizer
parentc50055204df1a73583f646bba688d5f7a76531a8 (diff)
Use bitset instead of mucking around with <<, | and &
Diffstat (limited to 'source/gameengine/Rasterizer')
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
index eaed233b86c..2c7112e2e3c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
@@ -60,6 +60,7 @@
#include <vector>
#include <iostream>
#include <algorithm>
+#include <bitset>
#include "STR_String.h"
@@ -217,7 +218,7 @@ static void *bglGetProcAddress(const GLubyte* entry)
GL Extension Manager.
*/
/* Bit array of available extensions */
-static unsigned int enabled_extensions[(bgl::NUM_EXTENSIONS + 8*sizeof(unsigned int) - 1)/(8*sizeof(unsigned int))];
+static std::bitset<bgl::NUM_EXTENSIONS> enabled_extensions;
static std::vector<STR_String> extensions;
static int m_debug;
@@ -227,7 +228,7 @@ static void EnableExtension(bgl::ExtensionName name)
{
unsigned int num = (unsigned int) name;
if (num < bgl::NUM_EXTENSIONS)
- enabled_extensions[num/(8*sizeof(unsigned int))] |= (1<<(num%(8*sizeof(unsigned int))));
+ enabled_extensions.set(num);
}
@@ -251,10 +252,10 @@ void InitExtensions(int debug)
bool QueryExtension(ExtensionName name)
{
unsigned int num = (unsigned int) name;
- if (num >= NUM_EXTENSIONS)
- return false;
-
- return (enabled_extensions[num/(8*sizeof(unsigned int))] & (1<<(num%(8*sizeof(unsigned int))))) != 0;
+ if (num < NUM_EXTENSIONS)
+ return enabled_extensions[num];
+
+ return false;
}
bool QueryVersion(int major, int minor)