Browse Source

Platform: avoid using deprecated APIs in WindowlessIosApplication.

Fallen through cracks. Sorry.
pull/255/head
Vladimír Vondruš 8 years ago
parent
commit
4ecf819fe5
  1. 4
      src/Magnum/Platform/WindowlessIosApplication.h
  2. 10
      src/Magnum/Platform/WindowlessIosApplication.mm

4
src/Magnum/Platform/WindowlessIosApplication.h

@ -33,8 +33,8 @@
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/GL/OpenGL.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
#ifdef __OBJC__ #ifdef __OBJC__
@ -72,7 +72,7 @@ class WindowlessIosContext {
* be able to use Magnum. * be able to use Magnum.
* @see @ref isCreated() * @see @ref isCreated()
*/ */
explicit WindowlessIosContext(const Configuration& configuration, Context* context = nullptr); explicit WindowlessIosContext(const Configuration& configuration, GLContext* context = nullptr);
/** /**
* @brief Construct without creating the context * @brief Construct without creating the context

10
src/Magnum/Platform/WindowlessIosApplication.mm

@ -28,8 +28,8 @@
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/GLContext.h"
#import "EAGL.h" #import "EAGL.h"
@ -39,7 +39,7 @@
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
WindowlessIosContext::WindowlessIosContext(const Configuration&, Context*) { WindowlessIosContext::WindowlessIosContext(const Configuration&, GLContext*) {
if(!(_context = [[EAGLContext alloc] if(!(_context = [[EAGLContext alloc]
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
initWithAPI:kEAGLRenderingAPIOpenGLES2 initWithAPI:kEAGLRenderingAPIOpenGLES2
@ -82,7 +82,7 @@ WindowlessIosApplication::WindowlessIosApplication(const Arguments& arguments, c
createContext(configuration); createContext(configuration);
} }
WindowlessIosApplication::WindowlessIosApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new Context{NoCreate, arguments.argc, arguments.argv}} {} WindowlessIosApplication::WindowlessIosApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new GLContext{NoCreate, arguments.argc, arguments.argv}} {}
void WindowlessIosApplication::createContext() { createContext({}); } void WindowlessIosApplication::createContext() { createContext({}); }
@ -91,7 +91,7 @@ void WindowlessIosApplication::createContext(const Configuration& configuration)
} }
bool WindowlessIosApplication::tryCreateContext(const Configuration& configuration) { bool WindowlessIosApplication::tryCreateContext(const Configuration& configuration) {
CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessIosApplication::tryCreateContext(): context already created", false); CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::WindowlessIosApplication::tryCreateContext(): context already created", false);
WindowlessIosContext glContext{configuration, _context.get()}; WindowlessIosContext glContext{configuration, _context.get()};
if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate()) if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate())

Loading…
Cancel
Save