mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Updated iOS-specific graphics code to use the latest SDL changes.
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef LOVE_IOS
|
||||
#include <SDL_system.h>
|
||||
#include <SDL_syswm.h>
|
||||
#endif
|
||||
|
||||
namespace love
|
||||
@@ -522,9 +522,11 @@ void Graphics::present()
|
||||
discard({}, true);
|
||||
|
||||
#ifdef LOVE_IOS
|
||||
// Hack: SDL's color renderbuffer needs to be bound when swapBuffers is called.
|
||||
GLuint rbo = SDL_iPhoneGetViewRenderbuffer(SDL_GL_GetCurrentWindow());
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
|
||||
// Hack: SDL's color renderbuffer must be bound when swapBuffers is called.
|
||||
SDL_SysWMinfo info = {};
|
||||
SDL_VERSION(&info.version);
|
||||
SDL_GetWindowWMInfo(SDL_GL_GetCurrentWindow(), &info);
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, info.info.uikit.colorbuffer);
|
||||
#endif
|
||||
|
||||
currentWindow->swapBuffers();
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <SDL_video.h>
|
||||
|
||||
#ifdef LOVE_IOS
|
||||
#include <SDL_system.h>
|
||||
#include <SDL_syswm.h>
|
||||
#endif
|
||||
|
||||
namespace love
|
||||
@@ -439,7 +439,10 @@ GLuint OpenGL::getDefaultFBO() const
|
||||
{
|
||||
#ifdef LOVE_IOS
|
||||
// Hack: iOS uses a custom FBO.
|
||||
return SDL_iPhoneGetViewFramebuffer(SDL_GL_GetCurrentWindow());
|
||||
SDL_SysWMinfo info = {};
|
||||
SDL_VERSION(&info.version);
|
||||
SDL_GetWindowWMInfo(SDL_GL_GetCurrentWindow(), &info);
|
||||
return info.info.uikit.framebuffer;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user