2012-10-26 19:09:30 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
|
|
|
* Copyright (C) 2011-2014 - Daniel De Matteis
|
2012-10-26 19:09:30 +00:00
|
|
|
*
|
|
|
|
* 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 D3DVIDEO_HPP__
|
|
|
|
#define D3DVIDEO_HPP__
|
|
|
|
|
2014-01-01 15:51:40 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-01-09 19:04:18 +00:00
|
|
|
#ifndef _XBOX
|
|
|
|
#define HAVE_WINDOW
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_XBOX1)
|
|
|
|
#ifndef HAVE_D3D8
|
|
|
|
#define HAVE_D3D8
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#ifndef HAVE_D3D9
|
|
|
|
#define HAVE_D3D9
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2012-10-26 19:09:30 +00:00
|
|
|
#include "../../general.h"
|
|
|
|
#include "../../driver.h"
|
2013-04-06 19:26:27 +00:00
|
|
|
#include "../shader_parse.h"
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2014-01-18 20:51:30 +00:00
|
|
|
#include "../fonts/d3d_font.h"
|
2014-01-18 17:43:07 +00:00
|
|
|
#include "../gfx_context.h"
|
2013-04-07 17:34:44 +00:00
|
|
|
#include "../gfx_common.h"
|
|
|
|
|
2012-11-14 00:13:08 +00:00
|
|
|
#ifdef HAVE_CG
|
2012-10-26 19:09:30 +00:00
|
|
|
#include <Cg/cg.h>
|
|
|
|
#include <Cg/cgD3D9.h>
|
2012-11-14 00:13:08 +00:00
|
|
|
#endif
|
2013-12-31 23:58:21 +00:00
|
|
|
#include "d3d_defines.h"
|
2012-10-26 19:09:30 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class RenderChain;
|
|
|
|
|
2013-04-07 17:34:44 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
struct Coords
|
|
|
|
{
|
|
|
|
float x, y, w, h;
|
|
|
|
};
|
|
|
|
Coords tex_coords;
|
|
|
|
Coords vert_coords;
|
|
|
|
unsigned tex_w, tex_h;
|
|
|
|
bool fullscreen;
|
2013-10-21 11:26:23 +00:00
|
|
|
bool enabled;
|
2013-04-07 17:34:44 +00:00
|
|
|
float alpha_mod;
|
2013-12-31 23:27:55 +00:00
|
|
|
LPDIRECT3DTEXTURE tex;
|
|
|
|
LPDIRECT3DVERTEXBUFFER vert_buf;
|
2013-04-07 17:34:44 +00:00
|
|
|
} overlay_t;
|
|
|
|
|
2014-01-09 18:05:31 +00:00
|
|
|
void d3d_set_font_rect(void *data, font_params_t *params);
|
|
|
|
bool d3d_process_shader(void *data);
|
|
|
|
void d3d_update_title(void *data);
|
|
|
|
void d3d_recompute_pass_sizes(void *data);
|
|
|
|
RECT d3d_monitor_rect(void *data);
|
|
|
|
bool d3d_init_shader(void *data);
|
|
|
|
void d3d_deinit_shader(void *data);
|
2014-01-09 18:43:45 +00:00
|
|
|
bool d3d_init_imports(void *data);
|
|
|
|
bool d3d_init_luts(void *data);
|
|
|
|
bool d3d_init_singlepass(void *data);
|
|
|
|
bool d3d_init_multipass(void *data);
|
|
|
|
bool d3d_init_chain(void *data, const video_info_t *video_info);
|
|
|
|
void d3d_deinit_chain(void *data);
|
2014-01-09 20:27:53 +00:00
|
|
|
void d3d_show_cursor(void *data, bool state);
|
|
|
|
void d3d_make_d3dpp(void *data, const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);
|
|
|
|
bool d3d_alive_func(void *data);
|
2014-01-09 18:43:45 +00:00
|
|
|
|
|
|
|
struct D3DVideo
|
2012-10-26 19:09:30 +00:00
|
|
|
{
|
2014-01-18 20:51:30 +00:00
|
|
|
const d3d_font_renderer_t *font_ctx;
|
2014-01-18 17:43:07 +00:00
|
|
|
const gfx_ctx_driver_t *ctx_driver;
|
2013-04-21 12:04:16 +00:00
|
|
|
bool should_resize;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2014-01-09 19:04:18 +00:00
|
|
|
#ifdef HAVE_WINDOW
|
2012-10-26 19:09:30 +00:00
|
|
|
WNDCLASSEX windowClass;
|
2014-01-09 19:04:18 +00:00
|
|
|
#endif
|
2012-10-26 19:09:30 +00:00
|
|
|
HWND hWnd;
|
2013-12-31 23:27:55 +00:00
|
|
|
LPDIRECT3D g_pD3D;
|
|
|
|
LPDIRECT3DDEVICE dev;
|
2014-01-09 19:04:18 +00:00
|
|
|
#ifndef _XBOX
|
2012-10-26 19:09:30 +00:00
|
|
|
LPD3DXFONT font;
|
2014-01-09 19:04:18 +00:00
|
|
|
#endif
|
|
|
|
HRESULT d3d_err;
|
2014-01-09 19:06:39 +00:00
|
|
|
unsigned cur_mon_id;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
|
|
|
unsigned screen_width;
|
|
|
|
unsigned screen_height;
|
2014-01-09 17:44:25 +00:00
|
|
|
unsigned dev_rotation;
|
2013-12-31 23:27:55 +00:00
|
|
|
D3DVIEWPORT final_viewport;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
|
|
|
std::string cg_shader;
|
|
|
|
|
2013-04-06 19:26:27 +00:00
|
|
|
struct gfx_shader shader;
|
|
|
|
|
2012-10-26 19:09:30 +00:00
|
|
|
video_info_t video_info;
|
|
|
|
|
|
|
|
bool needs_restore;
|
|
|
|
|
2012-11-14 00:13:08 +00:00
|
|
|
#ifdef HAVE_CG
|
2012-10-26 19:09:30 +00:00
|
|
|
CGcontext cgCtx;
|
2012-11-14 00:13:08 +00:00
|
|
|
#endif
|
2012-10-26 19:09:30 +00:00
|
|
|
RECT font_rect;
|
|
|
|
RECT font_rect_shifted;
|
|
|
|
uint32_t font_color;
|
|
|
|
|
2013-03-27 14:55:59 +00:00
|
|
|
#ifdef HAVE_OVERLAY
|
2013-10-21 11:26:23 +00:00
|
|
|
bool overlays_enabled;
|
|
|
|
std::vector<overlay_t> overlays;
|
2013-04-07 17:34:44 +00:00
|
|
|
#endif
|
|
|
|
|
2013-11-08 03:36:16 +00:00
|
|
|
#ifdef HAVE_MENU
|
2014-03-07 18:13:20 +00:00
|
|
|
overlay_t *rgui;
|
2013-03-27 14:55:59 +00:00
|
|
|
#endif
|
2014-03-07 18:13:20 +00:00
|
|
|
void *chain;
|
2012-10-26 19:09:30 +00:00
|
|
|
};
|
|
|
|
|
2014-01-09 17:44:25 +00:00
|
|
|
#ifndef _XBOX
|
|
|
|
extern "C" bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lParam);
|
|
|
|
#endif
|
|
|
|
|
2012-10-26 19:09:30 +00:00
|
|
|
#endif
|
|
|
|
|