Format tweaks

This commit is contained in:
Ray 2023-10-09 11:07:02 +02:00
parent a38afcf053
commit b55cf40b91
7 changed files with 70 additions and 61 deletions

View file

@ -48,9 +48,9 @@
#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/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 <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
//----------------------------------------------------------------------------------
// Module Functions Definition
// Module Functions Definition: Application
//----------------------------------------------------------------------------------
// 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.height = height;
// Platform specific init window
//--------------------------------------------------------------
// Set desired windows flags before initializing anything
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
#endif
// Platform specific close window
//--------------------------------------------------------------
// Close surface, context and display
if (platform.device != EGL_NO_DISPLAY)
{
@ -289,6 +293,7 @@ void CloseWindow(void)
eglTerminate(platform.device);
platform.device = EGL_NO_DISPLAY;
}
//--------------------------------------------------------------
#if defined(SUPPORT_EVENTS_AUTOMATION)
RL_FREE(events);

View file

@ -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.cursor = MOUSE_CURSOR_ARROW;
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
CORE.Window.eventWaiting = false;
CORE.Window.eventWaiting = false;
CORE.Window.screen.width = width;
CORE.Window.screen.height = height;
CORE.Window.currentFbo.width = width;
@ -165,11 +165,10 @@ void CloseWindow(void)
rlglClose(); // De-init rlgl
#if defined(_WIN32) && defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP)
timeEndPeriod(1); // Restore time period
#endif
// TODO: Close surface, context and display
// Platform specific close window
//--------------------------------------------------------------
// TODO.
//--------------------------------------------------------------
#if defined(SUPPORT_EVENTS_AUTOMATION)
RL_FREE(events);

View file

@ -268,12 +268,15 @@ void CloseWindow(void)
rlglClose(); // De-init rlgl
// Platform specific close window
//--------------------------------------------------------------
glfwDestroyWindow(platform.handle);
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)
RL_FREE(events);

View file

@ -307,6 +307,8 @@ void CloseWindow(void)
timeEndPeriod(1); // Restore time period
#endif
// Platform specific close window
//--------------------------------------------------------------
if (platform.prevFB)
{
drmModeRmFB(platform.fd, platform.prevFB);
@ -392,6 +394,7 @@ void CloseWindow(void)
}
if (platform.gamepadThreadId) pthread_join(platform.gamepadThreadId, NULL);
//--------------------------------------------------------------
#if defined(SUPPORT_EVENTS_AUTOMATION)
RL_FREE(events);

View file

@ -282,12 +282,11 @@ void CloseWindow(void)
rlglClose(); // De-init rlgl
// Platform specific close window
//--------------------------------------------------------------
glfwDestroyWindow(platform.handle);
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)
RL_FREE(events);