Adapted the examples for iOS (WIP)
This commit is contained in:
parent
cefb4fcee0
commit
4e8e1629d1
6 changed files with 49 additions and 11 deletions
|
@ -2,12 +2,16 @@
|
|||
# add the examples subdirectories
|
||||
add_subdirectory(ftp)
|
||||
add_subdirectory(opengl)
|
||||
add_subdirectory(pong)
|
||||
if(NOT IOS)
|
||||
add_subdirectory(pong)
|
||||
endif()
|
||||
add_subdirectory(shader)
|
||||
add_subdirectory(sockets)
|
||||
add_subdirectory(sound)
|
||||
add_subdirectory(sound_capture)
|
||||
add_subdirectory(voip)
|
||||
if(NOT IOS)
|
||||
add_subdirectory(sound)
|
||||
add_subdirectory(sound_capture)
|
||||
add_subdirectory(voip)
|
||||
endif()
|
||||
add_subdirectory(window)
|
||||
if(SFML_OS_WINDOWS)
|
||||
add_subdirectory(win32)
|
||||
|
|
|
@ -5,10 +5,15 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/opengl)
|
|||
set(SRC ${SRCROOT}/OpenGL.cpp)
|
||||
|
||||
# find OpenGL and GLU
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
if(NOT IOS)
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
|
||||
else()
|
||||
set(ADDITIONAL_LIBRARIES -framework OpenGLES)
|
||||
endif()
|
||||
|
||||
# define the opengl target
|
||||
sfml_add_example(opengl GUI_APP
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-graphics sfml-window sfml-system ${OPENGL_LIBRARIES})
|
||||
DEPENDS sfml-graphics sfml-window sfml-system ${ADDITIONAL_LIBRARIES})
|
||||
|
|
|
@ -6,6 +6,18 @@
|
|||
#include <SFML/OpenGL.hpp>
|
||||
|
||||
|
||||
// Some platform-specific stuff
|
||||
#ifdef SFML_OPENGL_ES
|
||||
|
||||
#define glClearDepth glClearDepthf
|
||||
#define glFrustum glFrustumf
|
||||
#define gluBuild2DMipmaps(target, internalFormat, width, height, format, type, pixels) \
|
||||
glTexImage2D(target, 0, internalFormat, width, height, 0, format, type, pixels); \
|
||||
glGenerateMipmapOES(GL_TEXTURE_2D);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
|
|
|
@ -5,10 +5,15 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/window)
|
|||
set(SRC ${SRCROOT}/Window.cpp)
|
||||
|
||||
# find OpenGL and GLU
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
if(NOT IOS)
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
|
||||
else()
|
||||
set(ADDITIONAL_LIBRARIES -framework OpenGLES)
|
||||
endif()
|
||||
|
||||
# define the window target
|
||||
sfml_add_example(window GUI_APP
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-window sfml-system ${OPENGL_LIBRARIES})
|
||||
DEPENDS sfml-window sfml-system ${ADDITIONAL_LIBRARIES})
|
||||
|
|
|
@ -5,6 +5,15 @@
|
|||
#include <SFML/OpenGL.hpp>
|
||||
|
||||
|
||||
// Some platform-specific stuff
|
||||
#ifdef SFML_OPENGL_ES
|
||||
|
||||
#define glClearDepth glClearDepthf
|
||||
#define glFrustum glFrustumf
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue