RetroArch
d3d_common.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2011-2017 - Daniel De Matteis
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef _D3D_COMMON_H
17 #define _D3D_COMMON_H
18 
19 #ifdef HAVE_CONFIG_H
20 #include "../../config.h"
21 #endif
22 
23 #if !defined(__WINRT__) && !defined(_XBOX)
24 
25 #ifndef HAVE_WINDOW
26 #define HAVE_WINDOW
27 #endif
28 
29 #ifndef HAVE_MONITOR
30 #define HAVE_MONITOR
31 #endif
32 
33 #endif
34 
35 #include <boolean.h>
36 #include <retro_common_api.h>
37 
38 #include "../font_driver.h"
39 #include "../video_driver.h"
40 
42 
43 struct d3d_matrix
44 {
45  union {
46  struct {
47  float _11, _12, _13, _14;
48  float _21, _22, _23, _24;
49  float _31, _32, _33, _34;
50  float _41, _42, _43, _44;
51 
52  };
53  float m[4][4];
54  };
55 };
56 
57 
58 typedef struct d3d_texture
59 {
60  void *data;
63 
64 typedef struct
65 {
66  bool fullscreen;
67  bool enabled;
68  unsigned tex_w, tex_h;
69  float tex_coords[4];
70  float vert_coords[4];
71  float alpha_mod;
72  void *tex;
73  void *vert_buf;
74 } overlay_t;
75 
76 typedef struct Vertex
77 {
78  float x, y, z;
80  float u, v;
81 } Vertex;
82 
83 #ifndef BYTE_CLAMP
84 #define BYTE_CLAMP(i) (int) ((((i) > 255) ? 255 : (((i) < 0) ? 0 : (i))))
85 #endif
86 
87 #define D3DTADDRESS_COMM_CLAMP 3
88 #define D3DTEXF_COMM_LINEAR 2
89 #define D3DPT_COMM_TRIANGLESTRIP 5
90 
91 /* Clear target surface */
92 #define D3D_COMM_CLEAR_TARGET 0x00000001l
93 
94 void *d3d_matrix_transpose(void *_pout, const void *_pm);
95 
96 void *d3d_matrix_identity(void *_pout);
97 
98 void *d3d_matrix_ortho_off_center_lh(void *_pout,
99  float l, float r, float b, float t, float zn, float zf);
100 
101 void *d3d_matrix_multiply(void *_pout,
102  const void *_pm1, const void *_pm2);
103 
104 void *d3d_matrix_rotation_z(void *_pout, float angle);
105 
107 
108 void d3d_input_driver(const char* input_name,
109  const char* joypad_name, const input_driver_t** input, void** input_data);
110 
112 
113 #endif
float _12
Definition: d3d_common.h:47
Definition: d3d_common.h:64
float v
Definition: d3d_common.h:80
void d3d_input_driver(const char *input_name, const char *joypad_name, const input_driver_t **input, void **input_data)
Definition: d3d_common.c:132
float _43
Definition: d3d_common.h:50
float _11
Definition: d3d_common.h:47
float x
Definition: d3d_common.h:78
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
float _34
Definition: d3d_common.h:49
Definition: d3d_common.h:58
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
GLdouble GLdouble t
Definition: glext.h:6398
Definition: d3d_common.h:43
float _13
Definition: d3d_common.h:47
float _24
Definition: d3d_common.h:48
float _33
Definition: d3d_common.h:49
GLfloat angle
Definition: glext.h:11760
float u
Definition: d3d_common.h:80
void * tex
Definition: d3d_common.h:72
Definition: d3d_common.h:76
void * d3d_matrix_identity(void *_pout)
Definition: d3d_common.c:40
uint32_t color
Definition: d3d_common.h:79
GLenum GLenum GLenum input
Definition: glext.h:9938
int32_t d3d_translate_filter(unsigned type)
Definition: d3d_common.c:112
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
struct d3d_texture d3d_texture_t
void * d3d_matrix_ortho_off_center_lh(void *_pout, float l, float r, float b, float t, float zn, float zf)
Definition: d3d_common.c:65
float y
Definition: d3d_common.h:78
float _44
Definition: d3d_common.h:50
unsigned tex_w
Definition: d3d_common.h:68
void * d3d_matrix_multiply(void *_pout, const void *_pm1, const void *_pm2)
Definition: d3d_common.c:81
float _41
Definition: d3d_common.h:50
float _23
Definition: d3d_common.h:48
GLenum type
Definition: glext.h:6233
Definition: input_driver.h:132
int32_t INT32
Definition: coretypes.h:17
bool l
Definition: connect_wiiupro.c:37
float _31
Definition: d3d_common.h:49
float _32
Definition: d3d_common.h:49
float alpha_mod
Definition: d3d_common.h:71
static const GLfloat tex_coords[]
Definition: gl.c:105
void * d3d_matrix_rotation_z(void *_pout, float angle)
Definition: d3d_common.c:100
float _21
Definition: d3d_common.h:48
bool fullscreen
Definition: d3d_common.h:66
struct Vertex Vertex
signed int int32_t
Definition: stdint.h:123
float z
Definition: d3d_common.h:78
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
void * vert_buf
Definition: d3d_common.h:73
float _22
Definition: d3d_common.h:48
void * data
Definition: d3d_common.h:60
void * d3d_matrix_transpose(void *_pout, const void *_pm)
Definition: d3d_common.c:25
INT32 pool
Definition: d3d_common.h:61
float _14
Definition: d3d_common.h:47
float _42
Definition: d3d_common.h:50
bool enabled
Definition: d3d_common.h:67
unsigned int uint32_t
Definition: stdint.h:126
const GLfloat * m
Definition: glext.h:11755