mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-11 07:34:33 +02:00
fix memory leak in UI; #15 nx clear screen right after context initialization
This commit is contained in:
@@ -95,6 +95,20 @@ EGLSurface surface;
|
|||||||
EGLContext context;
|
EGLContext context;
|
||||||
NWindow *window;
|
NWindow *window;
|
||||||
|
|
||||||
|
void configureResolution() {
|
||||||
|
if (appletGetOperationMode() == AppletOperationMode_Docked) {
|
||||||
|
Core::width = 1920;
|
||||||
|
Core::height = 1080;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Core::width = 1280;
|
||||||
|
Core::height = 720;
|
||||||
|
}
|
||||||
|
|
||||||
|
int offset = 1080 - Core::height;
|
||||||
|
nwindowSetCrop(window, 0, offset, Core::width, Core::height + offset);
|
||||||
|
}
|
||||||
|
|
||||||
bool eglInit() {
|
bool eglInit() {
|
||||||
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||||
if (display == EGL_NO_DISPLAY)
|
if (display == EGL_NO_DISPLAY)
|
||||||
@@ -144,6 +158,10 @@ bool eglInit() {
|
|||||||
if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE)
|
if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
configureResolution();
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
eglSwapBuffers(display, surface);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,19 +173,6 @@ void eglFree() {
|
|||||||
eglReleaseThread();
|
eglReleaseThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureResolution() {
|
|
||||||
if (appletGetOperationMode() == AppletOperationMode_Docked) {
|
|
||||||
Core::width = 1920;
|
|
||||||
Core::height = 1080;
|
|
||||||
} else {
|
|
||||||
Core::width = 1280;
|
|
||||||
Core::height = 720;
|
|
||||||
}
|
|
||||||
|
|
||||||
int offset = 1080 - Core::height;
|
|
||||||
nwindowSetCrop(window, 0, offset, Core::width, Core::height + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
bool osJoyReady(int index) {
|
bool osJoyReady(int index) {
|
||||||
return index == 0;
|
return index == 0;
|
||||||
|
Reference in New Issue
Block a user