summaryrefslogtreecommitdiffhomepage
path: root/src/platforms/rcore_template.c
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-23 19:15:40 +0200
committerRay <[email protected]>2023-10-23 19:15:40 +0200
commita0f00343523a8898dfed46ee21afaa99d0c15f66 (patch)
tree7097c237852e6b7b7f2538002b9fd040eb8711c1 /src/platforms/rcore_template.c
parent3ff60269174d0f264c152875be4d1808b7fe0195 (diff)
downloadraylib-a0f00343523a8898dfed46ee21afaa99d0c15f66.tar.gz
raylib-a0f00343523a8898dfed46ee21afaa99d0c15f66.zip
REVIEWED: `InitPlatform()` organization and code-gardening
Diffstat (limited to 'src/platforms/rcore_template.c')
-rw-r--r--src/platforms/rcore_template.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c
index 08210289..11ce45c1 100644
--- a/src/platforms/rcore_template.c
+++ b/src/platforms/rcore_template.c
@@ -518,13 +518,27 @@ int InitPlatform(void)
EGLBoolean result = eglMakeCurrent(platform.device, platform.surface, platform.surface, platform.context);
- // Enabling current display surface and context failed
- if (result == EGL_FALSE)
+ // Check surface and context activation
+ if (result != EGL_FALSE)
{
- TRACELOG(LOG_WARNING, "DISPLAY: Failed to attach EGL rendering context to EGL surface");
+ CORE.Window.ready = true;
+
+ CORE.Window.render.width = CORE.Window.screen.width;
+ CORE.Window.render.height = CORE.Window.screen.height;
+ CORE.Window.currentFbo.width = CORE.Window.render.width;
+ CORE.Window.currentFbo.height = CORE.Window.render.height;
+
+ TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully");
+ TRACELOG(LOG_INFO, " > Display size: %i x %i", CORE.Window.display.width, CORE.Window.display.height);
+ TRACELOG(LOG_INFO, " > Screen size: %i x %i", CORE.Window.screen.width, CORE.Window.screen.height);
+ TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height);
+ TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y);
+ }
+ else
+ {
+ TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize graphics device");
return -1;
}
- else CORE.Window.ready = true;
//----------------------------------------------------------------------------
// If everything work as expected, we can continue
@@ -545,7 +559,7 @@ int InitPlatform(void)
rlLoadExtensions(eglGetProcAddress);
//----------------------------------------------------------------------------
- // TODO: Initialize input system
+ // TODO: Initialize input events system
// It could imply keyboard, mouse, gamepad, touch...
// Depending on the platform libraries/SDK it could use a callbacks mechanims
// For system events and inputs evens polling on a per-frame basis, use PollInputEvents()
@@ -553,15 +567,17 @@ int InitPlatform(void)
// ...
//----------------------------------------------------------------------------
- // TODO: Initialize hi-res timer
+ // TODO: Initialize timming system
//----------------------------------------------------------------------------
InitTimer();
//----------------------------------------------------------------------------
- // TODO: Initialize base path for storage
+ // TODO: Initialize storage system
//----------------------------------------------------------------------------
CORE.Storage.basePath = GetWorkingDirectory();
//----------------------------------------------------------------------------
+
+ TRACELOG(LOG_INFO, "PLATFORM: CUSTOM: Initialized successfully");
return 0;
}