mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-12 01:15:39 +00:00
Harmony port: surface destroy
This commit is contained in:
parent
01fed59802
commit
a4b48d3e2e
1 changed files with 19 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#include "SDL3/SDL_video.h"
|
||||
#include "SDL_internal.h"
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
|
|
@ -328,6 +329,24 @@ static void OnSurfaceChangedCB(OH_NativeXComponent *component, void *window)
|
|||
}
|
||||
static void OnSurfaceDestroyedCB(OH_NativeXComponent *component, void *window)
|
||||
{
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
SDL_Window *win = _this->windows;
|
||||
while (win != NULL)
|
||||
{
|
||||
#ifdef SDL_VIDEO_OPENGL_EGL
|
||||
if (win->flags & SDL_WINDOW_OPENGL) {
|
||||
if (win->internal->egl_context)
|
||||
{
|
||||
SDL_EGL_DestroyContext(_this, win->internal->egl_context);
|
||||
}
|
||||
if (win->internal->egl_surface)
|
||||
{
|
||||
SDL_EGL_DestroySurface(_this, win->internal->egl_surface);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
win = win->next;
|
||||
}
|
||||
}
|
||||
static void onKeyEvent(OH_NativeXComponent *component, void *window)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue