| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | /* Set the function pointers */ |
| | | device->VideoInit = WINRT_VideoInit; |
| | | device->VideoQuit = WINRT_VideoQuit; |
| | | device->CreateWindow = WINRT_CreateWindow; |
| | | device->CreateSDLWindow = WINRT_CreateWindow; |
| | | device->SetWindowSize = WINRT_SetWindowSize; |
| | | device->SetWindowFullscreen = WINRT_SetWindowFullscreen; |
| | | device->DestroyWindow = WINRT_DestroyWindow; |
| | |
| | | _this->egl_data->egl_config, |
| | | cpp_winrtEglWindow, NULL); |
| | | if (data->egl_surface == NULL) { |
| | | return SDL_SetError("eglCreateWindowSurface failed"); |
| | | return SDL_EGL_SetError("unable to create EGL native-window surface", "eglCreateWindowSurface"); |
| | | } |
| | | } else if (data->coreWindow.Get() != nullptr) { |
| | | /* Attempt to create a window surface using newer versions of |
| | |
| | | coreWindowAsIInspectable, |
| | | NULL); |
| | | if (data->egl_surface == NULL) { |
| | | return SDL_SetError("eglCreateWindowSurface failed"); |
| | | return SDL_EGL_SetError("unable to create EGL native-window surface", "eglCreateWindowSurface"); |
| | | } |
| | | } else { |
| | | return SDL_SetError("No supported means to create an EGL window surface are available"); |
| | |
| | | info->info.winrt.window = reinterpret_cast<IInspectable *>(data->coreWindow.Get()); |
| | | return SDL_TRUE; |
| | | } else { |
| | | SDL_SetError("Application not compiled with SDL %d.%d\n", |
| | | SDL_SetError("Application not compiled with SDL %d.%d", |
| | | SDL_MAJOR_VERSION, SDL_MINOR_VERSION); |
| | | return SDL_FALSE; |
| | | } |