Format tweaks
This commit is contained in:
parent
a38afcf053
commit
b55cf40b91
7 changed files with 70 additions and 61 deletions
|
@ -48,9 +48,9 @@
|
||||||
|
|
||||||
#include "rcore.h"
|
#include "rcore.h"
|
||||||
|
|
||||||
//#include <android/sensor.h> // Required for: Android sensors functions (accelerometer, gyroscope, light...)
|
|
||||||
#include <android/window.h> // Required for: AWINDOW_FLAG_FULLSCREEN definition and others
|
|
||||||
#include <android_native_app_glue.h> // Required for: android_app struct and activity management
|
#include <android_native_app_glue.h> // Required for: android_app struct and activity management
|
||||||
|
#include <android/window.h> // Required for: AWINDOW_FLAG_FULLSCREEN definition and others
|
||||||
|
//#include <android/sensor.h> // Required for: Android sensors functions (accelerometer, gyroscope, light...)
|
||||||
#include <jni.h> // Required for: JNIEnv and JavaVM [Used in OpenURL()]
|
#include <jni.h> // Required for: JNIEnv and JavaVM [Used in OpenURL()]
|
||||||
|
|
||||||
#include <EGL/egl.h> // Native platform windowing system interface
|
#include <EGL/egl.h> // Native platform windowing system interface
|
||||||
|
@ -94,7 +94,7 @@ static GamepadButton AndroidTranslateGamepadButton(int button);
|
||||||
// NOTE: Functions declaration is provided by raylib.h
|
// NOTE: Functions declaration is provided by raylib.h
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Module Functions Definition
|
// Module Functions Definition: Application
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// To allow easier porting to android, we allow the user to define a
|
// To allow easier porting to android, we allow the user to define a
|
||||||
|
@ -188,6 +188,8 @@ void InitWindow(int width, int height, const char *title)
|
||||||
CORE.Window.currentFbo.width = width;
|
CORE.Window.currentFbo.width = width;
|
||||||
CORE.Window.currentFbo.height = height;
|
CORE.Window.currentFbo.height = height;
|
||||||
|
|
||||||
|
// Platform specific init window
|
||||||
|
//--------------------------------------------------------------
|
||||||
// Set desired windows flags before initializing anything
|
// Set desired windows flags before initializing anything
|
||||||
ANativeActivity_setWindowFlags(platform.app->activity, AWINDOW_FLAG_FULLSCREEN, 0); //AWINDOW_FLAG_SCALED, AWINDOW_FLAG_DITHER
|
ANativeActivity_setWindowFlags(platform.app->activity, AWINDOW_FLAG_FULLSCREEN, 0); //AWINDOW_FLAG_SCALED, AWINDOW_FLAG_DITHER
|
||||||
|
|
||||||
|
@ -269,6 +271,8 @@ void CloseWindow(void)
|
||||||
timeEndPeriod(1); // Restore time period
|
timeEndPeriod(1); // Restore time period
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Platform specific close window
|
||||||
|
//--------------------------------------------------------------
|
||||||
// Close surface, context and display
|
// Close surface, context and display
|
||||||
if (platform.device != EGL_NO_DISPLAY)
|
if (platform.device != EGL_NO_DISPLAY)
|
||||||
{
|
{
|
||||||
|
@ -289,6 +293,7 @@ void CloseWindow(void)
|
||||||
eglTerminate(platform.device);
|
eglTerminate(platform.device);
|
||||||
platform.device = EGL_NO_DISPLAY;
|
platform.device = EGL_NO_DISPLAY;
|
||||||
}
|
}
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
||||||
RL_FREE(events);
|
RL_FREE(events);
|
||||||
|
|
|
@ -128,8 +128,8 @@ void InitWindow(int width, int height, const char *title)
|
||||||
CORE.Input.Mouse.scale = (Vector2){ 1.0f, 1.0f };
|
CORE.Input.Mouse.scale = (Vector2){ 1.0f, 1.0f };
|
||||||
CORE.Input.Mouse.cursor = MOUSE_CURSOR_ARROW;
|
CORE.Input.Mouse.cursor = MOUSE_CURSOR_ARROW;
|
||||||
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
|
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
|
||||||
CORE.Window.eventWaiting = false;
|
|
||||||
|
|
||||||
|
CORE.Window.eventWaiting = false;
|
||||||
CORE.Window.screen.width = width;
|
CORE.Window.screen.width = width;
|
||||||
CORE.Window.screen.height = height;
|
CORE.Window.screen.height = height;
|
||||||
CORE.Window.currentFbo.width = width;
|
CORE.Window.currentFbo.width = width;
|
||||||
|
@ -165,11 +165,10 @@ void CloseWindow(void)
|
||||||
|
|
||||||
rlglClose(); // De-init rlgl
|
rlglClose(); // De-init rlgl
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP)
|
// Platform specific close window
|
||||||
timeEndPeriod(1); // Restore time period
|
//--------------------------------------------------------------
|
||||||
#endif
|
// TODO.
|
||||||
|
//--------------------------------------------------------------
|
||||||
// TODO: Close surface, context and display
|
|
||||||
|
|
||||||
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
||||||
RL_FREE(events);
|
RL_FREE(events);
|
||||||
|
|
|
@ -268,12 +268,15 @@ void CloseWindow(void)
|
||||||
|
|
||||||
rlglClose(); // De-init rlgl
|
rlglClose(); // De-init rlgl
|
||||||
|
|
||||||
|
// Platform specific close window
|
||||||
|
//--------------------------------------------------------------
|
||||||
glfwDestroyWindow(platform.handle);
|
glfwDestroyWindow(platform.handle);
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP)
|
#if defined(_WIN32) && defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP)
|
||||||
timeEndPeriod(1); // Restore time period
|
timeEndPeriod(1); // Restore time period
|
||||||
#endif
|
#endif
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
||||||
RL_FREE(events);
|
RL_FREE(events);
|
||||||
|
|
|
@ -307,6 +307,8 @@ void CloseWindow(void)
|
||||||
timeEndPeriod(1); // Restore time period
|
timeEndPeriod(1); // Restore time period
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Platform specific close window
|
||||||
|
//--------------------------------------------------------------
|
||||||
if (platform.prevFB)
|
if (platform.prevFB)
|
||||||
{
|
{
|
||||||
drmModeRmFB(platform.fd, platform.prevFB);
|
drmModeRmFB(platform.fd, platform.prevFB);
|
||||||
|
@ -392,6 +394,7 @@ void CloseWindow(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platform.gamepadThreadId) pthread_join(platform.gamepadThreadId, NULL);
|
if (platform.gamepadThreadId) pthread_join(platform.gamepadThreadId, NULL);
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
||||||
RL_FREE(events);
|
RL_FREE(events);
|
||||||
|
|
|
@ -282,12 +282,11 @@ void CloseWindow(void)
|
||||||
|
|
||||||
rlglClose(); // De-init rlgl
|
rlglClose(); // De-init rlgl
|
||||||
|
|
||||||
|
// Platform specific close window
|
||||||
|
//--------------------------------------------------------------
|
||||||
glfwDestroyWindow(platform.handle);
|
glfwDestroyWindow(platform.handle);
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
|
//--------------------------------------------------------------
|
||||||
#if defined(_WIN32) && defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP)
|
|
||||||
timeEndPeriod(1); // Restore time period
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
#if defined(SUPPORT_EVENTS_AUTOMATION)
|
||||||
RL_FREE(events);
|
RL_FREE(events);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue