diff --git a/src/video/wiiu/SDL_wiiuvideo.c b/src/video/wiiu/SDL_wiiuvideo.c index 93717f7bd..505043f5e 100644 --- a/src/video/wiiu/SDL_wiiuvideo.c +++ b/src/video/wiiu/SDL_wiiuvideo.c @@ -32,6 +32,7 @@ #include "SDL_events.h" #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_keyboard_c.h" +#include "SDL_wiiuvideo.h" #include #include @@ -56,7 +57,6 @@ static int WIIU_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *forma static int WIIU_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); static void WIIU_DestroyWindowFramebuffer(_THIS, SDL_Window *window); -#define WIIU_DATA "_SDL_WiiUData" #define SCREEN_WIDTH 1280 #define SCREEN_HEIGHT 720 @@ -68,12 +68,6 @@ static const float tex_coord_vb[] = 0.0f, 0.0f, }; -typedef struct -{ - SDL_Surface *surface; - GX2Texture texture; -} WIIU_WindowData; - static GX2RBuffer tex_coord_buffer = { GX2R_RESOURCE_BIND_VERTEX_BUFFER | GX2R_RESOURCE_USAGE_CPU_READ | @@ -177,7 +171,7 @@ static int WIIU_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *forma *pixels = data->surface->pixels; *pitch = data->surface->pitch; - SDL_SetWindowData(window, WIIU_DATA, data); + SDL_SetWindowData(window, WIIU_WINDOW_DATA, data); // inform SDL we're ready to accept inputs SDL_SetKeyboardFocus(window); @@ -201,7 +195,7 @@ static void render_scene(WIIU_WindowData *data) { static int WIIU_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { - WIIU_WindowData *data = (WIIU_WindowData *) SDL_GetWindowData(window, WIIU_DATA); + WIIU_WindowData *data = (WIIU_WindowData *) SDL_GetWindowData(window, WIIU_WINDOW_DATA); float* buffer; int int_x, int_y, int_w, int_h; float x, y, w, h; @@ -257,7 +251,7 @@ static int WIIU_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rec static void WIIU_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { - WIIU_WindowData *data = (WIIU_WindowData*) SDL_GetWindowData(window, WIIU_DATA); + WIIU_WindowData *data = (WIIU_WindowData*) SDL_GetWindowData(window, WIIU_WINDOW_DATA); SDL_FreeSurface(data->surface); MEMFreeToDefaultHeap(data->texture.surface.image); SDL_free(data); diff --git a/src/video/wiiu/SDL_wiiuvideo.h b/src/video/wiiu/SDL_wiiuvideo.h new file mode 100644 index 000000000..e0c7fe318 --- /dev/null +++ b/src/video/wiiu/SDL_wiiuvideo.h @@ -0,0 +1,37 @@ +/* + Simple DirectMedia Layer + Copyright (C) 2018-2018 Ash Logan + Copyright (C) 2018-2018 Roberto Van Eeden + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "../../SDL_internal.h" + +#ifndef SDL_wiiuvideo_h +#define SDL_wiiuvideo_h + +#include + +#define WIIU_WINDOW_DATA "_SDL_WiiUData" +typedef struct +{ + SDL_Surface *surface; + GX2Texture texture; +} WIIU_WindowData; + +#endif //SDL_wiiuvideo_h