mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(Vita) New set viewport function
This commit is contained in:
parent
8ad3cb14f8
commit
3d44faf6c3
1
deps/libvita2d/include/vita2d.h
vendored
1
deps/libvita2d/include/vita2d.h
vendored
@ -89,6 +89,7 @@ int vita2d_get_clipping_enabled();
|
||||
void vita2d_set_clip_rectangle(int x_min, int y_min, int x_max, int y_max);
|
||||
void vita2d_get_clip_rectangle(int *x_min, int *y_min, int *x_max, int *y_max);
|
||||
void vita2d_set_blend_mode_add(int enable);
|
||||
void vita2d_set_viewport(int x, int y, int width, int height);
|
||||
|
||||
void *vita2d_pool_malloc(unsigned int size);
|
||||
void *vita2d_pool_memalign(unsigned int size, unsigned int alignment);
|
||||
|
11
deps/libvita2d/source/vita2d.c
vendored
11
deps/libvita2d/source/vita2d.c
vendored
@ -1091,4 +1091,15 @@ void vita2d_set_blend_mode_add(int enable)
|
||||
_vita2d_colorFragmentProgram = in->color;
|
||||
_vita2d_textureFragmentProgram = in->texture;
|
||||
_vita2d_textureTintFragmentProgram = in->textureTint;
|
||||
}
|
||||
|
||||
void vita2d_set_viewport(int x, int y, int width, int height){
|
||||
static float vh = DISPLAY_HEIGHT;
|
||||
float sw = width / 2.;
|
||||
float sh = height / 2.;
|
||||
float x_scale = sw;
|
||||
float x_port = x + sw;
|
||||
float y_scale = -(sh);
|
||||
float y_port = vh - y - sh;
|
||||
sceGxmSetViewport(_vita2d_context, x_port, x_scale, y_port, y_scale, -0.5f, 0.5f);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user