mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-01 19:16:30 +03:00
66
README.md
66
README.md
@@ -12,11 +12,9 @@ framework heavily focused on the development of rich graphical user interfaces.
|
||||
|
||||
### Cross platform functionality
|
||||
|
||||
* Official support for Linux, Windows, macOS and Android.
|
||||
* Official support for Linux, Windows, macOS, Android and iOS.
|
||||
|
||||
* Exports to HTML5 using emscripten with some limitations.
|
||||
|
||||
* iOS current support is limited but should work without issues.
|
||||
* Exports to HTML5 using emscripten with some minor limitations.
|
||||
|
||||
* Also works on BSD and Haiku.
|
||||
|
||||
@@ -442,23 +440,59 @@ library. That file can be used in you projects.
|
||||
|
||||
### iOS
|
||||
|
||||
I've compiled the project for **iOS** many times in the past but there's not a
|
||||
recent build of it, so it might fail. But you can get the scripts to build it in
|
||||
`projects/ios/`. You can use `compile-all.sh` to generate a static build of eepp
|
||||
( but you will need to update the `libs/ios/libSDL2.a` build with a more recent
|
||||
one ).
|
||||
You'll need some inspiration to make this work, but I promise that I'll work on
|
||||
make this easier in the near future.
|
||||
You can also try to build the project with
|
||||
`premake5 --use-frameworks --os=ios xcode4`. That should give you a good
|
||||
starting point, but won't build, it will need some minor tweaks.
|
||||
The project provides two files to build the library and the demos. You can use
|
||||
any of them depending on your needs.
|
||||
The files are located in `projects/ios`:
|
||||
|
||||
#### gen-xcode4-proj.sh script
|
||||
|
||||
This script can be used to generate the xcode projects and solution of all the
|
||||
included projects in eepp (demos, tools, shared lib, static lib, etc). It will
|
||||
also download and build the SDL2 fat static library in order to be able to
|
||||
reference the library to the project. After building the projects sadly you'll
|
||||
need to make some minor changes to any/all of the projects you wan't to build
|
||||
or test, since the project generated lacks some minor configurations. After
|
||||
you run this script you'll need to open the solution located in
|
||||
`make/ios/eepp.xcworkspace`. To build the static libraries you'll not find any
|
||||
problem (that will work out of the box). But to test some of the examples it's
|
||||
required to:
|
||||
|
||||
##### Add the Info.plist file
|
||||
|
||||
Select (click on the project name) the project you want to test, for example
|
||||
`eepp-empty-window`. You will se several tabs/options, go to _Build Settings_,
|
||||
and locate the option _Info.plist_ file, double click to edit and write:
|
||||
`Info.plist`. This will indicate to read that file that is located in the same
|
||||
directory than the project. The go to the tab _General_ and complete the
|
||||
_Bundle Identifier_ with an identifier name of the app bundle that will be
|
||||
generated, for this example you can use something like: `eepp-empty-window`.
|
||||
That will allow you to build and run the project.
|
||||
|
||||
#### Add resources to the project
|
||||
This `eepp-empty-window` demo does not use any assets/resources, but other demos
|
||||
will need to load assets, and this assets need to be added to the project in order
|
||||
to be available to the app bundle. For example, the project `eepp-ui-hello-world`,
|
||||
will require you to add the `assets` folder into the project. What you need to do
|
||||
is: select the project and go to the _Build Phases_ tab, in _Copy Bundles Resources_
|
||||
click in the plus icon (+), then go to _Add Other..._ and locate and select the
|
||||
`bin/assets/` folder and _Finish_. That should be enough.
|
||||
|
||||
#### compile-all.sh script
|
||||
|
||||
This script can be used to build the SDL2 and eepp as two fat static libraries
|
||||
with arm64 and x86_64 architectures in it (arm64 for iPhone/iPad and x86_64 for
|
||||
the simulators). To generate a release build pass `config=release` as a parameter
|
||||
fo the script (`sh compile-all.sh config=release`). The built files will be
|
||||
located in `libs/ios/`, as `libSDL2.a` and `libeepp.a` (or `libeepp-debug.a` for
|
||||
debug build). This two files can be integrated in your project.
|
||||
|
||||
### emscripten
|
||||
|
||||
You will first need to [download and install emscripten](https://emscripten.org/docs/getting_started/downloads.html).
|
||||
Then there's a script for building the **emscripten** project in
|
||||
`projects/emscripten/make.sh`. That should be enough in **GNU/Linux** or
|
||||
**macOS** ( only tested this on GNU/Linux ).
|
||||
`projects/emscripten/make.sh`. Before running this script remember to set the
|
||||
emsdk enviroment, it should be something like: `source /path/to/emsdk/emsdk_env.sh`.
|
||||
That should be enough in **GNU/Linux** or **macOS** ( only tested this on GNU/Linux ).
|
||||
|
||||
## Author comment
|
||||
|
||||
|
||||
Binary file not shown.
@@ -285,6 +285,7 @@ os_links = { }
|
||||
backends = { }
|
||||
static_backends = { }
|
||||
backend_selected = false
|
||||
remote_sdl2_version = "SDL2-2.0.10"
|
||||
|
||||
function build_base_configuration( package_name )
|
||||
includedirs { "src/thirdparty/zlib" }
|
||||
@@ -489,7 +490,7 @@ function generate_os_links()
|
||||
elseif os.is_real("haiku") then
|
||||
multiple_insert( os_links, { "GL", "network" } )
|
||||
elseif os.is_real("ios") then
|
||||
multiple_insert( os_links, { "OpenGLES.framework", "AudioToolbox.framework", "CoreAudio.framework", "Foundation.framework", "CoreFoundation.framework", "UIKit.framework", "QuartzCore.framework", "CoreGraphics.framework" } )
|
||||
multiple_insert( os_links, { "OpenGLES.framework", "AudioToolbox.framework", "CoreAudio.framework", "Foundation.framework", "CoreFoundation.framework", "UIKit.framework", "QuartzCore.framework", "CoreGraphics.framework", "CoreMotion.framework", "AVFoundation.framework", "GameController.framework" } )
|
||||
end
|
||||
|
||||
if not _OPTIONS["with-mojoal"] then
|
||||
@@ -613,17 +614,17 @@ function set_ios_config()
|
||||
local sysroot_path = os.getenv("SYSROOTPATH")
|
||||
local framework_path = sysroot_path .. "/System/Library/Frameworks"
|
||||
local framework_libs_path = framework_path .. "/usr/lib"
|
||||
local sysroot_ver = " -miphoneos-version-min=" .. os.getenv("IOSVERSION") .. " -isysroot " .. sysroot_path
|
||||
local sysroot_ver = " -miphoneos-version-min=9.0 -isysroot " .. sysroot_path
|
||||
|
||||
buildoptions { sysroot_ver .. " -I" .. sysroot_path .. "/usr/include" }
|
||||
linkoptions { sysroot_ver }
|
||||
libdirs { framework_libs_path }
|
||||
linkoptions { " -F" .. framework_path .. " -L" .. framework_libs_path .. " -isysroot " .. sysroot_path }
|
||||
includedirs { "src/thirdparty/SDL2/include" }
|
||||
includedirs { "src/thirdparty/" .. remote_sdl2_version .. "/include" }
|
||||
end
|
||||
|
||||
if _OPTIONS.platform == "ios-cross-arm7" or _OPTIONS.platform == "ios-cross-x86" then
|
||||
includedirs { "src/thirdparty/SDL2/include" }
|
||||
includedirs { "src/thirdparty/" .. remote_sdl2_version .. "/include" }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
125
premake5.lua
125
premake5.lua
@@ -89,6 +89,7 @@ backends = { }
|
||||
static_backends = { }
|
||||
backend_selected = false
|
||||
remote_sdl2_version = "SDL2-2.0.10"
|
||||
remote_sdl2_devel_src_url = "https://libsdl.org/release/SDL2-2.0.10.zip"
|
||||
remote_sdl2_devel_vc_url = "https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip"
|
||||
|
||||
function incdirs( dirs )
|
||||
@@ -98,19 +99,28 @@ function incdirs( dirs )
|
||||
includedirs { dirs }
|
||||
end
|
||||
|
||||
function download_and_extract_sdl(sdl_url)
|
||||
print("Downloading: " .. sdl_url)
|
||||
local dest_dir = "src/thirdparty/"
|
||||
local local_file = dest_dir .. remote_sdl2_version .. ".zip"
|
||||
local result_str, response_code = http.download(sdl_url, local_file)
|
||||
if response_code == 200 then
|
||||
print("Downloaded successfully to: " .. local_file)
|
||||
zip.extract(local_file, dest_dir)
|
||||
print("Extracted " .. local_file .. " into " .. dest_dir)
|
||||
else
|
||||
print("Failed to download: " .. sdl_url)
|
||||
exit(1)
|
||||
end
|
||||
end
|
||||
|
||||
function download_and_extract_dependencies()
|
||||
if _OPTIONS["windows-vc-build"] and not os.isdir("src/thirdparty/" .. remote_sdl2_version) then
|
||||
print("Downloading: " .. remote_sdl2_devel_vc_url)
|
||||
local dest_dir = "src/thirdparty/"
|
||||
local local_file = dest_dir .. remote_sdl2_version .. ".zip"
|
||||
local result_str, response_code = http.download(remote_sdl2_devel_vc_url, local_file)
|
||||
if response_code == 200 then
|
||||
print("Downloaded successfully to: " .. local_file)
|
||||
zip.extract(local_file, dest_dir)
|
||||
print("Extracted " .. local_file .. " into " .. dest_dir)
|
||||
else
|
||||
print("Failed to download: " .. remote_sdl2_rul)
|
||||
exit(1)
|
||||
if not os.isdir("src/thirdparty/" .. remote_sdl2_version) then
|
||||
if _OPTIONS["windows-vc-build"] then
|
||||
download_and_extract_sdl(remote_sdl2_devel_vc_url)
|
||||
elseif os.istarget("ios") then
|
||||
download_and_extract_sdl(remote_sdl2_devel_src_url)
|
||||
os.execute("patch -t --forward -p1 -d src/thirdparty/SDL2-2.0.10/ < projects/ios/SDL2-sensors.patch")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -124,10 +134,10 @@ function build_base_configuration( package_name )
|
||||
filter "not system:windows"
|
||||
buildoptions{ "-fPIC" }
|
||||
|
||||
filter "configurations:debug"
|
||||
filter "configurations:debug*"
|
||||
targetname ( package_name .. "-debug" )
|
||||
|
||||
filter "configurations:release"
|
||||
filter "configurations:release*"
|
||||
targetname ( package_name )
|
||||
|
||||
filter "action:not vs*"
|
||||
@@ -149,12 +159,12 @@ function build_base_cpp_configuration( package_name )
|
||||
filter "action:not vs*"
|
||||
buildoptions { "-Wall" }
|
||||
|
||||
filter "configurations:debug"
|
||||
filter "configurations:debug*"
|
||||
defines { "DEBUG" }
|
||||
symbols "On"
|
||||
targetname ( package_name .. "-debug" )
|
||||
|
||||
filter "configurations:release"
|
||||
filter "configurations:release*"
|
||||
optimize "Speed"
|
||||
targetname ( package_name )
|
||||
end
|
||||
@@ -192,23 +202,23 @@ function build_link_configuration( package_name, use_ee_icon )
|
||||
cppdialect "C++14"
|
||||
buildoptions { "-Wall" }
|
||||
|
||||
filter { "configurations:debug", "action:not vs*" }
|
||||
filter { "configurations:debug*", "action:not vs*" }
|
||||
buildoptions{ "-Wno-long-long" }
|
||||
|
||||
filter { "configurations:release", "action:not vs*" }
|
||||
filter { "configurations:release*", "action:not vs*" }
|
||||
buildoptions { "-fno-strict-aliasing -ffast-math" }
|
||||
|
||||
filter { "configurations:release", "action:not vs*", "system:not macosx" }
|
||||
filter { "configurations:release*", "action:not vs*", "system:not macosx" }
|
||||
buildoptions { "-s" }
|
||||
|
||||
filter "configurations:debug"
|
||||
filter "configurations:debug*"
|
||||
defines { "DEBUG", "EE_DEBUG", "EE_MEMORY_MANAGER" }
|
||||
targetname ( package_name .. "-debug" .. extension )
|
||||
|
||||
filter "configurations:release"
|
||||
filter "configurations:release*"
|
||||
targetname ( package_name .. extension )
|
||||
|
||||
filter { "system:windows or system:ios", "action:not vs*" }
|
||||
filter { "system:windows", "action:not vs*" }
|
||||
linkoptions { "-static-libgcc", "-static-libstdc++" }
|
||||
|
||||
filter { "system:windows", "action:vs*" }
|
||||
@@ -253,7 +263,7 @@ function generate_os_links()
|
||||
elseif os.istarget("haiku") then
|
||||
multiple_insert( os_links, { "GL", "network" } )
|
||||
elseif os.istarget("ios") then
|
||||
multiple_insert( os_links, { "OpenGLES.framework", "AudioToolbox.framework", "CoreAudio.framework", "Foundation.framework", "CoreFoundation.framework", "UIKit.framework", "QuartzCore.framework", "CoreGraphics.framework" } )
|
||||
multiple_insert( os_links, { "OpenGLES.framework", "AudioToolbox.framework", "CoreAudio.framework", "Foundation.framework", "CoreFoundation.framework", "UIKit.framework", "QuartzCore.framework", "CoreGraphics.framework", "CoreMotion.framework", "AVFoundation.framework", "GameController.framework" } )
|
||||
elseif os.istarget("android") then
|
||||
multiple_insert( os_links, { "GLESv1_CM", "GLESv2", "log" } )
|
||||
end
|
||||
@@ -319,13 +329,13 @@ end
|
||||
|
||||
function can_add_static_backend( name )
|
||||
if _OPTIONS["with-static-backend"] then
|
||||
local path = "libs/" .. os.target() .. "/lib" .. name .. ".a"
|
||||
return os.isfile(path)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function insert_static_backend( name )
|
||||
table.insert( static_backends, path.getrelative( "libs/" .. os.target(), "./" ) .. "/libs/" .. os.target() .. "/lib" .. name .. ".a" )
|
||||
table.insert( static_backends, "../../libs/" .. os.target() .. "/lib" .. name .. ".a" )
|
||||
end
|
||||
|
||||
function add_sdl2()
|
||||
@@ -333,6 +343,7 @@ function add_sdl2()
|
||||
if not can_add_static_backend("SDL2") then
|
||||
table.insert( link_list, get_backend_link_name( "SDL2" ) )
|
||||
else
|
||||
print("Using static backend")
|
||||
insert_static_backend( "SDL2" )
|
||||
end
|
||||
|
||||
@@ -349,44 +360,32 @@ end
|
||||
|
||||
function set_ios_config()
|
||||
if os.istarget("ios") then
|
||||
local err = false
|
||||
local toolchainpath = os.getenv("TOOLCHAINPATH")
|
||||
local iosversion = os.getenv("IOSVERSION")
|
||||
local sysroot_path = os.getenv("SYSROOTPATH")
|
||||
|
||||
if nil == os.getenv("TOOLCHAINPATH") then
|
||||
print("You must set TOOLCHAINPATH enviroment variable.")
|
||||
print("\tExample: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/")
|
||||
err = true
|
||||
end
|
||||
|
||||
if nil == os.getenv("SYSROOTPATH") then
|
||||
print("You must set SYSROOTPATH enviroment variable.")
|
||||
print("\tExample: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk")
|
||||
err = true
|
||||
toolchainpath = os.outputof("xcrun -find -sdk iphonesimulator clang")
|
||||
end
|
||||
|
||||
if nil == os.getenv("IOSVERSION") then
|
||||
print("You must set IOSVERSION enviroment variable.")
|
||||
print("\tExample: 5.0")
|
||||
err = true
|
||||
iosversion = os.outputof("xcrun --sdk iphonesimulator --show-sdk-version")
|
||||
end
|
||||
|
||||
if err then
|
||||
os.exit(1)
|
||||
if nil == os.getenv("SYSROOTPATH") then
|
||||
local platform_path = os.outputof("xcrun --sdk iphonesimulator --show-sdk-platform-path")
|
||||
sysroot_path = platform_path .. "/Developer/SDKs/iPhoneSimulator" .. iosversion .. ".sdk/"
|
||||
end
|
||||
|
||||
local sysroot_path = os.getenv("SYSROOTPATH")
|
||||
local framework_path = sysroot_path .. "/System/Library/Frameworks"
|
||||
local framework_libs_path = framework_path .. "/usr/lib"
|
||||
local sysroot_ver = " -miphoneos-version-min=" .. os.getenv("IOSVERSION") .. " -isysroot " .. sysroot_path
|
||||
local sysroot_ver = " -miphoneos-version-min=9.0 -isysroot " .. sysroot_path
|
||||
|
||||
buildoptions { sysroot_ver .. " -I" .. sysroot_path .. "/usr/include" }
|
||||
linkoptions { sysroot_ver }
|
||||
libdirs { framework_libs_path }
|
||||
linkoptions { " -F" .. framework_path .. " -L" .. framework_libs_path .. " -isysroot " .. sysroot_path }
|
||||
incdirs { "src/thirdparty/SDL2/include" }
|
||||
end
|
||||
|
||||
if _OPTIONS.platform == "ios-cross-arm7" or _OPTIONS.platform == "ios-cross-x86" then
|
||||
incdirs { "src/thirdparty/SDL2/include" }
|
||||
includedirs { "src/thirdparty/" .. remote_sdl2_version .. "/include" }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -507,11 +506,6 @@ function build_eepp( build_name )
|
||||
filter { "system:macosx", "action:xcode* or options:use-frameworks" }
|
||||
libdirs { "/System/Library/Frameworks", "/Library/Frameworks" }
|
||||
|
||||
filter "with-dynamic-freetype"
|
||||
if os_findlib("freetype") then
|
||||
table.insert( link_list, get_backend_link_name( "freetype" ) )
|
||||
end
|
||||
|
||||
filter "system:windows"
|
||||
files { "src/eepp/system/platform/win/*.cpp" }
|
||||
files { "src/eepp/network/platform/win/*.cpp" }
|
||||
@@ -532,12 +526,22 @@ function build_eepp( build_name )
|
||||
|
||||
filter "action:not vs*"
|
||||
cppdialect "C++14"
|
||||
|
||||
filter "options:with-dynamic-freetype"
|
||||
if not os.istarget("ios") and os_findlib("freetype") then
|
||||
table.insert( link_list, get_backend_link_name( "freetype" ) )
|
||||
end
|
||||
end
|
||||
|
||||
workspace "eepp"
|
||||
targetdir("./bin/")
|
||||
configurations { "debug", "release" }
|
||||
platforms { "x86_64", "x86" }
|
||||
if os.istarget("ios") then
|
||||
configurations { "debug-x64", "debug-arm64", "release-x64", "release-arm64" }
|
||||
platforms { "x86_64", "arm64" }
|
||||
else
|
||||
configurations { "debug", "release" }
|
||||
platforms { "x86_64", "x86" }
|
||||
end
|
||||
rtti "On"
|
||||
download_and_extract_dependencies()
|
||||
select_backend()
|
||||
@@ -549,7 +553,10 @@ workspace "eepp"
|
||||
filter "platforms:x86"
|
||||
architecture "x86"
|
||||
|
||||
filter "platforms:x86_64"
|
||||
filter "platforms:arm64 or configurations:debug-arm64 or configurations:release-arm64"
|
||||
architecture "arm64"
|
||||
|
||||
filter "platforms:x86_64 or configurations:debug-x64 or configurations:release-x64"
|
||||
architecture "x86_64"
|
||||
|
||||
filter "system:macosx"
|
||||
@@ -560,10 +567,10 @@ workspace "eepp"
|
||||
ndkplatform "android-28"
|
||||
ndkstl "c++_static"
|
||||
|
||||
filter "configurations:debug"
|
||||
filter "configurations:debug*"
|
||||
defines { "DEBUG" }
|
||||
symbols "On"
|
||||
filter "configurations:release"
|
||||
filter "configurations:release*"
|
||||
optimize "Speed"
|
||||
|
||||
project "SOIL2-static"
|
||||
@@ -693,7 +700,7 @@ workspace "eepp"
|
||||
"src/thirdparty/efsw/src/efsw/FileWatcherWin32.cpp",
|
||||
"src/thirdparty/efsw/src/efsw/FileWatcherFSEvents.cpp"
|
||||
}
|
||||
filter "system:macosx"
|
||||
filter "system:macosx or system:ios"
|
||||
excludes {
|
||||
"src/thirdparty/efsw/src/efsw/WatcherInotify.cpp",
|
||||
"src/thirdparty/efsw/src/efsw/WatcherWin32.cpp",
|
||||
|
||||
32
projects/ios/Info.plist
Normal file
32
projects/ios/Info.plist
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string></string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>iOS Launch Screen</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,24 +0,0 @@
|
||||
IPHONE_IP:=
|
||||
PROJECTNAME:=eepp
|
||||
APPFOLDER:=$(PROJECTNAME).app
|
||||
INSTALLFOLDER:=$(PROJECTNAME).app
|
||||
|
||||
install:
|
||||
ifeq ($(IPHONE_IP),)
|
||||
echo "Please set IPHONE_IP"
|
||||
else
|
||||
ssh root@$(IPHONE_IP) 'rm -fr /Applications/$(INSTALLFOLDER)'
|
||||
scp -r $(APPFOLDER) root@$(IPHONE_IP):/Applications/$(INSTALLFOLDER)
|
||||
echo "Application $(INSTALLFOLDER) installed"
|
||||
ssh mobile@$(IPHONE_IP) 'uicache'
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
ifeq ($(IPHONE_IP),)
|
||||
echo "Please set IPHONE_IP"
|
||||
else
|
||||
ssh root@$(IPHONE_IP) 'rm -fr /Applications/$(INSTALLFOLDER)'
|
||||
echo "Application $(INSTALLFOLDER) uninstalled"
|
||||
endif
|
||||
|
||||
.PHONY: install uninstall
|
||||
33
projects/ios/SDL2-sensors.patch
Normal file
33
projects/ios/SDL2-sensors.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
--- a/configure Mon Dec 30 17:56:56 2019 -0800
|
||||
+++ b/configure Tue Dec 31 10:40:30 2019 -0800
|
||||
@@ -25106,6 +25106,14 @@
|
||||
# have_haptic=yes
|
||||
# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
|
||||
#fi
|
||||
+ # Set up files for the sensor library
|
||||
+ if test x$enable_sensor = xyes; then
|
||||
+
|
||||
+$as_echo "#define SDL_SENSOR_COREMOTION 1" >>confdefs.h
|
||||
+
|
||||
+ SOURCES="$SOURCES $srcdir/src/sensor/coremotion/*.m"
|
||||
+ have_sensor=yes
|
||||
+ fi
|
||||
# Set up files for the power library
|
||||
if test x$enable_power = xyes; then
|
||||
|
||||
|
||||
--- a/configure.ac Mon Dec 30 17:56:56 2019 -0800
|
||||
+++ b/configure.ac Tue Dec 31 10:40:30 2019 -0800
|
||||
@@ -3856,6 +3856,12 @@
|
||||
# have_haptic=yes
|
||||
# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
|
||||
#fi
|
||||
+ # Set up files for the sensor library
|
||||
+ if test x$enable_sensor = xyes; then
|
||||
+ AC_DEFINE(SDL_SENSOR_COREMOTION, 1, [ ])
|
||||
+ SOURCES="$SOURCES $srcdir/src/sensor/coremotion/*.m"
|
||||
+ have_sensor=yes
|
||||
+ fi
|
||||
# Set up files for the power library
|
||||
if test x$enable_power = xyes; then
|
||||
AC_DEFINE(SDL_POWER_UIKIT, 1, [ ])
|
||||
@@ -1,6 +1,15 @@
|
||||
#!/bin/sh
|
||||
cd $(dirname "$0")
|
||||
|
||||
if [ ! -f ../../libs/ios/libSDL2.a ]; then
|
||||
|
||||
cd ../../src/thirdparty/SDL2-2.0.10/build-scripts
|
||||
./iosbuild.sh
|
||||
cp lib/libSDL2.a ../../../../libs/ios/
|
||||
cd ../../../../projects/ios
|
||||
|
||||
fi
|
||||
|
||||
./compile-arm64.sh $@
|
||||
./compile-x86_64.sh $@
|
||||
|
||||
@@ -10,6 +19,6 @@ if [ -f arm64/libeepp-static-debug.a ] && [ -f x86_64/libeepp-static-debug.a ];
|
||||
lipo -create -arch arm64 arm64/libeepp-static-debug.a -arch x86_64 x86_64/libeepp-static-debug.a -output ./libeepp-debug.a
|
||||
fi
|
||||
|
||||
if [ -f arm7/libeepp-static.a ] && [ -f x86/libeepp-static.a ]; then
|
||||
if [ -f arm64/libeepp-static.a ] && [ -f x86_64/libeepp-static.a ]; then
|
||||
lipo -create -arch arm64 arm64/libeepp-static.a -arch x86_64 x86_64/libeepp-static.a -output ./libeepp.a
|
||||
fi
|
||||
|
||||
@@ -5,11 +5,11 @@ CLANGPATH=`xcrun -find -sdk iphoneos clang`
|
||||
export TOOLCHAINPATH=`dirname $CLANGPATH`/
|
||||
|
||||
if [ -z "$IOSVERSION" ]; then
|
||||
export IOSVERSION=12.1
|
||||
export IOSVERSION=`xcrun --sdk iphoneos --show-sdk-version`
|
||||
fi
|
||||
|
||||
if [ -z "$SYSROOTPATH" ]; then
|
||||
export SYSROOTPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$IOSVERSION.sdk/
|
||||
export SYSROOTPATH=`xcrun --sdk iphoneos --show-sdk-platform-path`/Developer/SDKs/iPhoneOS$IOSVERSION.sdk/
|
||||
fi
|
||||
|
||||
premake4 --file=../../premake4.lua --platform=ios-arm64 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend --use-frameworks gmake
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd $(dirname "$0")
|
||||
|
||||
CLANGPATH=`xcrun -find -sdk iphoneos clang`
|
||||
export TOOLCHAINPATH=`dirname $CLANGPATH`/
|
||||
|
||||
if [ -z "$IOSVERSION" ]; then
|
||||
export IOSVERSION=10.0
|
||||
fi
|
||||
|
||||
if [ -z "$SYSROOTPATH" ]; then
|
||||
export SYSROOTPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$IOSVERSION.sdk/
|
||||
fi
|
||||
|
||||
premake4 --file=../../premake4.lua --platform=ios-x86 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend --use-frameworks gmake
|
||||
|
||||
cd ../../make/ios-x86/
|
||||
make -j`nproc` $@ eepp-static
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/bin/sh
|
||||
cd $(dirname "$0")
|
||||
|
||||
CLANGPATH=`xcrun -find -sdk iphoneos clang`
|
||||
CLANGPATH=`xcrun -find -sdk iphonesimulator clang`
|
||||
export TOOLCHAINPATH=`dirname $CLANGPATH`/
|
||||
|
||||
if [ -z "$IOSVERSION" ]; then
|
||||
export IOSVERSION=12.1
|
||||
export IOSVERSION=`xcrun --sdk iphonesimulator --show-sdk-version`
|
||||
fi
|
||||
|
||||
if [ -z "$SYSROOTPATH" ]; then
|
||||
export SYSROOTPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$IOSVERSION.sdk/
|
||||
export SYSROOTPATH=`xcrun --sdk iphonesimulator --show-sdk-platform-path`/Developer/SDKs/iPhoneSimulator$IOSVERSION.sdk/
|
||||
fi
|
||||
|
||||
premake4 --file=../../premake4.lua --platform=ios-x86_64 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend --use-frameworks gmake
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd $(dirname "$0")
|
||||
|
||||
premake4 --file=../../premake4.lua --platform=ios-cross-arm7 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake
|
||||
|
||||
cd ../../make/ios-cross-arm7/
|
||||
make $@
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd $(dirname "$0")
|
||||
|
||||
premake4 --file=../../premake4.lua --platform=ios-cross-x86 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake
|
||||
|
||||
cd ../../make/ios-cross-x86/
|
||||
make $@
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
ln -sf ../../../bin/assets ./eepp.app/
|
||||
echo "The fist parameter must be the path of the binary file to install. Example: ../../bin/eetest-debug.ios"
|
||||
cp $1 ./eepp.app/eepp
|
||||
make install $2
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
make uninstall
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
Binary file not shown.
@@ -1,17 +0,0 @@
|
||||
iPhone App Icon:
|
||||
Icon.png 57×57 App Store And iPhone、iPod touch Launcher Icon. (Needed)
|
||||
Icon@2x.png 114×114 Retina mode of Icon.png. (Needed)
|
||||
Icon-Small.png 29×29 Settings and Spotlight search icon. (Optional)
|
||||
Icon-Small@2x.png 58×58 Retina mode of Icon-Small.png. (Optional)
|
||||
|
||||
iPad App Icon:
|
||||
Icon-72.png 72×72 iPad Launcher Icon. (Needed)
|
||||
Icon-50.png 50×50 Spotlight search icon. (Optional)
|
||||
Icon-29.png 29×29 Settings icon. (Optional)
|
||||
|
||||
iPhone/iPad App Icon:
|
||||
Icon.png 57×57 App Store And iPhone、iPod touch Launcher Icon. (Needed)
|
||||
Icon-72.png 72×72 iPad Launcher Icon. (Needed)
|
||||
Icon-50.png 50×50 iPad Spotlight search icon. (Optional)
|
||||
Icon-29.png 29×29 Settings and iPhone Spotlight search icon. (Optional)
|
||||
|
||||
12
projects/ios/gen-xcode4-proj.sh
Executable file
12
projects/ios/gen-xcode4-proj.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
premake5 --file=../../premake5.lua --os=ios --with-static-eepp --with-gles1 --with-gles2 --with-static-backend --use-frameworks xcode4
|
||||
|
||||
cp Info.plist ../../make/ios
|
||||
|
||||
if [ ! -f ../../libs/ios/libSDL2.a ]; then
|
||||
|
||||
cd ../../src/thirdparty/SDL2-2.0.10/build-scripts
|
||||
./iosbuild.sh
|
||||
cp lib/libSDL2.a ../../../../libs/ios/
|
||||
|
||||
fi
|
||||
@@ -24,11 +24,9 @@ Float DisplaySDL2::getDPI() {
|
||||
#if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN
|
||||
return 96.f * emscripten_get_device_pixel_ratio();
|
||||
#else
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 4 )
|
||||
float ddpi, hdpi, vdpi;
|
||||
if ( 0 == SDL_GetDisplayDPI( 0, &ddpi, &hdpi, &vdpi ) )
|
||||
return ddpi;
|
||||
#endif
|
||||
return 96.f;
|
||||
#endif
|
||||
}
|
||||
@@ -83,11 +81,9 @@ DisplayMode DisplaySDL2::getClosestDisplayMode( DisplayMode wantedMode ) {
|
||||
}
|
||||
|
||||
Rect DisplaySDL2::getUsableBounds() {
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 5 )
|
||||
SDL_Rect r;
|
||||
if ( SDL_GetDisplayUsableBounds( index, &r ) == 0 )
|
||||
return Rect( r.x, r.y, r.w, r.h );
|
||||
#endif
|
||||
return Rect();
|
||||
}
|
||||
|
||||
|
||||
@@ -348,7 +348,6 @@ void InputSDL::injectMousePos( const Uint16& x, const Uint16& y ) {
|
||||
}
|
||||
|
||||
Vector2i InputSDL::queryMousePos() {
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 5 )
|
||||
Vector2i mousePos;
|
||||
Vector2i tempMouse;
|
||||
Vector2i tempWinPos;
|
||||
@@ -361,11 +360,6 @@ Vector2i InputSDL::queryMousePos() {
|
||||
mousePos.x = (int)tempMouse.x - tempWinPos.x - bordersSize.Left;
|
||||
mousePos.y = (int)tempMouse.y - tempWinPos.y - bordersSize.Top;
|
||||
return mousePos;
|
||||
#else
|
||||
int x, y;
|
||||
SDL_GetMouseState( &x, &y );
|
||||
return Vector2i( x, y );
|
||||
#endif
|
||||
}
|
||||
|
||||
void InputSDL::init() {
|
||||
|
||||
@@ -239,11 +239,7 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) {
|
||||
mWindow.WindowConfig.Height = mWindow.DesktopResolution.getHeight();
|
||||
}
|
||||
|
||||
mWindow.Flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
|
||||
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 1 )
|
||||
mWindow.Flags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
||||
#endif
|
||||
mWindow.Flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI;
|
||||
|
||||
if ( mWindow.WindowConfig.Style & WindowStyle::Resize ) {
|
||||
mWindow.Flags |= SDL_WINDOW_RESIZABLE;
|
||||
@@ -272,10 +268,6 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) {
|
||||
mWindow.WindowConfig.Height *= mWindow.WindowConfig.PixelDensity;
|
||||
#endif
|
||||
|
||||
#if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN
|
||||
tmpFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI;
|
||||
#endif
|
||||
|
||||
mSDLWindow = SDL_CreateWindow( mWindow.WindowConfig.Caption.c_str(), SDL_WINDOWPOS_UNDEFINED,
|
||||
SDL_WINDOWPOS_UNDEFINED, mWindow.WindowConfig.Width,
|
||||
mWindow.WindowConfig.Height, tmpFlags );
|
||||
@@ -288,27 +280,6 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// In some platforms it will not create the desired window size, so we query the real window size
|
||||
// created
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 1 )
|
||||
int w, h;
|
||||
SDL_GL_GetDrawableSize( mSDLWindow, &w, &h );
|
||||
|
||||
if ( w > 0 && h > 0 ) {
|
||||
mWindow.WindowConfig.Width = w;
|
||||
mWindow.WindowConfig.Height = h;
|
||||
mWindow.WindowSize = Sizei( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height );
|
||||
} else {
|
||||
eePRINTL( "Window failed to create!" );
|
||||
|
||||
if ( NULL != SDL_GetError() ) {
|
||||
eePRINTL( "Error: %s", SDL_GetError() );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS
|
||||
eePRINTL( "Choosing GL Version from: %d", Context.Version );
|
||||
|
||||
@@ -352,8 +323,8 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) {
|
||||
if ( mWindow.ContextConfig.SharedGLContext ) {
|
||||
SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1 );
|
||||
|
||||
mGLContext = SDL_GL_CreateContext( mSDLWindow );
|
||||
mGLContextThread = SDL_GL_CreateContext( mSDLWindow );
|
||||
mGLContext = SDL_GL_CreateContext( mSDLWindow );
|
||||
} else {
|
||||
mGLContext = SDL_GL_CreateContext( mSDLWindow );
|
||||
}
|
||||
@@ -374,6 +345,25 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// In some platforms it will not create the desired window size, so we query the real window
|
||||
// size created
|
||||
int w, h;
|
||||
SDL_GL_GetDrawableSize( mSDLWindow, &w, &h );
|
||||
|
||||
if ( w > 0 && h > 0 ) {
|
||||
mWindow.WindowConfig.Width = w;
|
||||
mWindow.WindowConfig.Height = h;
|
||||
mWindow.WindowSize = Sizei( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height );
|
||||
} else {
|
||||
eePRINTL( "Window failed to create!" );
|
||||
|
||||
if ( NULL != SDL_GetError() ) {
|
||||
eePRINTL( "Error: %s", SDL_GetError() );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN
|
||||
SDL_GL_SetSwapInterval( ( mWindow.ContextConfig.VSync ? 1 : 0 ) ); // VSync
|
||||
#endif
|
||||
@@ -770,26 +760,18 @@ const Sizei& WindowSDL::getDesktopResolution() {
|
||||
}
|
||||
|
||||
Rect WindowSDL::getBorderSize() {
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 5 )
|
||||
Rect bordersSize;
|
||||
SDL_GetWindowBordersSize( mSDLWindow, &bordersSize.Top, &bordersSize.Left, &bordersSize.Bottom,
|
||||
&bordersSize.Right );
|
||||
return bordersSize;
|
||||
#else
|
||||
return Rect();
|
||||
#endif
|
||||
}
|
||||
|
||||
Float WindowSDL::getScale() {
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 1 )
|
||||
int realX, realY;
|
||||
int scaledX, scaledY;
|
||||
SDL_GL_GetDrawableSize( mSDLWindow, &realX, &realY );
|
||||
SDL_GetWindowSize( mSDLWindow, &scaledX, &scaledY );
|
||||
return (Float)realX / (Float)scaledX;
|
||||
#else
|
||||
return 1.f;
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_Window* WindowSDL::GetSDLWindow() const {
|
||||
|
||||
@@ -558,7 +558,7 @@ void EETest::createBaseUI() {
|
||||
Menu->getItem( "Quit" )->addEventListener( Event::MouseUp,
|
||||
cb::Make1( this, &EETest::onQuitClick ) );
|
||||
|
||||
SceneManager::instance()->getUISceneNode()->addEventListener(
|
||||
SceneManager::instance()->getUISceneNode()->getRoot()->addEventListener(
|
||||
Event::MouseClick, cb::Make1( this, &EETest::onMainClick ) );
|
||||
|
||||
#ifdef EE_PLATFORM_TOUCH
|
||||
|
||||
Reference in New Issue
Block a user