diff options
| author | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
| commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
| tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /platform/osx/context_gl_osx.cpp | |
| parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
| download | godot-5dbf180.tar.gz godot-5dbf180.tar.zst godot-5dbf180.zip | |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'platform/osx/context_gl_osx.cpp')
| -rw-r--r-- | platform/osx/context_gl_osx.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/platform/osx/context_gl_osx.cpp b/platform/osx/context_gl_osx.cpp index d0819bbfb..0737e3d3c 100644 --- a/platform/osx/context_gl_osx.cpp +++ b/platform/osx/context_gl_osx.cpp @@ -31,58 +31,58 @@ #ifdef OSX_ENABLED #if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) #include <stdio.h> -#include <unistd.h> #include <stdlib.h> +#include <unistd.h> -#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 void ContextGL_OSX::release_current() { - aglSetCurrentContext( context ); + aglSetCurrentContext(context); } void ContextGL_OSX::make_current() { - aglSetCurrentContext( NULL ); + aglSetCurrentContext(NULL); } void ContextGL_OSX::swap_buffers() { - aglSwapBuffers( context ); + aglSwapBuffers(context); } Error ContextGL_OSX::initialize() { - if ( (Ptr) kUnresolvedCFragSymbolAddress == (Ptr) aglChoosePixelFormat ) + if ((Ptr)kUnresolvedCFragSymbolAddress == (Ptr)aglChoosePixelFormat) return FAILED; GLint attributes[] = { AGL_RGBA, - AGL_DOUBLEBUFFER, - AGL_DEPTH_SIZE, 32, - AGL_NO_RECOVERY, - AGL_NONE, - AGL_NONE }; + AGL_DOUBLEBUFFER, + AGL_DEPTH_SIZE, 32, + AGL_NO_RECOVERY, + AGL_NONE, + AGL_NONE }; AGLPixelFormat format = NULL; - format = aglChoosePixelFormat( NULL, 0, attributes ); + format = aglChoosePixelFormat(NULL, 0, attributes); - if ( !format ) + if (!format) return FAILED; - context = aglCreateContext( format, 0 ); + context = aglCreateContext(format, 0); - if ( !context ) + if (!context) return FAILED; - aglDestroyPixelFormat( format ); + aglDestroyPixelFormat(format); - aglSetWindowRef( context, window ); + aglSetWindowRef(context, window); GLint swapInterval = 1; - aglSetInteger( context, AGL_SWAP_INTERVAL, &swapInterval ); + aglSetInteger(context, AGL_SWAP_INTERVAL, &swapInterval); - aglSetCurrentContext( context ); + aglSetCurrentContext(context); return OK; } @@ -92,13 +92,11 @@ ContextGL_OSX::ContextGL_OSX(WindowRef p_window) { window = p_window; } - ContextGL_OSX::~ContextGL_OSX() { if (context) aglDestroyContext(context); } - #endif #endif |
