mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 18:40:09 +00:00
(Vita) Start vita2d_gfx video driver
This commit is contained in:
parent
8f4b4c55b2
commit
3b54e81d00
@ -80,6 +80,11 @@ static void frontend_vita_get_environment_settings(int *argc, char *argv[],
|
||||
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.remap,
|
||||
"remaps", sizeof(g_defaults.dir.remap));
|
||||
|
||||
struct rarch_main_wrap *params = NULL;
|
||||
params = (struct rarch_main_wrap*)params_data;
|
||||
|
||||
params->verbose = true;
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
if (argv[1] && (argv[1][0] != '\0'))
|
||||
{
|
||||
|
145
gfx/drivers/vita2d_gfx.c
Normal file
145
gfx/drivers/vita2d_gfx.c
Normal file
@ -0,0 +1,145 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015 - Sergi Granell (xerpi)
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../general.h"
|
||||
#include "../../driver.h"
|
||||
#include "../video_viewport.h"
|
||||
|
||||
static void *vita2d_gfx_init(const video_info_t *video,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
*input = NULL;
|
||||
*input_data = NULL;
|
||||
(void)video;
|
||||
|
||||
vita2d_init();
|
||||
vita2d_set_clear_color(RGBA8(0x40, 0x40, 0x40, 0xFF));
|
||||
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
static bool vita2d_gfx_frame(void *data, const void *frame,
|
||||
unsigned width, unsigned height, uint64_t frame_count,
|
||||
unsigned pitch, const char *msg)
|
||||
{
|
||||
(void)data;
|
||||
(void)frame;
|
||||
(void)width;
|
||||
(void)height;
|
||||
(void)pitch;
|
||||
(void)msg;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void vita2d_gfx_set_nonblock_state(void *data, bool toggle)
|
||||
{
|
||||
(void)data;
|
||||
(void)toggle;
|
||||
}
|
||||
|
||||
static bool vita2d_gfx_alive(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool vita2d_gfx_focus(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool vita2d_gfx_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool vita2d_gfx_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void vita2d_gfx_free(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
vita2d_fini();
|
||||
}
|
||||
|
||||
static bool vita2d_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path)
|
||||
{
|
||||
(void)data;
|
||||
(void)type;
|
||||
(void)path;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void vita2d_gfx_set_rotation(void *data,
|
||||
unsigned rotation)
|
||||
{
|
||||
(void)data;
|
||||
(void)rotation;
|
||||
}
|
||||
|
||||
static void vita2d_gfx_viewport_info(void *data,
|
||||
struct video_viewport *vp)
|
||||
{
|
||||
(void)data;
|
||||
(void)vp;
|
||||
}
|
||||
|
||||
static bool vita2d_gfx_read_viewport(void *data, uint8_t *buffer)
|
||||
{
|
||||
(void)data;
|
||||
(void)buffer;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void vita2d_gfx_get_poke_interface(void *data,
|
||||
const video_poke_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
(void)iface;
|
||||
}
|
||||
|
||||
video_driver_t video_vita2d = {
|
||||
vita2d_gfx_init,
|
||||
vita2d_gfx_frame,
|
||||
vita2d_gfx_set_nonblock_state,
|
||||
vita2d_gfx_alive,
|
||||
vita2d_gfx_focus,
|
||||
vita2d_gfx_suppress_screensaver,
|
||||
vita2d_gfx_has_windowed,
|
||||
vita2d_gfx_set_shader,
|
||||
vita2d_gfx_free,
|
||||
"vita2d",
|
||||
NULL, /* set_viewport */
|
||||
vita2d_gfx_set_rotation,
|
||||
vita2d_gfx_viewport_info,
|
||||
vita2d_gfx_read_viewport,
|
||||
NULL, /* read_frame_raw */
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
NULL, /* overlay_interface */
|
||||
#endif
|
||||
vita2d_gfx_get_poke_interface,
|
||||
};
|
@ -70,8 +70,8 @@ static const video_driver_t *video_drivers[] = {
|
||||
#if defined(HAVE_D3D)
|
||||
&video_d3d,
|
||||
#endif
|
||||
#ifdef SN_TARGET_PSP2
|
||||
&video_vita,
|
||||
#ifdef HAVE_VITA2D
|
||||
&video_vita2d,
|
||||
#endif
|
||||
#ifdef PSP
|
||||
&video_psp1,
|
||||
|
@ -190,7 +190,7 @@ typedef struct video_driver
|
||||
|
||||
extern video_driver_t video_gl;
|
||||
extern video_driver_t video_psp1;
|
||||
extern video_driver_t video_vita;
|
||||
extern video_driver_t video_vita2d;
|
||||
extern video_driver_t video_ctr;
|
||||
extern video_driver_t video_d3d;
|
||||
extern video_driver_t video_gx;
|
||||
|
@ -236,6 +236,8 @@ VIDEO DRIVER
|
||||
#include "../gfx/drivers/gx_gfx.c"
|
||||
#elif defined(PSP)
|
||||
#include "../gfx/drivers/psp1_gfx.c"
|
||||
#elif defined(HAVE_VITA2D)
|
||||
#include "../gfx/drivers/vita2d_gfx.c"
|
||||
#elif defined(_3DS)
|
||||
#include "../gfx/drivers/ctr_gfx.c"
|
||||
#elif defined(XENON)
|
||||
|
Loading…
x
Reference in New Issue
Block a user