RetroArch/gfx/common/d3d_common.h

123 lines
3.9 KiB
C
Raw Normal View History

/* RetroArch - A frontend for libretro.
2016-01-10 03:41:52 +00:00
* Copyright (C) 2011-2016 - 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/>.
*/
2015-11-18 12:00:13 +00:00
#ifndef _D3D_COMMON_H
#define _D3D_COMMON_H
#include <boolean.h>
2015-11-18 12:00:13 +00:00
#include "win32_common.h"
2015-11-17 07:20:10 +00:00
#include "../../defines/d3d_defines.h"
2015-11-09 00:19:09 +00:00
#ifdef __cplusplus
extern "C" {
#endif
bool d3d_swap(void *data, LPDIRECT3DDEVICE dev);
LPDIRECT3DVERTEXBUFFER d3d_vertex_buffer_new(LPDIRECT3DDEVICE dev,
unsigned length, unsigned usage, unsigned fvf,
D3DPOOL pool, void *handle);
void *d3d_vertex_buffer_lock(LPDIRECT3DVERTEXBUFFER vertbuf);
2014-09-13 17:56:52 +00:00
void d3d_vertex_buffer_unlock(LPDIRECT3DVERTEXBUFFER vertbuf);
2014-09-13 17:33:06 +00:00
void d3d_vertex_buffer_free(void *vertex_data, void *vertex_declaration);
LPDIRECT3DTEXTURE d3d_texture_new(LPDIRECT3DDEVICE dev,
const char *path, unsigned width, unsigned height,
unsigned miplevels, unsigned usage, D3DFORMAT format,
D3DPOOL pool, unsigned filter, unsigned mipfilter,
D3DCOLOR color_key, D3DXIMAGE_INFO *src_info,
PALETTEENTRY *palette);
void d3d_set_stream_source(LPDIRECT3DDEVICE dev, unsigned stream_no,
LPDIRECT3DVERTEXBUFFER stream_vertbuf, unsigned offset_bytes,
unsigned stride);
void d3d_texture_free(LPDIRECT3DTEXTURE tex);
2014-09-13 19:50:07 +00:00
void d3d_set_transform(LPDIRECT3DDEVICE dev,
D3DTRANSFORMSTATETYPE state, CONST D3DMATRIX *matrix);
void d3d_set_sampler_address_u(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);
void d3d_set_sampler_address_v(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);
void d3d_set_sampler_minfilter(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);
void d3d_set_sampler_magfilter(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);
void d3d_draw_primitive(LPDIRECT3DDEVICE dev,
2014-09-11 22:00:20 +00:00
D3DPRIMITIVETYPE type, unsigned start, unsigned count);
2014-09-13 18:09:55 +00:00
void d3d_clear(LPDIRECT3DDEVICE dev,
unsigned count, const D3DRECT *rects, unsigned flags,
D3DCOLOR color, float z, unsigned stencil);
bool d3d_lock_rectangle(LPDIRECT3DTEXTURE tex,
2015-11-09 14:34:16 +00:00
unsigned level, D3DLOCKED_RECT *lock_rect, RECT *rect,
unsigned rectangle_height, unsigned flags);
2015-11-09 14:39:47 +00:00
void d3d_lock_rectangle_clear(LPDIRECT3DTEXTURE tex,
unsigned level, D3DLOCKED_RECT *lock_rect, RECT *rect,
unsigned rectangle_height, unsigned flags);
2015-11-09 14:39:47 +00:00
void d3d_unlock_rectangle(LPDIRECT3DTEXTURE tex);
2015-11-09 14:34:16 +00:00
void d3d_set_texture(LPDIRECT3DDEVICE dev, unsigned sampler,
LPDIRECT3DTEXTURE tex);
HRESULT d3d_set_vertex_shader(LPDIRECT3DDEVICE dev, unsigned index,
void *data);
2015-04-06 22:46:46 +00:00
void d3d_texture_blit(unsigned pixel_size,
LPDIRECT3DTEXTURE tex,
D3DLOCKED_RECT *lr, const void *frame,
unsigned width, unsigned height, unsigned pitch);
2015-11-12 00:38:13 +00:00
bool d3d_vertex_declaration_new(LPDIRECT3DDEVICE dev,
const void *vertex_data, void **decl_data);
2016-01-07 08:22:04 +00:00
void d3d_set_viewports(LPDIRECT3DDEVICE dev, D3DVIEWPORT *vp);
void d3d_enable_blend_func(void *data);
void d3d_disable_blend_func(void *data);
2015-04-07 00:44:12 +00:00
void d3d_set_vertex_declaration(void *data, void *vertex_data);
void d3d_enable_alpha_blend_texture_func(void *data);
void d3d_frame_postprocess(void *data);
2015-11-12 00:28:14 +00:00
void d3d_set_render_state(void *data, D3DRENDERSTATETYPE state, DWORD value);
2015-11-14 19:02:55 +00:00
bool d3d_reset(LPDIRECT3DDEVICE dev, D3DPRESENT_PARAMETERS *d3dpp);
2016-01-06 23:19:27 +00:00
void d3d_device_free(LPDIRECT3DDEVICE dev, LPDIRECT3D pd3d);
D3DTEXTUREFILTERTYPE d3d_translate_filter(unsigned type);
2015-11-09 00:19:09 +00:00
#ifdef __cplusplus
}
#endif
#endif