OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "gl/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
10 #include "gl/GrGLAssembleInterface.h" | 10 #include "gl/GrGLAssembleInterface.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const GrGLInterface* GrGLCreateNativeInterface() { | 75 const GrGLInterface* GrGLCreateNativeInterface() { |
76 if (NULL == wglGetCurrentContext()) { | 76 if (NULL == wglGetCurrentContext()) { |
77 return NULL; | 77 return NULL; |
78 } | 78 } |
79 | 79 |
80 GLProcGetter getter; | 80 GLProcGetter getter; |
81 if (!getter.isInitialized()) { | 81 if (!getter.isInitialized()) { |
82 return NULL; | 82 return NULL; |
83 } | 83 } |
84 | 84 |
85 const char* verStr = reinterpret_cast<const char*>(glGetString(GR_GL_VERSION
)); | 85 GrGLGetStringProc getString = (GrGLGetStringProc)getter.getProc("glGetString
"); |
| 86 if (NULL == getString) { |
| 87 return NULL; |
| 88 } |
| 89 const char* verStr = reinterpret_cast<const char*>(getString(GR_GL_VERSION))
; |
86 GrGLStandard standard = GrGLGetStandardInUseFromString(verStr); | 90 GrGLStandard standard = GrGLGetStandardInUseFromString(verStr); |
87 | 91 |
88 if (kGLES_GrGLStandard == standard) { | 92 if (kGLES_GrGLStandard == standard) { |
89 return GrGLAssembleGLESInterface(&getter, win_get_gl_proc); | 93 return GrGLAssembleGLESInterface(&getter, win_get_gl_proc); |
90 } else if (kGL_GrGLStandard == standard) { | 94 } else if (kGL_GrGLStandard == standard) { |
91 return GrGLAssembleGLInterface(&getter, win_get_gl_proc); | 95 return GrGLAssembleGLInterface(&getter, win_get_gl_proc); |
92 } | 96 } |
93 return NULL; | 97 return NULL; |
94 } | 98 } |
OLD | NEW |