mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
[iOS] Adjusted the code and build files to use Automatic Reference Counting
This commit is contained in:
parent
d50f94ca97
commit
e20ff86330
@ -89,6 +89,11 @@ macro(sfml_add_library target)
|
||||
INSTALL_NAME_DIR "@executable_path/../Frameworks")
|
||||
endif()
|
||||
|
||||
# enable automatic reference counting on iOS
|
||||
if (IOS)
|
||||
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
|
||||
endif()
|
||||
|
||||
# link the target to its external dependencies
|
||||
if(THIS_EXTERNAL_LIBS)
|
||||
target_link_libraries(${target} ${THIS_EXTERNAL_LIBS})
|
||||
@ -143,6 +148,11 @@ macro(sfml_add_example target)
|
||||
target_link_libraries(${target} ${THIS_DEPENDS})
|
||||
endif()
|
||||
|
||||
# enable automatic reference counting on iOS
|
||||
if (IOS)
|
||||
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
|
||||
endif()
|
||||
|
||||
# add the install rule
|
||||
install(TARGETS ${target}
|
||||
RUNTIME DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples)
|
||||
|
@ -30,7 +30,9 @@
|
||||
#include <SFML/Window/iOS/SFView.hpp>
|
||||
#include <SFML/System/Err.hpp>
|
||||
#include <OpenGLES/EAGL.h>
|
||||
#include <OpenGLES/EAGLDrawable.h>
|
||||
#include <OpenGLES/ES1/glext.h>
|
||||
#include <QuartzCore/CAEAGLLayer.h>
|
||||
|
||||
|
||||
namespace sf
|
||||
@ -98,9 +100,6 @@ EaglContext::~EaglContext()
|
||||
|
||||
// Restore the previous context
|
||||
[EAGLContext setCurrentContext:previousContext];
|
||||
|
||||
// Release the context
|
||||
[m_context release];
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,7 +124,7 @@ void EaglContext::recreateRenderBuffers(SFView* glView)
|
||||
glGenRenderbuffersOES(1, &m_colorbuffer);
|
||||
glBindRenderbufferOES(GL_RENDERBUFFER_OES, m_colorbuffer);
|
||||
if (glView)
|
||||
[m_context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:glView.layer];
|
||||
[m_context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)glView.layer];
|
||||
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, m_colorbuffer);
|
||||
|
||||
// Create a depth buffer if requested
|
||||
|
@ -98,7 +98,7 @@ void WindowImplUIKit::processEvents()
|
||||
////////////////////////////////////////////////////////////
|
||||
WindowHandle WindowImplUIKit::getSystemHandle() const
|
||||
{
|
||||
return m_window;
|
||||
return (__bridge WindowHandle)m_window;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user