early-access version 1988

This commit is contained in:
pineappleEA
2021-08-12 01:07:27 +02:00
parent e37f82ce96
commit 24ddfcbb39
265 changed files with 68343 additions and 5348 deletions

View File

@@ -20,8 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_VITA_PIB
#include <stdlib.h>
#include <string.h>
@@ -45,6 +44,23 @@
} \
} while (0)
void
VITA_GL_KeyboardCallback(ScePigletPreSwapData *data)
{
SceCommonDialogUpdateParam commonDialogParam;
SDL_zero(commonDialogParam);
commonDialogParam.renderTarget.colorFormat = data->colorFormat;
commonDialogParam.renderTarget.surfaceType = data->surfaceType;
commonDialogParam.renderTarget.colorSurfaceData = data->colorSurfaceData;
commonDialogParam.renderTarget.depthSurfaceData = data->depthSurfaceData;
commonDialogParam.renderTarget.width = data->width;
commonDialogParam.renderTarget.height = data->height;
commonDialogParam.renderTarget.strideInPixels = data->strideInPixels;
commonDialogParam.displaySyncObject = data->displaySyncObject;
sceCommonDialogUpdate(&commonDialogParam);
}
int
VITA_GL_LoadLibrary(_THIS, const char *path)
{
@@ -79,6 +95,7 @@ VITA_GL_CreateContext(_THIS, SDL_Window * window)
EGLSurface surface;
EGLConfig config;
EGLint num_configs;
PFNEGLPIGLETVITASETPRESWAPCALLBACKSCEPROC preSwapCallback;
int i;
const EGLint contextAttribs[] = {
@@ -141,6 +158,9 @@ VITA_GL_CreateContext(_THIS, SDL_Window * window)
_this->gl_data->context = context;
_this->gl_data->surface = surface;
preSwapCallback = (PFNEGLPIGLETVITASETPRESWAPCALLBACKSCEPROC) eglGetProcAddress("eglPigletVitaSetPreSwapCallbackSCE");
preSwapCallback(VITA_GL_KeyboardCallback);
return context;
}

View File

@@ -25,6 +25,7 @@
#include <pib.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

View File

@@ -33,11 +33,11 @@
int VITA_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{
#if SDL_VIDEO_RENDER_VITA_GXM
SceCommonDialogConfigParam commonDialogConfigParam;
SceMsgDialogParam param;
SceMsgDialogUserMessageParam msgParam;
SceMsgDialogButtonsParam buttonParam;
SceDisplayFrameBuf dispparam;
char message[512];
SceMsgDialogResult dialog_result;
SceCommonDialogErrorCode init_result;
@@ -47,14 +47,17 @@ int VITA_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{
return -1;
}
SDL_zero(commonDialogConfigParam);
sceCommonDialogSetConfigParam(&commonDialogConfigParam);
SDL_zero(param);
sceMsgDialogParamInit(&param);
param.mode = SCE_MSG_DIALOG_MODE_USER_MSG;
SDL_zero(msgParam);
msgParam.msg = (const SceChar8*)messageboxdata->message;
SDL_snprintf(message, sizeof(message), "%s\r\n\r\n%s", messageboxdata->title, messageboxdata->message);
msgParam.msg = (const SceChar8*)message;
SDL_zero(buttonParam);
if (messageboxdata->numbuttons == 3)
{
msgParam.buttonType = SCE_MSG_DIALOG_BUTTON_TYPE_3BUTTONS;

View File

@@ -65,7 +65,7 @@ VITA_InitTouch(void)
// Support passing both front and back touch devices in events
SDL_AddTouch((SDL_TouchID)0, SDL_TOUCH_DEVICE_DIRECT, "Front");
SDL_AddTouch((SDL_TouchID)1, SDL_TOUCH_DEVICE_DIRECT, "Back");
SDL_AddTouch((SDL_TouchID)1, SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, "Back");
}
void

View File

@@ -38,7 +38,7 @@
#include "SDL_vitakeyboard.h"
#include "SDL_vitamouse_c.h"
#include "SDL_vitaframebuffer.h"
#if SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_VITA_PIB
#include "SDL_vitagl_c.h"
#endif
#include <psp2/ime_dialog.h>
@@ -62,7 +62,7 @@ VITA_Create()
{
SDL_VideoDevice *device;
SDL_VideoData *phdata;
#if SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_VITA_PIB
SDL_GLDriverData *gldata;
#endif
/* Initialize SDL_VideoDevice structure */
@@ -79,7 +79,7 @@ VITA_Create()
SDL_free(device);
return NULL;
}
#if SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_VITA_PIB
gldata = (SDL_GLDriverData *) SDL_calloc(1, sizeof(SDL_GLDriverData));
if (gldata == NULL) {
@@ -130,7 +130,7 @@ VITA_Create()
device->DestroyWindowFramebuffer = VITA_DestroyWindowFramebuffer;
*/
#if SDL_VIDEO_OPENGL_ES2
#if SDL_VIDEO_VITA_PIB
device->GL_LoadLibrary = VITA_GL_LoadLibrary;
device->GL_GetProcAddress = VITA_GL_GetProcAddress;
device->GL_UnloadLibrary = VITA_GL_UnloadLibrary;
@@ -418,6 +418,7 @@ void VITA_PumpEvents(_THIS)
{
SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
VITA_PollTouch();
VITA_PollKeyboard();
VITA_PollMouse();
@@ -435,9 +436,13 @@ void VITA_PumpEvents(_THIS)
// Convert UTF16 to UTF8
utf16_to_utf8(videodata->ime_buffer, utf8_buffer);
// send sdl event
// Send SDL event
SDL_SendKeyboardText((const char*)utf8_buffer);
// Send enter key only on enter
if (result.button == SCE_IME_DIALOG_BUTTON_ENTER)
SDL_SendKeyboardKeyAutoRelease(SDL_SCANCODE_RETURN);
sceImeDialogTerm();
videodata->ime_active = SDL_FALSE;
@@ -449,3 +454,4 @@ void VITA_PumpEvents(_THIS)
#endif /* SDL_VIDEO_DRIVER_VITA */
/* vi: set ts=4 sw=4 expandtab: */