mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Fix compilation when configuring with --disable-overlay
This commit is contained in:
parent
d3f27c3a81
commit
09f5d2c95d
@ -57,9 +57,11 @@
|
||||
#include "performance_counters.h"
|
||||
#include "led/led_driver.h"
|
||||
#include "midi/midi_driver.h"
|
||||
#include "input/input_driver.h"
|
||||
|
||||
#include "cores/internal_cores.h"
|
||||
#include "content.h"
|
||||
#include "msg_hash.h"
|
||||
#include "paths.h"
|
||||
#include "retroarch.h"
|
||||
#include "configuration.h"
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../input/input_driver.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#include "d3d_common.h"
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <file/file_path.h>
|
||||
#include <encodings/utf.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <formats/image.h>
|
||||
|
||||
#include <dxgi.h>
|
||||
|
||||
#include "../../driver.h"
|
||||
@ -58,6 +60,19 @@ static struct string_list *d3d10_gpu_list = NULL;
|
||||
static IDXGIAdapter1 *d3d10_adapters[D3D10_MAX_GPU_COUNT] = {NULL};
|
||||
static IDXGIAdapter1 *d3d10_current_adapter = NULL;
|
||||
|
||||
static void d3d10_clear_scissor(d3d10_video_t *d3d10, video_frame_info_t *video_info)
|
||||
{
|
||||
D3D10_RECT scissor_rect;
|
||||
|
||||
scissor_rect.left = 0;
|
||||
scissor_rect.top = 0;
|
||||
scissor_rect.right = video_info->width;
|
||||
scissor_rect.bottom = video_info->height;
|
||||
|
||||
D3D10SetScissorRects(d3d10->device, 1, &scissor_rect);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void d3d10_free_overlays(d3d10_video_t* d3d10)
|
||||
{
|
||||
@ -86,18 +101,6 @@ d3d10_overlay_vertex_geom(void* data, unsigned index, float x, float y, float w,
|
||||
D3D10UnmapBuffer(d3d10->overlays.vbo);
|
||||
}
|
||||
|
||||
static void d3d10_clear_scissor(d3d10_video_t *d3d10, video_frame_info_t *video_info)
|
||||
{
|
||||
D3D10_RECT scissor_rect;
|
||||
|
||||
scissor_rect.left = 0;
|
||||
scissor_rect.top = 0;
|
||||
scissor_rect.right = video_info->width;
|
||||
scissor_rect.bottom = video_info->height;
|
||||
|
||||
D3D10SetScissorRects(d3d10->device, 1, &scissor_rect);
|
||||
}
|
||||
|
||||
static void d3d10_overlay_tex_geom(void* data, unsigned index, float u, float v, float w, float h)
|
||||
{
|
||||
d3d10_sprite_t* sprites = NULL;
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include <file/file_path.h>
|
||||
#include <encodings/utf.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <formats/image.h>
|
||||
|
||||
#include <dxgi.h>
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -71,6 +73,19 @@ static struct string_list *d3d11_gpu_list = NULL;
|
||||
static IDXGIAdapter1 *d3d11_adapters[D3D11_MAX_GPU_COUNT] = {NULL};
|
||||
static IDXGIAdapter1 *d3d11_current_adapter = NULL;
|
||||
|
||||
static void d3d11_clear_scissor(d3d11_video_t *d3d11, video_frame_info_t *video_info)
|
||||
{
|
||||
D3D11_RECT scissor_rect;
|
||||
|
||||
scissor_rect.left = 0;
|
||||
scissor_rect.top = 0;
|
||||
scissor_rect.right = video_info->width;
|
||||
scissor_rect.bottom = video_info->height;
|
||||
|
||||
D3D11SetScissorRects(d3d11->context, 1, &scissor_rect);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void d3d11_free_overlays(d3d11_video_t* d3d11)
|
||||
{
|
||||
@ -102,18 +117,6 @@ d3d11_overlay_vertex_geom(void* data, unsigned index, float x, float y, float w,
|
||||
D3D11UnmapBuffer(d3d11->context, d3d11->overlays.vbo, 0);
|
||||
}
|
||||
|
||||
static void d3d11_clear_scissor(d3d11_video_t *d3d11, video_frame_info_t *video_info)
|
||||
{
|
||||
D3D11_RECT scissor_rect;
|
||||
|
||||
scissor_rect.left = 0;
|
||||
scissor_rect.top = 0;
|
||||
scissor_rect.right = video_info->width;
|
||||
scissor_rect.bottom = video_info->height;
|
||||
|
||||
D3D11SetScissorRects(d3d11->context, 1, &scissor_rect);
|
||||
}
|
||||
|
||||
static void d3d11_overlay_tex_geom(void* data, unsigned index, float u, float v, float w, float h)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE mapped_vbo;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <boolean.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <file/file_path.h>
|
||||
#include <formats/image.h>
|
||||
|
||||
#include "../font_driver.h"
|
||||
#include "../common/d3d_common.h"
|
||||
|
@ -108,16 +108,114 @@ static const GLfloat gl1_white_color[] = {
|
||||
if (gl1_shared_context_use) \
|
||||
gl1->ctx_driver->bind_hw_render(gl1->ctx_data, enable)
|
||||
|
||||
static void gl1_render_overlay(gl1_t *gl, video_frame_info_t *video_info);
|
||||
static void gl1_free_overlay(gl1_t *gl);
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void gl1_render_overlay(gl1_t *gl, video_frame_info_t *video_info)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
if (gl->overlay_full_screen)
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
gl->coords.vertex = gl->overlay_vertex_coord;
|
||||
gl->coords.tex_coord = gl->overlay_tex_coord;
|
||||
gl->coords.color = gl->overlay_color_coord;
|
||||
gl->coords.vertices = 4 * gl->overlays;
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
|
||||
for (i = 0; i < gl->overlays; i++)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, gl->overlay_tex[i]);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 4 * i, 4);
|
||||
}
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
gl->coords.vertex = gl->vertex_ptr;
|
||||
gl->coords.tex_coord = gl->tex_info.coord;
|
||||
gl->coords.color = gl->white_color_ptr;
|
||||
gl->coords.vertices = 4;
|
||||
if (gl->overlay_full_screen)
|
||||
glViewport(gl->vp.x, gl->vp.y, gl->vp.width, gl->vp.height);
|
||||
}
|
||||
|
||||
static void gl1_free_overlay(gl1_t *gl)
|
||||
{
|
||||
glDeleteTextures(gl->overlays, gl->overlay_tex);
|
||||
|
||||
free(gl->overlay_tex);
|
||||
free(gl->overlay_vertex_coord);
|
||||
free(gl->overlay_tex_coord);
|
||||
free(gl->overlay_color_coord);
|
||||
gl->overlay_tex = NULL;
|
||||
gl->overlay_vertex_coord = NULL;
|
||||
gl->overlay_tex_coord = NULL;
|
||||
gl->overlay_color_coord = NULL;
|
||||
gl->overlays = 0;
|
||||
}
|
||||
|
||||
static void gl1_overlay_vertex_geom(void *data,
|
||||
unsigned image,
|
||||
float x, float y,
|
||||
float w, float h);
|
||||
float w, float h)
|
||||
{
|
||||
GLfloat *vertex = NULL;
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
if (image > gl->overlays)
|
||||
{
|
||||
RARCH_ERR("[GL]: Invalid overlay id: %u\n", image);
|
||||
return;
|
||||
}
|
||||
|
||||
vertex = (GLfloat*)&gl->overlay_vertex_coord[image * 8];
|
||||
|
||||
/* Flipped, so we preserve top-down semantics. */
|
||||
y = 1.0f - y;
|
||||
h = -h;
|
||||
|
||||
vertex[0] = x;
|
||||
vertex[1] = y;
|
||||
vertex[2] = x + w;
|
||||
vertex[3] = y;
|
||||
vertex[4] = x;
|
||||
vertex[5] = y + h;
|
||||
vertex[6] = x + w;
|
||||
vertex[7] = y + h;
|
||||
}
|
||||
|
||||
static void gl1_overlay_tex_geom(void *data,
|
||||
unsigned image,
|
||||
GLfloat x, GLfloat y,
|
||||
GLfloat w, GLfloat h);
|
||||
GLfloat w, GLfloat h)
|
||||
{
|
||||
GLfloat *tex = NULL;
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
tex = (GLfloat*)&gl->overlay_tex_coord[image * 8];
|
||||
|
||||
tex[0] = x;
|
||||
tex[1] = y;
|
||||
tex[2] = x + w;
|
||||
tex[3] = y;
|
||||
tex[4] = x;
|
||||
tex[5] = y + h;
|
||||
tex[6] = x + w;
|
||||
tex[7] = y + h;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static bool is_pot(unsigned x)
|
||||
{
|
||||
@ -1415,114 +1513,6 @@ static void gl1_get_overlay_interface(void *data,
|
||||
*iface = &gl1_overlay_interface;
|
||||
}
|
||||
|
||||
static void gl1_free_overlay(gl1_t *gl)
|
||||
{
|
||||
glDeleteTextures(gl->overlays, gl->overlay_tex);
|
||||
|
||||
free(gl->overlay_tex);
|
||||
free(gl->overlay_vertex_coord);
|
||||
free(gl->overlay_tex_coord);
|
||||
free(gl->overlay_color_coord);
|
||||
gl->overlay_tex = NULL;
|
||||
gl->overlay_vertex_coord = NULL;
|
||||
gl->overlay_tex_coord = NULL;
|
||||
gl->overlay_color_coord = NULL;
|
||||
gl->overlays = 0;
|
||||
}
|
||||
|
||||
static void gl1_overlay_vertex_geom(void *data,
|
||||
unsigned image,
|
||||
float x, float y,
|
||||
float w, float h)
|
||||
{
|
||||
GLfloat *vertex = NULL;
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
if (image > gl->overlays)
|
||||
{
|
||||
RARCH_ERR("[GL]: Invalid overlay id: %u\n", image);
|
||||
return;
|
||||
}
|
||||
|
||||
vertex = (GLfloat*)&gl->overlay_vertex_coord[image * 8];
|
||||
|
||||
/* Flipped, so we preserve top-down semantics. */
|
||||
y = 1.0f - y;
|
||||
h = -h;
|
||||
|
||||
vertex[0] = x;
|
||||
vertex[1] = y;
|
||||
vertex[2] = x + w;
|
||||
vertex[3] = y;
|
||||
vertex[4] = x;
|
||||
vertex[5] = y + h;
|
||||
vertex[6] = x + w;
|
||||
vertex[7] = y + h;
|
||||
}
|
||||
|
||||
static void gl1_overlay_tex_geom(void *data,
|
||||
unsigned image,
|
||||
GLfloat x, GLfloat y,
|
||||
GLfloat w, GLfloat h)
|
||||
{
|
||||
GLfloat *tex = NULL;
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
tex = (GLfloat*)&gl->overlay_tex_coord[image * 8];
|
||||
|
||||
tex[0] = x;
|
||||
tex[1] = y;
|
||||
tex[2] = x + w;
|
||||
tex[3] = y;
|
||||
tex[4] = x;
|
||||
tex[5] = y + h;
|
||||
tex[6] = x + w;
|
||||
tex[7] = y + h;
|
||||
}
|
||||
|
||||
static void gl1_render_overlay(gl1_t *gl, video_frame_info_t *video_info)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
if (gl->overlay_full_screen)
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
gl->coords.vertex = gl->overlay_vertex_coord;
|
||||
gl->coords.tex_coord = gl->overlay_tex_coord;
|
||||
gl->coords.color = gl->overlay_color_coord;
|
||||
gl->coords.vertices = 4 * gl->overlays;
|
||||
|
||||
/*gl->shader->set_coords(gl->shader_data, &gl->coords);
|
||||
gl->shader->set_mvp(gl->shader_data, &gl->mvp_no_rot);*/
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
|
||||
for (i = 0; i < gl->overlays; i++)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, gl->overlay_tex[i]);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 4 * i, 4);
|
||||
}
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
gl->coords.vertex = gl->vertex_ptr;
|
||||
gl->coords.tex_coord = gl->tex_info.coord;
|
||||
gl->coords.color = gl->white_color_ptr;
|
||||
gl->coords.vertices = 4;
|
||||
if (gl->overlay_full_screen)
|
||||
glViewport(gl->vp.x, gl->vp.y, gl->vp.width, gl->vp.height);
|
||||
}
|
||||
#endif
|
||||
|
||||
video_driver_t video_gl1 = {
|
||||
|
@ -113,31 +113,6 @@ static void gl_core_deinit_pbo_readback(gl_core_t *gl)
|
||||
scaler_ctx_gen_reset(&gl->pbo_readback_scaler);
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void gl_core_free_overlay(gl_core_t *gl)
|
||||
{
|
||||
if (gl->overlay_tex)
|
||||
glDeleteTextures(gl->overlays, gl->overlay_tex);
|
||||
|
||||
free(gl->overlay_tex);
|
||||
free(gl->overlay_vertex_coord);
|
||||
free(gl->overlay_tex_coord);
|
||||
free(gl->overlay_color_coord);
|
||||
gl->overlay_tex = NULL;
|
||||
gl->overlay_vertex_coord = NULL;
|
||||
gl->overlay_tex_coord = NULL;
|
||||
gl->overlay_color_coord = NULL;
|
||||
gl->overlays = 0;
|
||||
}
|
||||
|
||||
static void gl_core_free_scratch_vbos(gl_core_t *gl)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < GL_CORE_NUM_VBOS; i++)
|
||||
if (gl->scratch_vbos[i])
|
||||
glDeleteBuffers(1, &gl->scratch_vbos[i]);
|
||||
}
|
||||
|
||||
static void gl_core_slow_readback(gl_core_t *gl, void *buffer)
|
||||
{
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 4);
|
||||
@ -207,6 +182,31 @@ void gl_core_bind_scratch_vbo(gl_core_t *gl, const void *data, size_t size)
|
||||
gl->scratch_vbo_index = 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void gl_core_free_overlay(gl_core_t *gl)
|
||||
{
|
||||
if (gl->overlay_tex)
|
||||
glDeleteTextures(gl->overlays, gl->overlay_tex);
|
||||
|
||||
free(gl->overlay_tex);
|
||||
free(gl->overlay_vertex_coord);
|
||||
free(gl->overlay_tex_coord);
|
||||
free(gl->overlay_color_coord);
|
||||
gl->overlay_tex = NULL;
|
||||
gl->overlay_vertex_coord = NULL;
|
||||
gl->overlay_tex_coord = NULL;
|
||||
gl->overlay_color_coord = NULL;
|
||||
gl->overlays = 0;
|
||||
}
|
||||
|
||||
static void gl_core_free_scratch_vbos(gl_core_t *gl)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < GL_CORE_NUM_VBOS; i++)
|
||||
if (gl->scratch_vbos[i])
|
||||
glDeleteBuffers(1, &gl->scratch_vbos[i]);
|
||||
}
|
||||
|
||||
static void gl_core_overlay_vertex_geom(void *data,
|
||||
unsigned image,
|
||||
float x, float y,
|
||||
@ -377,8 +377,10 @@ static void gl_core_destroy_resources(gl_core_t *gl)
|
||||
if (gl->pipelines.bokeh)
|
||||
glDeleteProgram(gl->pipelines.bokeh);
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
gl_core_free_overlay(gl);
|
||||
gl_core_free_scratch_vbos(gl);
|
||||
#endif
|
||||
gl_core_deinit_fences(gl);
|
||||
gl_core_deinit_pbo_readback(gl);
|
||||
gl_core_deinit_hw_render(gl);
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
#include "../../dynamic.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../input/input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
|
@ -41,6 +41,7 @@
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../dynamic.h"
|
||||
#include "../../input/input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
#include "input_driver.h"
|
||||
#include "input_mapper.h"
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
@ -79,13 +80,16 @@ void input_mapper_free(input_mapper_t *handle)
|
||||
}
|
||||
|
||||
void input_mapper_poll(input_mapper_t *handle,
|
||||
input_overlay_t *overlay_pointer,
|
||||
void *ol_pointer,
|
||||
void *settings_data,
|
||||
unsigned max_users,
|
||||
bool poll_overlay)
|
||||
{
|
||||
unsigned i, j;
|
||||
input_bits_t current_input;
|
||||
#ifdef HAVE_OVERLAY
|
||||
input_overlay_t *overlay_pointer = (input_overlay_t*)ol_pointer;
|
||||
#endif
|
||||
settings_t *settings = (settings_t*)settings_data;
|
||||
bool key_event[RARCH_CUSTOM_BIND_LIST_END] = { false };
|
||||
|
||||
|
@ -36,7 +36,7 @@ input_mapper_t *input_mapper_new(void);
|
||||
void input_mapper_free(input_mapper_t *handle);
|
||||
|
||||
void input_mapper_poll(input_mapper_t *handle,
|
||||
input_overlay_t *overlay_pointer,
|
||||
void *overlay_pointer,
|
||||
void *settings_data,
|
||||
unsigned max_users,
|
||||
bool poll_overlay);
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include <string/stdstring.h>
|
||||
#include <file/file_path.h>
|
||||
#include <formats/image.h>
|
||||
|
||||
#include "../../menu_animation.h"
|
||||
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <encodings/utf.h>
|
||||
#include <file/file_path.h>
|
||||
#include <formats/image.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <encodings/utf.h>
|
||||
|
@ -1340,6 +1340,7 @@ typedef struct input_remote_state
|
||||
static input_remote_state_t remote_st_ptr;
|
||||
|
||||
/* INPUT OVERLAY GLOBAL VARIABLES */
|
||||
#ifdef HAVE_OVERLAY
|
||||
|
||||
#define OVERLAY_GET_KEY(state, key) (((state)->keys[(key) / 32] >> ((key) % 32)) & 1)
|
||||
#define OVERLAY_SET_KEY(state, key) (state)->keys[(key) / 32] |= 1 << ((key) % 32)
|
||||
@ -1379,6 +1380,7 @@ struct input_overlay
|
||||
};
|
||||
|
||||
input_overlay_t *overlay_ptr = NULL;
|
||||
#endif
|
||||
|
||||
/* INPUT GLOBAL VARIABLES */
|
||||
|
||||
@ -4845,7 +4847,11 @@ static void input_poll(void)
|
||||
|
||||
if (do_poll)
|
||||
input_mapper_poll(input_driver_mapper,
|
||||
#ifdef HAVE_OVERLAY
|
||||
overlay_ptr,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
settings,
|
||||
max_users,
|
||||
overlay_is_alive
|
||||
|
@ -29,6 +29,7 @@ extern "C" {
|
||||
#include <file/file_path.h>
|
||||
#include "../../../command.h"
|
||||
#include "../../../configuration.h"
|
||||
#include "../../../msg_hash.h"
|
||||
#include "../../../retroarch.h"
|
||||
#include "../../../paths.h"
|
||||
#include "../../../file_path_special.h"
|
||||
|
@ -21,6 +21,7 @@ extern "C" {
|
||||
|
||||
#include "../../../file_path_special.h"
|
||||
#include "../../../configuration.h"
|
||||
#include "../../../msg_hash.h"
|
||||
|
||||
#ifndef CXX_BUILD
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ extern "C" {
|
||||
|
||||
#include "../../../core_info.h"
|
||||
#include "../../../file_path_special.h"
|
||||
#include "../../../msg_hash.h"
|
||||
|
||||
#ifndef CXX_BUILD
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ extern "C" {
|
||||
#include <file/file_path.h>
|
||||
#include "../../../command.h"
|
||||
#include "../../../configuration.h"
|
||||
#include "../../../msg_hash.h"
|
||||
#include "../../../retroarch.h"
|
||||
#include "../../../paths.h"
|
||||
#include "../../../file_path_special.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user