Create menu_video.c

This commit is contained in:
twinaphex 2015-07-09 18:39:40 +02:00
parent aa8c8dbaa6
commit 14b6a6636b
9 changed files with 78 additions and 31 deletions

View File

@ -408,6 +408,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
menu/menu_navigation.o \
menu/menu_setting.o \
menu/menu_shader.o \
menu/menu_video.o \
menu/menu_cbs.o \
menu/cbs/menu_cbs_ok.o \
menu/cbs/menu_cbs_cancel.o \

View File

@ -747,6 +747,7 @@ MENU
#include "../menu/menu_setting.c"
#include "../menu/menu_list.c"
#include "../menu/menu_cbs.c"
#include "../menu/menu_video.c"
#include "../menu/cbs/menu_cbs_ok.c"
#include "../menu/cbs/menu_cbs_cancel.c"
#include "../menu/cbs/menu_cbs_select.c"

View File

@ -27,15 +27,16 @@
#include "../menu.h"
#include "../menu_driver.h"
#include "../menu_hash.h"
#include "../menu_entry.h"
#include "../menu_display.h"
#include "../../runloop_data.h"
#include "../menu_video.h"
#include "../../gfx/video_thread_wrapper.h"
#include "../../gfx/font_driver.h"
#include "../../gfx/video_texture.h"
#include "shared.h"
#include "../../runloop_data.h"
typedef struct glui_handle
{
@ -139,7 +140,7 @@ static void glui_render_quad(gl_t *gl, int x, int y, int w, int h,
coords.color = color;
menu_gl_draw_frame(gl->shader, &coords,
menu_video_draw_frame(gl->shader, &coords,
&gl->mvp_no_rot, true, glui->textures.white);
gl->coords.color = gl->white_color_ptr;
@ -405,7 +406,7 @@ static void glui_frame(void)
menu_display_set_viewport();
gl_menu_frame_background(menu, settings,
menu_video_frame_background(menu, settings,
gl, glui->textures.bg.id, 0.75f, 0.75f, false);
menu_entries_get_title(title, sizeof(title));

View File

@ -29,14 +29,14 @@
#include "../menu.h"
#include "../menu_animation.h"
#include "../menu_entry.h"
#include "../menu_hash.h"
#include "../menu_display.h"
#include "../menu_video.h"
#include "../../configuration.h"
#include "../../runloop.h"
#include "../../gfx/drivers_font_renderer/bitmap.h"
#include "shared.h"
#define RGUI_TERM_START_X (frame_buf->width / 21)
#define RGUI_TERM_START_Y (frame_buf->height / 9)
#define RGUI_TERM_WIDTH (((frame_buf->width - RGUI_TERM_START_X - RGUI_TERM_START_X) / (FONT_WIDTH_STRIDE)))

View File

@ -24,11 +24,12 @@
#include <compat/posix_string.h>
#include <string/string_list.h>
#include "../menu.h"
#include "../menu_driver.h"
#include "../menu_entry.h"
#include "../menu_input.h"
#include "../menu_setting.h"
#include "../menu.h"
#include "../menu_video.h"
#include "../../general.h"
#include "../../config.def.h"
#include "../../performance.h"
@ -36,7 +37,6 @@
#include "../../screenshot.h"
#include "../../gfx/drivers_font_renderer/bitmap.h"
#include "shared.h"
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
#define HAVE_SHADER_MANAGER

View File

@ -33,6 +33,7 @@
#include "../menu_list.h"
#include "../menu_input.h"
#include "../menu_setting.h"
#include "../menu_video.h"
#include "../../gfx/video_context_driver.h"
@ -40,8 +41,6 @@
#include "../../gfx/d3d/d3d.h"
#include "shared.h"
#define XUI_CONTROL_NAVIGATE_OK (XUI_CONTROL_NAVIGATE_RIGHT + 1)
#define FONT_WIDTH 5

View File

@ -31,6 +31,7 @@
#include "../menu_animation.h"
#include "../menu_display.h"
#include "../menu_hash.h"
#include "../menu_video.h"
#include "../menu_cbs.h"
@ -39,8 +40,6 @@
#include "../../runloop_data.h"
#include "shared.h"
#ifndef XMB_THEME
#define XMB_THEME "monochrome"
#endif
@ -394,7 +393,7 @@ static void xmb_draw_icon(gl_t *gl, xmb_handle_t *xmb,
matrix_4x4_scale(&mscal, scale_factor, scale_factor, 1);
matrix_4x4_multiply(&mymat, &mscal, &mymat);
menu_gl_draw_frame(gl->shader, &coords, &mymat, false, texture);
menu_video_draw_frame(gl->shader, &coords, &mymat, false, texture);
}
static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
@ -449,7 +448,7 @@ static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
coords.lut_tex_coord = rmb_tex_coord;
coords.color = color;
menu_gl_draw_frame(gl->shader, &coords, mymat, false, texture);
menu_video_draw_frame(gl->shader, &coords, mymat, false, texture);
}
static void xmb_draw_boxart(gl_t *gl, xmb_handle_t *xmb)
@ -498,7 +497,7 @@ static void xmb_draw_boxart(gl_t *gl, xmb_handle_t *xmb)
matrix_4x4_scale(&mscal, 1, 1, 1);
matrix_4x4_multiply(&mymat, &mscal, &mymat);
menu_gl_draw_frame(gl->shader, &coords, &mymat, false, xmb->boxart);
menu_video_draw_frame(gl->shader, &coords, &mymat, false, xmb->boxart);
}
static void xmb_draw_text(menu_handle_t *menu,
@ -1472,7 +1471,7 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb, float x, float y)
xmb_draw_icon_begin(gl);
menu_gl_draw_frame(gl->shader, &coords, &mymat, true, xmb->textures.list[XMB_TEXTURE_POINTER].id);
menu_video_draw_frame(gl->shader, &coords, &mymat, true, xmb->textures.list[XMB_TEXTURE_POINTER].id);
}
static void xmb_render(void)
@ -1602,7 +1601,7 @@ static void xmb_frame(void)
xmb->raster_block.carr.coords.vertices = 0;
gl_menu_frame_background(menu, settings,
menu_video_frame_background(menu, settings,
gl, xmb->textures.bg.id, xmb->alpha, 0.75f, false);
xmb_draw_text(menu, xmb,
@ -1688,7 +1687,7 @@ static void xmb_frame(void)
if (render_background)
{
gl_menu_frame_background(menu, settings, gl,
menu_video_frame_background(menu, settings, gl,
xmb->textures.bg.id, xmb->alpha, 0.75f, true);
xmb_frame_messagebox(msg);
}

View File

@ -13,18 +13,15 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _DISP_SHARED_H
#define _DISP_SHARED_H
#include <retro_miscellaneous.h>
#include "../menu_setting.h"
#include "../menu_display.h"
#include "../menu_cbs.h"
#include "menu_display.h"
#include "menu_hash.h"
#include "menu_setting.h"
#include "menu_video.h"
#ifdef HAVE_OPENGL
#include "../../gfx/drivers/gl_common.h"
static INLINE void menu_gl_draw_frame(
void menu_video_draw_frame(
const shader_backend_t *shader,
struct gl_coords *coords,
math_matrix_4x4 *mat,
@ -48,7 +45,7 @@ static INLINE void menu_gl_draw_frame(
glDisable(GL_BLEND);
}
static INLINE void gl_menu_frame_background(
void menu_video_frame_background(
menu_handle_t *menu,
settings_t *settings,
gl_t *gl,
@ -135,11 +132,9 @@ static INLINE void gl_menu_frame_background(
&& texture)
coords.color = color;
menu_gl_draw_frame(gl->shader, &coords,
menu_video_draw_frame(gl->shader, &coords,
&gl->mvp_no_rot, true, texture);
gl->coords.color = gl->white_color_ptr;
}
#endif
#endif

51
menu/menu_video.h Normal file
View File

@ -0,0 +1,51 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2015 - Daniel De Matteis
*
* 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/>.
*/
#ifndef _MENU_VIDEO_H
#define _MENU_VIDEO_H
#include "menu_shader.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef HAVE_OPENGL
#include "../gfx/drivers/gl_common.h"
void menu_video_draw_frame(
const shader_backend_t *shader,
struct gl_coords *coords,
math_matrix_4x4 *mat,
bool blend,
GLuint texture
);
void menu_video_frame_background(
menu_handle_t *menu,
settings_t *settings,
gl_t *gl,
GLuint texture,
float handle_alpha,
float alpha,
bool force_transparency);
#endif
#ifdef __cplusplus
}
#endif
#endif