Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/platforms/rcore_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,10 @@ int InitPlatform(void)
//AConfiguration_getScreenLong(platform.app->config);

// Set some default window flags
CORE.Window.flags &= ~FLAG_WINDOW_HIDDEN; // false
CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // false
CORE.Window.flags |= FLAG_WINDOW_MAXIMIZED; // true
CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED; // false
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_HIDDEN); // false
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MINIMIZED); // false
FLAG_SET(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // true
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // false
//----------------------------------------------------------------------------

// Initialize App command system
Expand Down Expand Up @@ -883,11 +883,11 @@ void ClosePlatform(void)
static int InitGraphicsDevice(void)
{
CORE.Window.fullscreen = true;
CORE.Window.flags |= FLAG_FULLSCREEN_MODE;
FLAG_SET(CORE.Window.flags, FLAG_FULLSCREEN_MODE);

EGLint samples = 0;
EGLint sampleBuffer = 0;
if (CORE.Window.flags & FLAG_MSAA_4X_HINT)
if (FLAG_CHECK(CORE.Window.flags, FLAG_MSAA_4X_HINT) > 0)
{
samples = 4;
sampleBuffer = 1;
Expand Down Expand Up @@ -992,7 +992,7 @@ static int InitGraphicsDevice(void)

CORE.Window.ready = true;

if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) MinimizeWindow();
if (FLAG_CHECK(CORE.Window.flags, FLAG_WINDOW_MINIMIZED) > 0) MinimizeWindow();

return 0;
}
Expand Down Expand Up @@ -1059,7 +1059,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd)
// Set font white rectangle for shapes drawing, so shapes and text can be batched together
// WARNING: rshapes module is required, if not available, default internal white rectangle is used
Rectangle rec = GetFontDefault().recs[95];
if (CORE.Window.flags & FLAG_MSAA_4X_HINT)
if (FLAG_CHECK(CORE.Window.flags, FLAG_MSAA_4X_HINT) > 0)
{
// NOTE: We try to maxime rec padding to avoid pixel bleeding on MSAA filtering
SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 2, rec.y + 2, 1, 1 });
Expand Down Expand Up @@ -1102,14 +1102,14 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd)
case APP_CMD_GAINED_FOCUS:
{
platform.appEnabled = true;
CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED;
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED);
//ResumeMusicStream();
} break;
case APP_CMD_PAUSE: break;
case APP_CMD_LOST_FOCUS:
{
platform.appEnabled = false;
CORE.Window.flags |= FLAG_WINDOW_UNFOCUSED;
FLAG_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED);
//PauseMusicStream();
} break;
case APP_CMD_TERM_WINDOW:
Expand Down Expand Up @@ -1187,8 +1187,8 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)

if (type == AINPUT_EVENT_TYPE_MOTION)
{
if (((source & AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) ||
((source & AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD))
if ((FLAG_CHECK(source, AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) ||
(FLAG_CHECK(source, AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD))
{
// For now we'll assume a single gamepad which we "detect" on its input event
CORE.Input.Gamepad.ready[0] = true;
Expand Down Expand Up @@ -1251,8 +1251,8 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
//int32_t AKeyEvent_getMetaState(event);

// Handle gamepad button presses and releases
if (((source & AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) ||
((source & AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD))
if ((FLAG_CHECK(source, AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) ||
(FLAG_CHECK(source, AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD))
{
// For now we'll assume a single gamepad which we "detect" on its input event
CORE.Input.Gamepad.ready[0] = true;
Expand Down
166 changes: 83 additions & 83 deletions src/platforms/rcore_desktop_glfw.c

Large diffs are not rendered by default.

Loading
Loading