mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-11 15:45:05 +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;
|
||||
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() {
|
||||
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
if (display == EGL_NO_DISPLAY)
|
||||
@@ -144,6 +158,10 @@ bool eglInit() {
|
||||
if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE)
|
||||
return false;
|
||||
|
||||
configureResolution();
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
eglSwapBuffers(display, surface);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -155,19 +173,6 @@ void eglFree() {
|
||||
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
|
||||
bool osJoyReady(int index) {
|
||||
return index == 0;
|
||||
|
Reference in New Issue
Block a user