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:
authorArystanbek Dyussenov <arystan.d@gmail.com>2010-09-04 22:49:07 +0400
committerArystanbek Dyussenov <arystan.d@gmail.com>2010-09-04 22:49:07 +0400
commit90b464d3728d9ed8ec26fdf59058d236b99dbcd9 (patch)
treee88cab4fb1358e962b19f658064ca8c9f8d29f5b /source/blender/gpu/intern/gpu_extensions.c
parent08d02dd04d836976b25793bb1d4c6a86b3f924c7 (diff)
parentb0b787ef38f9947b3176642556f5282eb3518f69 (diff)
COLLADA branch: merge from trunk -r 28015:31610.soc-2009-chingachgook
Diffstat (limited to 'source/blender/gpu/intern/gpu_extensions.c')
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index d53b8e67c56..fa8ff7a6354 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -32,18 +32,13 @@
#include "GL/glew.h"
-#include "DNA_listBase.h"
#include "DNA_image_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
-#include "BKE_image.h"
#include "BKE_global.h"
#include "BKE_utildefines.h"
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
#include "BLI_blenlib.h"
@@ -71,7 +66,7 @@ static struct GPUGlobal {
GLuint currentfb;
int glslsupport;
int extdisabled;
- int color24bit;
+ int colordepth;
GPUDeviceType device;
GPUOSType os;
GPUDriverType driver;
@@ -93,7 +88,7 @@ void GPU_extensions_disable()
void GPU_extensions_init()
{
- GLint bits;
+ GLint r, g, b;
const char *vendor, *renderer;
glewInit();
@@ -108,9 +103,11 @@ void GPU_extensions_init()
if (!GLEW_ARB_vertex_shader) GG.glslsupport = 0;
if (!GLEW_ARB_fragment_shader) GG.glslsupport = 0;
- glGetIntegerv(GL_RED_BITS, &bits);
- GG.color24bit = (bits >= 8);
-
+ glGetIntegerv(GL_RED_BITS, &r);
+ glGetIntegerv(GL_GREEN_BITS, &g);
+ glGetIntegerv(GL_BLUE_BITS, &b);
+ GG.colordepth = r+g+b; /* assumes same depth for RGB */
+
vendor = (const char*)glGetString(GL_VENDOR);
renderer = (const char*)glGetString(GL_RENDERER);
@@ -122,7 +119,10 @@ void GPU_extensions_init()
GG.device = GPU_DEVICE_NVIDIA;
GG.driver = GPU_DRIVER_OFFICIAL;
}
- else if(strstr(vendor, "Intel") || strstr(renderer, "Mesa DRI Intel")) {
+ else if(strstr(vendor, "Intel") ||
+ /* src/mesa/drivers/dri/intel/intel_context.c */
+ strstr(renderer, "Mesa DRI Intel") ||
+ strstr(renderer, "Mesa DRI Mobile Intel")) {
GG.device = GPU_DEVICE_INTEL;
GG.driver = GPU_DRIVER_OFFICIAL;
}
@@ -147,8 +147,8 @@ void GPU_extensions_init()
GG.driver = GPU_DRIVER_SOFTWARE;
}
else {
- GG.device = GPU_DEVICE_UNKNOWN;
- GG.driver = GPU_DRIVER_UNKNOWN;
+ GG.device = GPU_DEVICE_ANY;
+ GG.driver = GPU_DRIVER_ANY;
}
GG.os = GPU_OS_UNIX;
@@ -175,9 +175,9 @@ int GPU_non_power_of_two_support()
return GLEW_ARB_texture_non_power_of_two;
}
-int GPU_24bit_color_support()
+int GPU_color_depth()
{
- return GG.color24bit;
+ return GG.colordepth;
}
int GPU_print_error(char *str)