summaryrefslogtreecommitdiff
path: root/contrib/SDL-3.2.8/src/video/vita/SDL_vitavideo.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/SDL-3.2.8/src/video/vita/SDL_vitavideo.h')
-rw-r--r--contrib/SDL-3.2.8/src/video/vita/SDL_vitavideo.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/video/vita/SDL_vitavideo.h b/contrib/SDL-3.2.8/src/video/vita/SDL_vitavideo.h
new file mode 100644
index 0000000..268bed8
--- /dev/null
+++ b/contrib/SDL-3.2.8/src/video/vita/SDL_vitavideo.h
@@ -0,0 +1,106 @@
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22#ifndef SDL_vitavideo_h
23#define SDL_vitavideo_h
24
25#include "SDL_internal.h"
26#include "../SDL_sysvideo.h"
27#include "../SDL_egl_c.h"
28
29#include <psp2/types.h>
30#include <psp2/display.h>
31#include <psp2/ime_dialog.h>
32#include <psp2/sysmodule.h>
33
34struct SDL_VideoData
35{
36 bool egl_initialized; // OpenGL device initialization status
37 uint32_t egl_refcount; // OpenGL reference count
38
39 SceWChar16 ime_buffer[SCE_IME_DIALOG_MAX_TEXT_LENGTH];
40 bool ime_active;
41};
42
43struct SDL_WindowData
44{
45 bool uses_gles;
46 SceUID buffer_uid;
47 void *buffer;
48#ifdef SDL_VIDEO_VITA_PVR
49 EGLSurface egl_surface;
50 EGLContext egl_context;
51#endif
52};
53
54extern SDL_Window *Vita_Window;
55
56/****************************************************************************/
57// SDL_VideoDevice functions declaration
58/****************************************************************************/
59
60// Display and window functions
61extern bool VITA_VideoInit(SDL_VideoDevice *_this);
62extern void VITA_VideoQuit(SDL_VideoDevice *_this);
63extern bool VITA_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
64extern bool VITA_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
65extern bool VITA_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props);
66extern void VITA_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window);
67extern bool VITA_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window);
68extern void VITA_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window);
69extern void VITA_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window);
70extern void VITA_HideWindow(SDL_VideoDevice *_this, SDL_Window *window);
71extern void VITA_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window);
72extern void VITA_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
73extern void VITA_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
74extern void VITA_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window);
75extern bool VITA_SetWindowGrab(SDL_VideoDevice *_this, SDL_Window *window, bool grabbed);
76extern void VITA_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
77
78#ifdef SDL_VIDEO_DRIVER_VITA
79#ifdef SDL_VIDEO_VITA_PVR_OGL
80// OpenGL functions
81extern bool VITA_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path);
82extern SDL_GLContext VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
83extern SDL_FunctionPointer VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc);
84#endif
85
86// OpenGLES functions
87extern bool VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path);
88extern SDL_FunctionPointer VITA_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc);
89extern void VITA_GLES_UnloadLibrary(SDL_VideoDevice *_this);
90extern SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
91extern bool VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
92extern bool VITA_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval);
93extern bool VITA_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval);
94extern bool VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
95extern bool VITA_GLES_DestroyContext(SDL_VideoDevice *_this, SDL_GLContext context);
96#endif
97
98// VITA on screen keyboard
99extern bool VITA_HasScreenKeyboardSupport(SDL_VideoDevice *_this);
100extern void VITA_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID props);
101extern void VITA_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window);
102extern bool VITA_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window);
103
104extern void VITA_PumpEvents(SDL_VideoDevice *_this);
105
106#endif // SDL_pspvideo_h