diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-01 21:03:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-02 13:50:50 +0300 |
commit | 2a5dc454f63a4c3442d0ff0715cbd3d135bb5ca7 (patch) | |
tree | 8bcd99ce37d3f7970a3f534e29edcbf2d6d76011 /intern | |
parent | 01a5e087aa25cc76de543740a720f45d1c28d69a (diff) |
Cleanup: minor comment cleanups in GHOST
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_ContextCGL.mm | 29 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemPathsCocoa.mm | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemPathsUnix.cpp | 2 |
3 files changed, 10 insertions, 23 deletions
diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm index cfad6034be7..5fe40cb04a0 100644 --- a/intern/ghost/intern/GHOST_ContextCGL.mm +++ b/intern/ghost/intern/GHOST_ContextCGL.mm @@ -188,24 +188,10 @@ static void makeAttribList(std::vector<NSOpenGLPixelFormatAttribute> &attribs, attribs.push_back((NSOpenGLPixelFormatAttribute)0); } -// TODO(merwin): make this available to all platforms -static void getVersion(int *major, int *minor) -{ -#if 1 // legacy GL - sscanf((const char *)glGetString(GL_VERSION), "%d.%d", major, minor); -#else // 3.0+ - glGetIntegerv(GL_MAJOR_VERSION, major); - glGetIntegerv(GL_MINOR_VERSION, minor); -#endif -} - GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - std::vector<NSOpenGLPixelFormatAttribute> attribs; - attribs.reserve(40); - #ifdef GHOST_OPENGL_ALPHA static const bool needAlpha = true; #else @@ -213,16 +199,15 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext() #endif static bool softwareGL = getenv("BLENDER_SOFTWAREGL"); // command-line argument would be better - GLint major = 0, minor = 0; - NSOpenGLPixelFormat *pixelFormat; - // TODO: keep pixel format for subsequent windows/contexts instead of recreating each time + std::vector<NSOpenGLPixelFormatAttribute> attribs; + attribs.reserve(40); makeAttribList(attribs, m_coreProfile, m_stereoVisual, needAlpha, softwareGL); - pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]]; - - if (pixelFormat == nil) + NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]]; + if (pixelFormat == nil) { goto error; + } m_openGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:s_sharedOpenGLContext]; @@ -230,8 +215,10 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext() [m_openGLContext makeCurrentContext]; - getVersion(&major, &minor); if (m_debug) { + GLint major = 0, minor = 0; + glGetIntegerv(GL_MAJOR_VERSION, &major); + glGetIntegerv(GL_MINOR_VERSION, &minor); fprintf(stderr, "OpenGL version %d.%d%s\n", major, minor, softwareGL ? " (software)" : ""); fprintf(stderr, "Renderer: %s\n", glGetString(GL_RENDERER)); } diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.mm b/intern/ghost/intern/GHOST_SystemPathsCocoa.mm index 232ef048351..830d58ba42c 100644 --- a/intern/ghost/intern/GHOST_SystemPathsCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.mm @@ -110,5 +110,5 @@ const GHOST_TUns8 *GHOST_SystemPathsCocoa::getBinaryDir() const void GHOST_SystemPathsCocoa::addToSystemRecentFiles(const char *filename) const { - /* XXXXX TODO: Implementation for X11 if possible */ + /* TODO: implement for macOS */ } diff --git a/intern/ghost/intern/GHOST_SystemPathsUnix.cpp b/intern/ghost/intern/GHOST_SystemPathsUnix.cpp index 94e48f98510..9514edb7404 100644 --- a/intern/ghost/intern/GHOST_SystemPathsUnix.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsUnix.cpp @@ -115,5 +115,5 @@ const GHOST_TUns8 *GHOST_SystemPathsUnix::getBinaryDir() const void GHOST_SystemPathsUnix::addToSystemRecentFiles(const char * /*filename*/) const { - /* XXXXX TODO: Implementation for X11 if possible */ + /* TODO: implement for X11 */ } |