Atlas - SDL_vitavideo.h
Home / ext / SDL / src / video / vita Lines: 1 | Size: 4733 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 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 34#ifdef SDL_VIDEO_VITA_PIB 35#include <psp2/gxm.h> 36#include <psp2/display.h> 37#include <pib.h> 38#include <EGL/egl.h> 39#include <EGL/eglext.h> 40#include <GLES2/gl2.h> 41#include <GLES2/gl2ext.h> 42typedef struct SDL_GLDriverData 43{ 44 EGLDisplay display; 45 EGLContext context; 46 EGLSurface surface; 47 uint32_t swapinterval; 48} SDL_GLDriverData; 49#endif 50 51struct SDL_VideoData 52{ 53 bool egl_initialized; // OpenGL device initialization status 54 uint32_t egl_refcount; // OpenGL reference count 55 56 SceWChar16 ime_buffer[SCE_IME_DIALOG_MAX_TEXT_LENGTH]; 57 bool ime_active; 58}; 59 60struct SDL_WindowData 61{ 62 bool uses_gles; 63 SceUID buffer_uid; 64 void *buffer; 65#ifdef SDL_VIDEO_VITA_PVR 66 EGLSurface egl_surface; 67 EGLContext egl_context; 68#endif 69}; 70 71extern SDL_Window *Vita_Window; 72 73/****************************************************************************/ 74// SDL_VideoDevice functions declaration 75/****************************************************************************/ 76 77// Display and window functions 78extern bool VITA_VideoInit(SDL_VideoDevice *_this); 79extern void VITA_VideoQuit(SDL_VideoDevice *_this); 80extern bool VITA_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props); 81extern void VITA_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); 82extern bool VITA_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); 83extern void VITA_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); 84extern void VITA_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); 85extern void VITA_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); 86extern void VITA_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); 87extern void VITA_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); 88extern void VITA_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); 89extern void VITA_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); 90extern bool VITA_SetWindowGrab(SDL_VideoDevice *_this, SDL_Window *window, bool grabbed); 91extern void VITA_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); 92 93#ifdef SDL_VIDEO_DRIVER_VITA 94#ifdef SDL_VIDEO_VITA_PVR_OGL 95// OpenGL functions 96extern bool VITA_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); 97extern SDL_GLContext VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); 98extern SDL_FunctionPointer VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); 99#endif 100 101// OpenGLES functions 102extern bool VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); 103extern SDL_FunctionPointer VITA_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc); 104extern void VITA_GLES_UnloadLibrary(SDL_VideoDevice *_this); 105extern SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); 106extern bool VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); 107extern bool VITA_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval); 108extern bool VITA_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval); 109extern bool VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); 110extern bool VITA_GLES_DestroyContext(SDL_VideoDevice *_this, SDL_GLContext context); 111#endif 112 113// VITA on screen keyboard 114extern bool VITA_HasScreenKeyboardSupport(SDL_VideoDevice *_this); 115extern void VITA_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID props); 116extern void VITA_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); 117 118extern void VITA_PumpEvents(SDL_VideoDevice *_this); 119 120#endif // SDL_pspvideo_h 121[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.