16 #ifndef _D3D8_COMMON_H 17 #define _D3D8_COMMON_H 25 #include "../video_driver.h" 26 #include "../../verbosity.h" 54 WNDCLASSEX windowClass;
84 unsigned fvf,
D3DPOOL pool,
void *handle)
120 void *vertex_declaration)
131 unsigned idx,
void *_ppsurface_level)
141 unsigned idx,
void **_ppsurface_level)
155 INT32 color_key,
void *src_info_data,
156 PALETTEENTRY *palette,
bool want_mipmap);
161 unsigned offset_bytes,
166 stream_no, stream_vertbuf,
stride);
247 unsigned count,
const void *rects,
unsigned flags,
258 unsigned rectangle_height,
unsigned flags)
276 unsigned rectangle_height,
unsigned flags)
431 unsigned cur_mon_id);
437 unsigned idx,
unsigned swapchain_idx,
438 unsigned backbuffer_type,
void **
data)
467 INT32 backbuffer_format,
482 void *desc,
void **font_data);
494 return D3DFMT_LIN_R5G6B5;
503 return D3DFMT_LIN_A8R8G8B8;
512 return D3DFMT_LIN_X8R8G8B8;
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:6559
#define IDirect3DTexture8_GetLevelDesc(p, a, b)
Definition: d3d8.h:710
Definition: d3d8types.h:1189
Definition: d3d_common.h:64
GLuint shader
Definition: glext.h:6670
static INLINE void d3d8_clear(LPDIRECT3DDEVICE8 dev, unsigned count, const void *rects, unsigned flags, INT32 color, float z, unsigned stencil)
Definition: d3d8_common.h:246
bool needs_restore
Definition: d3d8_common.h:35
enum _D3DPRIMITIVETYPE D3DPRIMITIVETYPE
struct IDirect3DDevice8 * LPDIRECT3DDEVICE8
Definition: d3d8.h:326
struct video_viewport vp
Definition: d3d8_common.h:50
Definition: d3d8types.h:92
Definition: matrix_4x4.h:40
static INLINE void d3d8_unlock_rectangle(LPDIRECT3DTEXTURE8 tex)
Definition: d3d8_common.h:267
math_matrix_4x4 mvp_rotate
Definition: d3d8_common.h:47
video_info_t video_info
Definition: d3d8_common.h:52
enum _D3DTEXTURESTAGESTATETYPE D3DTEXTURESTAGESTATETYPE
struct IDirect3DSurface8 * LPDIRECT3DSURFACE8
Definition: d3d8.h:1020
void d3d8x_font_draw_text(void *data, void *sprite_data, void *string_data, unsigned count, void *rect_data, unsigned format, unsigned color)
Definition: d3d8_common.c:336
Definition: d3d8types.h:77
Definition: d3d8_common.h:30
#define INLINE
Definition: retro_inline.h:35
#define IDirect3DDevice8_SetViewport(p, a)
Definition: d3d8.h:369
#define IDirect3DDevice8_GetBackBuffer(p, a, b, c)
Definition: d3d8.h:345
overlay_t * menu
Definition: d3d8_common.h:43
static INLINE void d3d8_draw_primitive(LPDIRECT3DDEVICE8 dev, D3DPRIMITIVETYPE type, unsigned start, unsigned count)
Definition: d3d8_common.h:236
Definition: d3d8types.h:333
#define IDirect3DVertexBuffer8_Unlock(p)
Definition: d3d8.h:922
static INLINE void d3d8_set_sampler_minfilter(void *_dev, unsigned sampler, unsigned value)
Definition: d3d8_common.h:201
static INLINE INT32 d3d8_get_argb8888_format(void)
Definition: d3d8_common.h:500
unsigned cur_mon_id
Definition: d3d8_common.h:40
static INLINE void d3d8_vertex_buffer_free(LPDIRECT3DVERTEXBUFFER8 buf, void *vertex_declaration)
Definition: d3d8_common.h:118
static INLINE void d3d8_set_transform(LPDIRECT3DDEVICE8 dev, D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
Definition: d3d8_common.h:175
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
#define IDirect3DSurface8_UnlockRect(p)
Definition: d3d8.h:1033
interface IDirect3DBaseTexture8 IDirect3DBaseTexture8
Definition: d3d8.h:123
static INLINE INT32 d3d8_get_rgb565_format(void)
Definition: d3d8_common.h:491
#define IDirect3DDevice8_SetRenderState(p, a, b)
Definition: d3d8.h:379
#define IDirect3DTexture8_GetSurfaceLevel(p, a, b)
Definition: d3d8.h:711
static INLINE void d3d8_device_free(LPDIRECT3DDEVICE8 dev, LPDIRECT3D8 pd3d)
Definition: d3d8_common.h:448
Definition: d3d8types.h:451
GLuint start
Definition: glext.h:6292
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
Definition: ffmpeg_core.c:151
struct IDirect3DVertexBuffer8 * LPDIRECT3DVERTEXBUFFER8
Definition: d3d8.h:907
struct IDirect3D8 * LPDIRECT3D8
Definition: d3d8.h:181
#define IDirect3DDevice8_DrawPrimitive(p, a, b, c)
Definition: d3d8.h:399
static INLINE void d3d8_set_sampler_address_v(LPDIRECT3DDEVICE8 dev, unsigned sampler, unsigned value)
Definition: d3d8_common.h:195
#define IDirect3D8_Release(p)
Definition: d3d8.h:186
static INLINE void d3d8_texture_free(LPDIRECT3DTEXTURE8 tex)
Definition: d3d8_common.h:169
void * decl
Definition: d3d8_common.h:66
GLsizei const GLchar ** path
Definition: glext.h:7901
#define IDirect3DVertexBuffer8_Lock(p, a, b, c, d)
Definition: d3d8.h:921
void * pBits
Definition: d3d8types.h:1509
bool quitting
Definition: d3d8_common.h:34
struct IDirect3DTexture8 * LPDIRECT3DTEXTURE8
Definition: d3d8.h:693
static INLINE bool d3d8_device_get_backbuffer(LPDIRECT3DDEVICE8 dev, unsigned idx, unsigned swapchain_idx, unsigned backbuffer_type, void **data)
Definition: d3d8_common.h:435
static INLINE void d3d8_enable_blend_func(void *data)
Definition: d3d8_common.h:338
static tesseract::TessBaseAPI * api
Definition: tess_get_text.cpp:7
#define IDirect3DSurface8_Release(p)
Definition: d3d8.h:1025
bool keep_aspect
Definition: d3d8_common.h:32
GLuint GLenum matrix
Definition: glext.h:10314
struct passwd out
Definition: missing_libc_functions.c:51
GLdouble GLdouble z
Definition: glext.h:6514
Definition: d3d8types.h:442
#define IDirect3DDevice8_CreateVertexBuffer(p, a, b, c, d, e)
Definition: d3d8.h:352
#define IDirect3DTexture8_UnlockRect(p, a)
Definition: d3d8.h:713
#define IDirect3DDevice8_GetRenderState(p, a, b)
Definition: d3d8.h:380
Definition: d3d8types.h:218
GLuint GLuint GLsizei count
Definition: glext.h:6292
bool resolution_hd_enable
Definition: d3d8_common.h:38
static INLINE INT32 d3d8_get_xrgb8888_format(void)
Definition: d3d8_common.h:509
Definition: video_shader_parse.h:143
void * renderchain_data
Definition: d3d8_common.h:44
void d3d8x_font_release(void *data)
Definition: d3d8_common.c:350
math_matrix_4x4 mvp
Definition: d3d8_common.h:46
#define IDirect3DDevice8_BeginScene(p)
Definition: d3d8.h:363
Definition: d3d8types.h:217
#define D3DERR_DEVICELOST
Definition: d3d8.h:1208
static INLINE void d3d8_vertex_buffer_unlock(LPDIRECT3DVERTEXBUFFER8 vertbuf)
Definition: d3d8_common.h:111
static INLINE void d3d8_device_set_render_target(LPDIRECT3DDEVICE8 dev, unsigned idx, LPDIRECT3DSURFACE8 surf)
Definition: d3d8_common.h:380
void d3d8_frame_postprocess(void *data)
Definition: d3d8_common.c:220
bool should_resize
Definition: d3d8_common.h:33
static INLINE bool d3d8_begin_scene(LPDIRECT3DDEVICE8 dev)
Definition: d3d8_common.h:216
static INLINE void d3d8_lock_rectangle_clear(void *tex, unsigned level, D3DLOCKED_RECT *lr, RECT *rect, unsigned rectangle_height, unsigned flags)
Definition: d3d8_common.h:273
bool d3d8_create_device(void *dev, void *d3dpp, LPDIRECT3D8 d3d, HWND focus_window, unsigned cur_mon_id)
Definition: d3d8_common.c:269
#define NULL
Pointer to 0.
Definition: gctypes.h:65
#define IDirect3DDevice8_Release(p)
Definition: d3d8.h:331
void * buffer
Definition: d3d8_common.h:65
GLenum type
Definition: glext.h:6233
#define IDirect3DDevice8_SetTransform(p, a, b)
Definition: d3d8.h:366
Definition: d3d8types.h:453
int32_t INT32
Definition: coretypes.h:17
static INLINE void * d3d8_vertex_buffer_new(LPDIRECT3DDEVICE8 dev, unsigned length, unsigned usage, unsigned fvf, D3DPOOL pool, void *handle)
Definition: d3d8_common.h:81
#define IDirect3DDevice8_SetVertexShader(p, a)
Definition: d3d8.h:405
#define IDirect3DDevice8_SetRenderTarget(p, a, b)
Definition: d3d8.h:360
overlay_t * overlays
Definition: d3d8_common.h:70
static INLINE void d3d8_set_stream_source(LPDIRECT3DDEVICE8 dev, unsigned stream_no, LPDIRECT3DVERTEXBUFFER8 stream_vertbuf, unsigned offset_bytes, unsigned stride)
Definition: d3d8_common.h:158
Definition: d3d8types.h:1259
#define IDirect3DTexture8_LockRect(p, a, b, c, d)
Definition: d3d8.h:712
bool d3d8x_create_font_indirect(LPDIRECT3DDEVICE8 dev, void *desc, void **font_data)
Definition: d3d8_common.c:324
Definition: d3d8types.h:1479
GLint level
Definition: glext.h:6293
void * d3d8_create(void)
Definition: d3d8_common.c:85
static INLINE void d3d8_surface_free(LPDIRECT3DSURFACE8 surf)
Definition: d3d8_common.h:363
bool overlays_enabled
Definition: d3d8_common.h:36
static INLINE bool d3d8_lock_rectangle(LPDIRECT3DTEXTURE8 tex, unsigned level, D3DLOCKED_RECT *lr, RECT *rect, unsigned rectangle_height, unsigned flags)
Definition: d3d8_common.h:255
static INLINE bool d3d8_swap(void *data, LPDIRECT3DDEVICE8 dev)
Definition: d3d8_common.h:73
static INLINE bool d3d8_check_device_type(LPDIRECT3D8 d3d, unsigned idx, INT32 disp_format, INT32 backbuffer_format, bool windowed_mode)
Definition: d3d8_common.h:463
static uint64_t state[MAX_PADS]
Definition: xenon360_input.c:33
GLint GLfloat GLint stencil
Definition: glext.h:6900
static INLINE bool d3d8_texture_get_level_desc(LPDIRECT3DTEXTURE8 tex, unsigned idx, void *_ppsurface_level)
Definition: d3d8_common.h:129
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
Definition: video_driver.h:332
bool d3d8_initialize_symbols(enum gfx_ctx_api api)
Definition: d3d8_common.c:102
GLuint in
Definition: glext.h:10523
#define IDirect3DDevice8_Clear(p, a, b, c, d, e, f)
Definition: d3d8.h:365
#define IDirect3DDevice8_SetStreamSource(p, a, b, c)
Definition: d3d8.h:412
char * shader_path
Definition: d3d8_common.h:59
#define D3DLOCK_READONLY
Definition: d3d8types.h:1447
static INLINE void d3d8_enable_alpha_blend_texture_func(void *data)
Definition: d3d8_common.h:353
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 idx
Definition: pixman-arm-neon-asm.h:96
Definition: d3d8types.h:490
INT Pitch
Definition: d3d8types.h:1508
Definition: d3d8types.h:450
Definition: d3d8types.h:1261
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
gfx_ctx_api
Definition: video_driver.h:86
GLuint index
Definition: glext.h:6671
static INLINE bool d3d8_device_get_render_target(LPDIRECT3DDEVICE8 dev, unsigned idx, void **data)
Definition: d3d8_common.h:369
Definition: d3d8types.h:67
static INLINE void d3d8_set_viewports(LPDIRECT3DDEVICE8 dev, void *vp)
Definition: d3d8_common.h:321
unsigned dev_rotation
Definition: d3d8_common.h:41
Definition: d3d8types.h:1312
#define IDirect3DVertexBuffer8_Release(p)
Definition: d3d8.h:912
static INLINE void d3d8_set_sampler_magfilter(void *_dev, unsigned sampler, unsigned value)
Definition: d3d8_common.h:207
D3DVIEWPORT8 final_viewport
Definition: d3d8_common.h:57
int offset
Definition: d3d8_common.h:64
struct d3d8_video::@199 menu_display
void d3d8x_font_get_text_metrics(void *data, void *metrics)
Definition: d3d8_common.c:359
static INLINE void d3d8_set_texture(LPDIRECT3DDEVICE8 dev, unsigned sampler, LPDIRECT3DTEXTURE8 tex)
Definition: d3d8_common.h:285
#define IDirect3DDevice8_Present(p, a, b, c, d)
Definition: d3d8.h:344
Definition: video_driver.h:686
void * d3d8_texture_new(LPDIRECT3DDEVICE8 dev, const char *path, unsigned width, unsigned height, unsigned miplevels, unsigned usage, INT32 format, INT32 pool, unsigned filter, unsigned mipfilter, INT32 color_key, void *src_info_data, PALETTEENTRY *palette, bool want_mipmap)
Definition: d3d8_common.c:189
static INLINE void d3d8_set_sampler_address_u(LPDIRECT3DDEVICE8 dev, unsigned sampler, unsigned value)
Definition: d3d8_common.h:189
#define IDirect3DDevice8_EndScene(p)
Definition: d3d8.h:364
GLuint color
Definition: glext.h:6883
#define D3DTA_TEXTURE
Definition: d3d8types.h:549
void d3d8_set_sampler_mipfilter(void *dev, unsigned sampler, unsigned value)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glext.h:6293
Definition: d3d8types.h:1506
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7672
Definition: d3d8types.h:444
GLint GLint GLsizei width
Definition: glext.h:6293
static INLINE void d3d8_texture_blit(unsigned pixel_size, void *tex, D3DLOCKED_RECT *lr, const void *frame, unsigned width, unsigned height, unsigned pitch)
Definition: d3d8_common.h:304
Definition: d3d8types.h:332
#define IDirect3DDevice8_SetTextureStageState(p, a, b, c)
Definition: d3d8.h:392
#define IDirect3DDevice8_SetTexture(p, a, b)
Definition: d3d8.h:390
static INLINE void d3d8_end_scene(LPDIRECT3DDEVICE8 dev)
Definition: d3d8_common.h:230
static INLINE void d3d8_set_texture_stage_state(LPDIRECT3DDEVICE8 dev, unsigned sampler, D3DTEXTURESTAGESTATETYPE type, unsigned value)
Definition: d3d8_common.h:181
bool d3d8_reset(void *dev, void *d3dpp)
Definition: d3d8_common.c:290
#define D3D_OK
Definition: d3d8.h:1191
int size
Definition: d3d8_common.h:63
Definition: d3d8types.h:443
GLsizei const GLfloat * value
Definition: glext.h:6709
static INLINE bool d3d8_set_vertex_shader(LPDIRECT3DDEVICE8 dev, unsigned index, void *data)
Definition: d3d8_common.h:294
enum _D3DRENDERSTATETYPE D3DRENDERSTATETYPE
size_t overlays_size
Definition: d3d8_common.h:69
interface IDirect3DSurface8 IDirect3DSurface8
Definition: d3d8.h:129
#define IDirect3D8_CheckDeviceType(p, a, b, c, d, e)
Definition: d3d8.h:193
GLsizei stride
Definition: glext.h:6488
void d3d8_deinitialize_symbols(void)
Definition: d3d8_common.c:154
LPDIRECT3DDEVICE8 dev
Definition: d3d8_common.h:56
static INLINE void * d3d8_vertex_buffer_lock(LPDIRECT3DVERTEXBUFFER8 vertbuf)
Definition: d3d8_common.h:96
#define IDirect3D8_GetAdapterDisplayMode(p, a, b)
Definition: d3d8.h:192
#define IDirect3DSurface8_LockRect(p, a, b, c)
Definition: d3d8.h:1032
static INLINE bool d3d8_get_render_state(LPDIRECT3DDEVICE8 dev, D3DRENDERSTATETYPE state, DWORD *value)
Definition: d3d8_common.h:388
static INLINE bool d3d8_get_adapter_display_mode(LPDIRECT3D8 d3d, unsigned idx, void *display_mode)
Definition: d3d8_common.h:415
GLuint sampler
Definition: glext.h:7950
static INLINE void d3d8_surface_unlock_rect(LPDIRECT3DSURFACE8 surf)
Definition: d3d8_common.h:409
GLbitfield flags
Definition: glext.h:7828
Definition: d3d8types.h:454
#define D3DTA_DIFFUSE
Definition: d3d8types.h:547
Definition: d3d8types.h:1260
static INLINE bool d3d8_texture_get_surface_level(LPDIRECT3DTEXTURE8 tex, unsigned idx, void **_ppsurface_level)
Definition: d3d8_common.h:139
enum _D3DTRANSFORMSTATETYPE D3DTRANSFORMSTATETYPE
interface IDirect3DVertexBuffer8 IDirect3DVertexBuffer8
Definition: d3d8.h:127
void * memset(void *b, int c, size_t len)
Definition: string.c:7
GLenum GLuint GLenum GLsizei length
Definition: glext.h:6233
enum _D3DBACKBUFFER_TYPE D3DBACKBUFFER_TYPE
unsigned char uint8_t
Definition: stdint.h:124
Definition: d3d8types.h:339
static INLINE void d3d8_disable_blend_func(void *data)
Definition: d3d8_common.h:348
static INLINE bool d3d8_surface_lock_rect(LPDIRECT3DSURFACE8 surf, void *data2)
Definition: d3d8_common.h:397
math_matrix_4x4 mvp_transposed
Definition: d3d8_common.h:48
#define IDirect3DDevice8_GetRenderTarget(p, a)
Definition: d3d8.h:361
#define IDirect3DTexture8_Release(p)
Definition: d3d8.h:698
GLint GLint GLsizei GLsizei height
Definition: glext.h:6293
RETRO_BEGIN_DECLS struct d3d8_video d3d8_video_t
void RARCH_ERR(const char *fmt,...)
Definition: verbosity.c:313
static INLINE void d3d8_set_render_state(LPDIRECT3DDEVICE8 dev, D3DRENDERSTATETYPE state, DWORD value)
Definition: d3d8_common.h:329
void * memcpy(void *dst, const void *src, size_t len)
Definition: string.c:26
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:12652