forked from Xeeynamo/sonic-hybrid-rsdk
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,473 additions
and
0 deletions.
There are no files selected for viewing
529 changes: 529 additions & 0 deletions
529
sonic3air-main/framework/external/sdl/SDL2/src/video/kmsdrm/SDL_kmsdrmvulkan.c
Large diffs are not rendered by default.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
sonic3air-main/framework/external/sdl/SDL2/src/video/kmsdrm/SDL_kmsdrmvulkan.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2022 Sam Lantinga <[email protected]> | ||
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. | ||
*/ | ||
|
||
/* | ||
* @author Manuel Alfayate Corchere <[email protected]>. | ||
* Based on Jacob Lifshay's SDL_x11vulkan.c. | ||
*/ | ||
|
||
#include "../../SDL_internal.h" | ||
|
||
#ifndef SDL_kmsdrm_vulkan_h_ | ||
#define SDL_kmsdrm_vulkan_h_ | ||
|
||
#include "../SDL_vulkan_internal.h" | ||
#include "../SDL_sysvideo.h" | ||
|
||
#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_KMSDRM | ||
|
||
int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path); | ||
void KMSDRM_Vulkan_UnloadLibrary(_THIS); | ||
SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS, | ||
SDL_Window *window, | ||
unsigned *count, | ||
const char **names); | ||
void KMSDRM_Vulkan_GetDrawableSize(_THIS, SDL_Window *window, int *w, int *h); | ||
SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, | ||
SDL_Window *window, | ||
VkInstance instance, | ||
VkSurfaceKHR *surface); | ||
|
||
#endif | ||
|
||
#endif /* SDL_kmsdrm_vulkan_h_ */ | ||
|
||
/* vi: set ts=4 sw=4 expandtab: */ |
438 changes: 438 additions & 0 deletions
438
sonic3air-main/framework/external/sdl/SDL2/src/video/nacl/SDL_naclevents.c
Large diffs are not rendered by default.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
sonic3air-main/framework/external/sdl/SDL2/src/video/nacl/SDL_naclevents_c.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2022 Sam Lantinga <[email protected]> | ||
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_naclevents_c_h_ | ||
#define SDL_naclevents_c_h_ | ||
|
||
#include "SDL_naclvideo.h" | ||
|
||
extern void NACL_PumpEvents(_THIS); | ||
|
||
#endif /* SDL_naclevents_c_h_ */ |
24 changes: 24 additions & 0 deletions
24
sonic3air-main/framework/external/sdl/SDL2/src/video/nacl/SDL_naclglue.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2022 Sam Lantinga <[email protected]> | ||
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" | ||
|
||
#if SDL_VIDEO_DRIVER_NACL | ||
#endif /* SDL_VIDEO_DRIVER_NACL */ |
174 changes: 174 additions & 0 deletions
174
sonic3air-main/framework/external/sdl/SDL2/src/video/nacl/SDL_naclopengles.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2022 Sam Lantinga <[email protected]> | ||
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" | ||
|
||
#if SDL_VIDEO_DRIVER_NACL | ||
|
||
/* NaCl SDL video GLES 2 driver implementation */ | ||
|
||
#include "SDL_video.h" | ||
#include "SDL_naclvideo.h" | ||
|
||
#ifdef HAVE_DLOPEN | ||
#include "dlfcn.h" | ||
#endif | ||
|
||
#include "ppapi/gles2/gl2ext_ppapi.h" | ||
#include "ppapi_simple/ps.h" | ||
|
||
/* GL functions */ | ||
int | ||
NACL_GLES_LoadLibrary(_THIS, const char *path) | ||
{ | ||
/* FIXME: Support dynamic linking when PNACL supports it */ | ||
return glInitializePPAPI(PSGetInterface) == 0; | ||
} | ||
|
||
void * | ||
NACL_GLES_GetProcAddress(_THIS, const char *proc) | ||
{ | ||
#ifdef HAVE_DLOPEN | ||
return dlsym( 0 /* RTLD_DEFAULT */, proc); | ||
#else | ||
return NULL; | ||
#endif | ||
} | ||
|
||
void | ||
NACL_GLES_UnloadLibrary(_THIS) | ||
{ | ||
/* FIXME: Support dynamic linking when PNACL supports it */ | ||
glTerminatePPAPI(); | ||
} | ||
|
||
int | ||
NACL_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext sdl_context) | ||
{ | ||
SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; | ||
/* FIXME: Check threading issues...otherwise use a hardcoded _this->context across all threads */ | ||
driverdata->ppb_instance->BindGraphics(driverdata->instance, (PP_Resource) sdl_context); | ||
glSetCurrentContextPPAPI((PP_Resource) sdl_context); | ||
return 0; | ||
} | ||
|
||
SDL_GLContext | ||
NACL_GLES_CreateContext(_THIS, SDL_Window * window) | ||
{ | ||
SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; | ||
PP_Resource context, share_context = 0; | ||
/* 64 seems nice. */ | ||
Sint32 attribs[64]; | ||
int i = 0; | ||
|
||
if (_this->gl_config.share_with_current_context) { | ||
share_context = (PP_Resource) SDL_GL_GetCurrentContext(); | ||
} | ||
|
||
/* FIXME: Some ATTRIBS from PP_Graphics3DAttrib are not set here */ | ||
|
||
attribs[i++] = PP_GRAPHICS3DATTRIB_WIDTH; | ||
attribs[i++] = window->w; | ||
attribs[i++] = PP_GRAPHICS3DATTRIB_HEIGHT; | ||
attribs[i++] = window->h; | ||
attribs[i++] = PP_GRAPHICS3DATTRIB_RED_SIZE; | ||
attribs[i++] = _this->gl_config.red_size; | ||
attribs[i++] = PP_GRAPHICS3DATTRIB_GREEN_SIZE; | ||
attribs[i++] = _this->gl_config.green_size; | ||
attribs[i++] = PP_GRAPHICS3DATTRIB_BLUE_SIZE; | ||
attribs[i++] = _this->gl_config.blue_size; | ||
|
||
if (_this->gl_config.alpha_size) { | ||
attribs[i++] = PP_GRAPHICS3DATTRIB_ALPHA_SIZE; | ||
attribs[i++] = _this->gl_config.alpha_size; | ||
} | ||
|
||
/*if (_this->gl_config.buffer_size) { | ||
attribs[i++] = EGL_BUFFER_SIZE; | ||
attribs[i++] = _this->gl_config.buffer_size; | ||
}*/ | ||
|
||
attribs[i++] = PP_GRAPHICS3DATTRIB_DEPTH_SIZE; | ||
attribs[i++] = _this->gl_config.depth_size; | ||
|
||
if (_this->gl_config.stencil_size) { | ||
attribs[i++] = PP_GRAPHICS3DATTRIB_STENCIL_SIZE; | ||
attribs[i++] = _this->gl_config.stencil_size; | ||
} | ||
|
||
if (_this->gl_config.multisamplebuffers) { | ||
attribs[i++] = PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS; | ||
attribs[i++] = _this->gl_config.multisamplebuffers; | ||
} | ||
|
||
if (_this->gl_config.multisamplesamples) { | ||
attribs[i++] = PP_GRAPHICS3DATTRIB_SAMPLES; | ||
attribs[i++] = _this->gl_config.multisamplesamples; | ||
} | ||
|
||
attribs[i++] = PP_GRAPHICS3DATTRIB_NONE; | ||
|
||
context = driverdata->ppb_graphics->Create(driverdata->instance, share_context, attribs); | ||
|
||
if (context) { | ||
/* We need to make the context current, otherwise nothing works */ | ||
SDL_GL_MakeCurrent(window, (SDL_GLContext) context); | ||
} | ||
|
||
return (SDL_GLContext) context; | ||
} | ||
|
||
|
||
|
||
int | ||
NACL_GLES_SetSwapInterval(_THIS, int interval) | ||
{ | ||
/* STUB */ | ||
return SDL_Unsupported(); | ||
} | ||
|
||
int | ||
NACL_GLES_GetSwapInterval(_THIS) | ||
{ | ||
/* STUB */ | ||
return 0; | ||
} | ||
|
||
int | ||
NACL_GLES_SwapWindow(_THIS, SDL_Window * window) | ||
{ | ||
SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; | ||
struct PP_CompletionCallback callback = { NULL, 0, PP_COMPLETIONCALLBACK_FLAG_NONE }; | ||
if (driverdata->ppb_graphics->SwapBuffers((PP_Resource) SDL_GL_GetCurrentContext(), callback ) != 0) { | ||
return SDL_SetError("SwapBuffers failed"); | ||
} | ||
return 0; | ||
} | ||
|
||
void | ||
NACL_GLES_DeleteContext(_THIS, SDL_GLContext context) | ||
{ | ||
SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; | ||
driverdata->ppb_core->ReleaseResource((PP_Resource) context); | ||
} | ||
|
||
#endif /* SDL_VIDEO_DRIVER_NACL */ | ||
|
||
/* vi: set ts=4 sw=4 expandtab: */ |
38 changes: 38 additions & 0 deletions
38
sonic3air-main/framework/external/sdl/SDL2/src/video/nacl/SDL_naclopengles.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2022 Sam Lantinga <[email protected]> | ||
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_naclopengles_h_ | ||
#define SDL_naclopengles_h_ | ||
|
||
extern int NACL_GLES_LoadLibrary(_THIS, const char *path); | ||
extern void *NACL_GLES_GetProcAddress(_THIS, const char *proc); | ||
extern void NACL_GLES_UnloadLibrary(_THIS); | ||
extern SDL_GLContext NACL_GLES_CreateContext(_THIS, SDL_Window * window); | ||
extern int NACL_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); | ||
extern int NACL_GLES_SetSwapInterval(_THIS, int interval); | ||
extern int NACL_GLES_GetSwapInterval(_THIS); | ||
extern int NACL_GLES_SwapWindow(_THIS, SDL_Window * window); | ||
extern void NACL_GLES_DeleteContext(_THIS, SDL_GLContext context); | ||
|
||
#endif /* SDL_naclopengles_h_ */ | ||
|
||
/* vi: set ts=4 sw=4 expandtab: */ |
Oops, something went wrong.