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:
authorCampbell Barton <ideasman42@gmail.com>2013-02-25 16:03:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-25 16:03:26 +0400
commit282e5caecfb5c9151e34f18540f3809ac48ef4e5 (patch)
treedcc91df17df9bc0172ee3bbdb8504ff7976d22a5 /intern/ghost
parentac345fce9aa150c192fe62330315768281de6ba4 (diff)
is_crappy_intel_card() was checking strstr(glGetString(GL_VENDOR), "Intel") every call,
better store in static var.
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 7566e7fe71c..b1a9ca52605 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -104,13 +104,14 @@ static PIXELFORMATDESCRIPTOR sPreferredFormat = {
* can't be in multiple-devices configuration. */
static int is_crappy_intel_card(void)
{
- int crappy = 0;
- const char *vendor = (const char *)glGetString(GL_VENDOR);
+ static short is_crappy = -1;
- if (strstr(vendor, "Intel"))
- crappy = 1;
+ if (is_crappy == -1) {
+ const char *vendor = (const char *)glGetString(GL_VENDOR);
+ is_crappy = (strstr(vendor, "Intel") != NULL);
+ }
- return crappy;
+ return is_crappy;
}
GHOST_WindowWin32::GHOST_WindowWin32(