Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
fe5870f0
Commit
fe5870f0
authored
Jul 21, 2021
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#ifdef _IRR_ANDROID_PLATFORM_
parent
342dca22
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+11
-0
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp
+15
-0
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.h
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.h
+8
-0
No files found.
Classes/gframe/game.cpp
View file @
fe5870f0
...
...
@@ -39,6 +39,15 @@ void Game::process(irr::SEvent &event) {
}
#ifdef _IRR_ANDROID_PLATFORM_
void
onActivityLifeChanged
(
struct
android_app
*
app
,
int32_t
status
){
//status ==
//ANDROID_ACTIVITY_RESUME 1
//ANDROID_ACTIVITY_STOP 2
// ANDROID_ACTIVITY_PAUSE 5
//ANDROID_ACTIVITY_DESTROY 3
//ANDROID_ACTIVITY_FOCUS 4
}
bool
Game
::
Initialize
(
ANDROID_APP
app
,
android
::
InitOptions
*
options
)
{
this
->
appMain
=
app
;
#endif
...
...
@@ -72,6 +81,8 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
device
->
setProcessReceiver
(
this
);
app
->
onInputEvent
=
android
::
handleInput
;
((
CIrrDeviceAndroid
*
)
device
)
->
onActivityLifeChanged
=
onActivityLifeChanged
;
ILogger
*
logger
=
device
->
getLogger
();
// logger->setLogLevel(ELL_WARNING);
isPSEnabled
=
options
->
isPendulumScaleEnabled
();
...
...
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp
View file @
fe5870f0
...
...
@@ -279,21 +279,36 @@ void CIrrDeviceAndroid::handleAndroidCommand(ANDROID_APP app, int32_t cmd)
case
APP_CMD_LOST_FOCUS
:
os
::
Printer
::
log
(
"Android command APP_CMD_LOST_FOCUS"
,
ELL_DEBUG
);
device
->
Focused
=
false
;
if
(
device
->
onActivityLifeChanged
!=
nullptr
){
device
->
onActivityLifeChanged
(
app
,
ANDROID_ACTIVITY_FOCUS
);
}
break
;
case
APP_CMD_DESTROY
:
os
::
Printer
::
log
(
"Android command APP_CMD_DESTROY"
,
ELL_DEBUG
);
device
->
Initialized
=
false
;
if
(
device
->
onActivityLifeChanged
!=
nullptr
){
device
->
onActivityLifeChanged
(
app
,
ANDROID_ACTIVITY_DESTROY
);
}
break
;
case
APP_CMD_PAUSE
:
os
::
Printer
::
log
(
"Android command APP_CMD_PAUSE"
,
ELL_DEBUG
);
device
->
Paused
=
true
;
if
(
device
->
onActivityLifeChanged
!=
nullptr
){
device
->
onActivityLifeChanged
(
app
,
ANDROID_ACTIVITY_PAUSE
);
}
break
;
case
APP_CMD_STOP
:
os
::
Printer
::
log
(
"Android command APP_CMD_STOP"
,
ELL_DEBUG
);
if
(
device
->
onActivityLifeChanged
!=
nullptr
){
device
->
onActivityLifeChanged
(
app
,
ANDROID_ACTIVITY_STOP
);
}
break
;
case
APP_CMD_RESUME
:
os
::
Printer
::
log
(
"Android command APP_CMD_RESUME"
,
ELL_DEBUG
);
device
->
Paused
=
false
;
if
(
device
->
onActivityLifeChanged
!=
nullptr
){
device
->
onActivityLifeChanged
(
app
,
ANDROID_ACTIVITY_RESUME
);
}
break
;
case
APP_CMD_WINDOW_RESIZED
:
os
::
Printer
::
log
(
"Android command APP_CMD_WINDOW_RESIZED"
,
ELL_DEBUG
);
...
...
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.h
View file @
fe5870f0
...
...
@@ -17,6 +17,12 @@
#include <android/sensor.h>
#include <android_native_app_glue.h>
#define ANDROID_ACTIVITY_RESUME 1
#define ANDROID_ACTIVITY_STOP 2
#define ANDROID_ACTIVITY_PAUSE 5
#define ANDROID_ACTIVITY_DESTROY 3
#define ANDROID_ACTIVITY_FOCUS 4
namespace
irr
{
class
CIrrDeviceAndroid
:
public
CIrrDeviceStub
,
video
::
IImagePresenter
...
...
@@ -52,6 +58,8 @@ namespace irr
virtual
void
restoreWindow
();
void
(
*
onActivityLifeChanged
)(
struct
android_app
*
app
,
int32_t
status
);
virtual
core
::
position2di
getWindowPosition
();
virtual
E_DEVICE_TYPE
getType
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment