RetroArch/gfx/common/switch_common.h

89 lines
1.6 KiB
C
Raw Normal View History

2018-09-15 10:27:05 +00:00
#ifndef SWITCH_COMMON_H__
#define SWITCH_COMMON_H__
#include <switch.h>
#include <gfx/scaler/scaler.h>
2018-09-26 22:52:06 +00:00
#ifdef HAVE_EGL
#include "../common/egl_common.h"
#endif
2018-09-15 10:27:05 +00:00
typedef struct
{
bool vsync;
bool rgb32;
bool smooth; // bilinear
unsigned width, height;
unsigned rotation;
struct video_viewport vp;
struct texture_image *overlay;
bool overlay_enabled;
bool in_menu;
struct
{
bool enable;
bool fullscreen;
uint32_t *pixels;
uint32_t width;
uint32_t height;
unsigned tgtw;
unsigned tgth;
struct scaler_ctx scaler;
} menu_texture;
struct
{
uint32_t width;
uint32_t height;
uint32_t x_offset;
} hw_scale;
uint32_t image[1280 * 720];
uint32_t tmp_image[1280 * 720];
u32 cnt;
struct scaler_ctx scaler;
uint32_t last_width;
uint32_t last_height;
bool keep_aspect;
bool should_resize;
bool need_clear;
bool is_threaded;
bool o_size;
uint32_t o_height;
uint32_t o_width;
NWindow *win;
Framebuffer fb;
// needed for the switch font driver
uint32_t *out_buffer;
uint32_t stride;
2018-09-15 10:27:05 +00:00
} switch_video_t;
2018-09-26 22:52:06 +00:00
typedef struct
{
#ifdef HAVE_EGL
egl_ctx_data_t egl;
#endif
struct
{
unsigned short width;
unsigned short height;
} native_window;
bool resize;
unsigned width, height;
float refresh_rate;
NWindow *win;
2018-09-26 22:52:06 +00:00
} switch_ctx_data_t;
2018-09-15 10:27:05 +00:00
void gfx_slow_swizzling_blit(uint32_t *buffer, uint32_t *image, int w, int h, int tx, int ty, bool blend);
void gfx_cpy_dsp_buf(uint32_t *buffer, uint32_t *image, int w, int h, uint32_t stride, bool blend);
2018-09-15 10:27:05 +00:00
#endif