32 #ifndef ZENI_VIDEO_DX9_H
33 #define ZENI_VIDEO_DX9_H
75 typedef HRESULT (WINAPI *D3DXCreateRenderToSurface_fcn)(
83 typedef HRESULT (WINAPI *D3DXCreateTexture_fcn)(
92 typedef HRESULT (WINAPI *D3DXFilterTexture_fcn)(
97 typedef HRESULT (WINAPI *D3DXCreateMatrixStack_fcn)(
100 typedef HRESULT (WINAPI *D3DXCompileShader_fcn)(
105 LPCSTR pFunctionName,
121 bool begin_prerender();
125 void clear_depth_buffer();
128 int get_maximum_anisotropy()
const;
129 bool has_vertex_buffers()
const;
132 void set_2d_view(
const std::pair<Point2f, Point2f> &camera2d,
133 const std::pair<Point2i, Point2i> &viewport = std::make_pair(
Point2i(),
get_Video().get_render_target_size()),
134 const bool &fix_aspect_ratio =
false);
135 void set_3d_view(
const Camera &camera,
136 const std::pair<Point2i, Point2i> &viewport = std::make_pair(
Point2i(),
get_Video().get_render_target_size()));
137 void set_backface_culling(
const bool &on);
138 void set_vertical_sync(
const bool &on);
139 void set_zwrite(
const bool &
enabled);
140 void set_ztest(
const bool &
enabled);
141 void set_alpha_test(
const bool &
enabled,
const TEST &test,
const float &
value);
144 void set_Color(
const Color & );
147 void apply_Texture(
const unsigned long &
id);
149 void unapply_Texture();
152 void set_lighting(
const bool &on =
true);
153 void set_ambient_lighting(
const Color &
color);
154 void set_Light(
const int &number,
const Light &
light);
155 void unset_Light(
const int &number);
156 void set_Material(
const Material &material);
157 void unset_Material(
const Material &material);
160 void set_Fog(
const Fog &fog);
165 void unset_program();
169 void unset_render_target();
171 const Point2i & get_render_target_size()
const;
175 void push_world_stack();
176 void pop_world_stack();
177 void translate_scene(
const Vector3f &direction);
178 void rotate_scene(
const Vector3f &about,
const float &radians);
179 void scale_scene(
const Vector3f &factor);
180 void transform_scene(
const Matrix4f &transformation);
183 Point2f get_pixel_offset()
const;
184 void set_view_matrix(
const Matrix4f &view);
185 void set_projection_matrix(
const Matrix4f &projection);
186 void set_viewport(
const std::pair<Point2i, Point2i> &viewport =
190 Texture * load_Texture(
const String &
filename,
const bool &repeat,
const bool &lazy_loading =
false);
194 const float &glyph_height,
const float &virtual_screen_height);
201 const D3DCAPS9 & get_d3d_capabilities();
206 inline const int & get_dpi();
207 inline float get_dpi_ratio();
210 bool is_fvf_3d()
const;
211 void set_fvf_3d(
const bool &on);
212 void set_fvf(
const bool &is_3d);
218 void destroy_device();
224 static Direct3DCreate9_fcn g_Direct3DCreate9;
227 static D3DXCreateRenderToSurface_fcn g_D3DXCreateRenderToSurface;
228 static D3DXCreateTexture_fcn g_D3DXCreateTexture;
229 static D3DXFilterTexture_fcn g_D3DXFilterTexture;
230 static D3DXCreateMatrixStack_fcn g_D3DXCreateMatrixStack;
231 static D3DXCompileShader_fcn g_D3DXCompileShader;
235 LPD3DCAPS9 m_d3d_capabilities;
236 LPD3DPRESENT_PARAMETERS m_d3d_parameters;
244 bool m_textured, m_fvf_3d;
struct IDirect3D9 IDirect3D9
An Abstraction of a Light.
struct _D3DXMACRO * LPD3DXMACRO
The Direct3D9 Rendering System.
struct IDirect3DDevice9 * LPDIRECT3DDEVICE9
const GLubyte GLuint GLuint GLuint GLuint alpha GLboolean GLboolean GLboolean GLboolean alpha GLint GLint GLsizei GLsizei GLenum type GLenum GLint GLenum GLint GLint GLsizei GLsizei GLint border GLenum GLint GLint GLint GLint GLint GLsizei GLsizei height GLsizei GLsizei GLenum GLenum const GLvoid *pixels GLenum GLint GLint GLint GLint j2 GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum light
The Video Rendering Singleton.
typedef HRESULT(WINAPI *LPD3DXIMTSIGNALCALLBACK)(CONST D3DXVECTOR2 *uv
virtual void set_clear_Color(const Color &color)=0
Set the blank background color.
struct tagPALETTEENTRY PALETTEENTRY
GLenum GLsizei const GLuint GLboolean enabled
static void init(struct bs2b *bs2b)
static void render(const Vertex_Buffer_Macrorenderer ¯orenderer, std::vector< Vertex_Buffer::Vertex_Buffer_Range * > &descriptors)
An Abstraction of a Material.
static D3DXCreateMatrixStack_fcn D3DXCreateMatrixStack()
struct IDirect3D9 * LPDIRECT3D9
EGLImageKHR EGLint * name
static Direct3DCreate9_fcn Direct3DCreate9()
struct IDirect3DTexture9 * LPDIRECT3DTEXTURE9
typedef UINT(WINAPI *PFNWGLGETCONTEXTGPUIDAMDPROC)(HGLRC hglrc)
interface IDirect3DSurface9 IDirect3DSurface9
static D3DXCompileShader_fcn D3DXCompileShader()
interface ID3DXConstantTable ID3DXConstantTable
struct _D3DCAPS9 * LPD3DCAPS9
interface ID3DXConstantTable * LPD3DXCONSTANTTABLE
enum _D3DFORMAT D3DFORMAT
void apply_Texture(const String &name)
Apply a texture by name.
An Abstraction of a Texture.
A Featureful 3-Space Vector Class.
interface ID3DXRenderToSurface ID3DXRenderToSurface
interface ID3DXRenderToSurface * LPD3DXRENDERTOSURFACE
interface ID3DXInclude * LPD3DXINCLUDE
static D3DXCreateRenderToSurface_fcn D3DXCreateRenderToSurface()
interface ID3DXMatrixStack * LPD3DXMATRIXSTACK
static D3DXCreateTexture_fcn D3DXCreateTexture()
GLbitfield GLuint program
static D3DXFilterTexture_fcn D3DXFilterTexture()
A Vertex_Buffer that accepts Triangle and Quadrilaterals.
void set_clear_Color(const Color &color)
Set the blank background color.
interface ID3DXInclude ID3DXInclude
void select_world_matrix()
Select the world (model view) matrix; Call before [translate/rotate/scale] scene. ...
interface ID3DXMatrixStack ID3DXMatrixStack
GLenum GLenum GLuint texture
EGLSurface EGLint void ** value
A base class for Vertex_Shader and Fragment_Shader.
struct IDirect3DBaseTexture9 * LPDIRECT3DBASETEXTURE9
typedef DWORD(WINAPI *XInputGetState_t)(DWORD dwUserIndex
interface IDirect3DDevice9 IDirect3DDevice9
interface IDirect3DTexture9 IDirect3DTexture9
interface ID3DXBuffer * LPD3DXBUFFER
Video & get_Video()
Get access to the singleton.
A Featureful 4-Space Matrix Class.
interface IDirect3DBaseTexture9 IDirect3DBaseTexture9
struct IDirect3DSurface9 * LPDIRECT3DSURFACE9
A 2D Point represented with floats.
struct _D3DPRESENT_PARAMETERS_ * LPD3DPRESENT_PARAMETERS
void apply_Texture(const String &name)
Apply a texture by name.
interface ID3DXBuffer ID3DXBuffer
typedef BOOL(WINAPI *PFNWGLSETSTEREOEMITTERSTATE3DLPROC)(HDC hDC
A 2D Point represented with integers.