summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/drawd3d.h
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-02-18 15:57:34 +0100
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-02-21 03:03:23 +0100
commit9a47a870df619656e9092f2f77622e84e640307a (patch)
treeb8640bf79ffb55d0c9ed6fc27bbd4ce16a5e1a2e /src/osd/modules/render/drawd3d.h
parentdadf8e7d79696996ab3ef840fe99a588ede538fa (diff)
First take on render API reorg, nw
Diffstat (limited to 'src/osd/modules/render/drawd3d.h')
-rw-r--r--src/osd/modules/render/drawd3d.h123
1 files changed, 33 insertions, 90 deletions
diff --git a/src/osd/modules/render/drawd3d.h b/src/osd/modules/render/drawd3d.h
index 906bd7711b8..ac7195db8d7 100644
--- a/src/osd/modules/render/drawd3d.h
+++ b/src/osd/modules/render/drawd3d.h
@@ -9,9 +9,10 @@
#ifndef __WIN_DRAWD3D__
#define __WIN_DRAWD3D__
+#ifdef OSD_WINDOWS
-#include "modules/render/d3d/d3dhlsl.h"
-
+#include "d3d/d3dintf.h"
+#include "d3d/d3dcomm.h"
//============================================================
// CONSTANTS
@@ -24,87 +25,29 @@
// TYPE DEFINITIONS
//============================================================
-namespace d3d
-{
-class cache_target;
-class render_target;
-class renderer;
-
-/* cache_target is a simple linked list containing only a rednerable target and texture, used for phosphor effects */
-class cache_target
-{
-public:
- // construction/destruction
- cache_target() { }
- ~cache_target();
-
- bool init(renderer *d3d, base *d3dintf, int width, int height, int prescale_x, int prescale_y);
-
- surface *last_target;
- texture *last_texture;
-
- int target_width;
- int target_height;
-
- int width;
- int height;
-
- int screen_index;
-
- cache_target *next;
- cache_target *prev;
-};
-
-/* render_target is the information about a Direct3D render target chain */
-class render_target
-{
-public:
- // construction/destruction
- render_target() { }
- ~render_target();
-
- bool init(renderer *d3d, base *d3dintf, int width, int height, int prescale_x, int prescale_y);
- int next_index(int index) { return ++index > 1 ? 0 : index; }
-
- int target_width;
- int target_height;
-
- int prescale_x;
- int prescale_y;
-
- int width;
- int height;
-
- int screen_index;
- int page_index;
-
- surface *prescale_target[2];
- texture *prescale_texture[2];
- surface *native_target[2];
- texture *native_texture[2];
-
- render_target *next;
- render_target *prev;
-
- surface *bloom_target[11];
- texture *bloom_texture[11];
-};
+class vertex;
+class texture_info;
+class texture_manager;
+class device;
+class vertex_buffer;
+class shaders;
+class hlsl_options;
+class poly_info;
/* renderer is the information about Direct3D for the current screen */
-class renderer : public osd_renderer
+class renderer_d3d9 : public osd_renderer
{
public:
- //renderer() { }
- renderer(osd_window *window);
- virtual ~renderer();
+ renderer_d3d9(osd_window *window);
+ virtual ~renderer_d3d9();
virtual int create() override;
+ virtual int init(running_machine &machine) override;
virtual render_primitive_list *get_primitives() override;
virtual int draw(const int update) override;
virtual void save() override;
virtual void record() override;
virtual void toggle_fsfx() override;
- virtual void destroy() override;
int initialize();
@@ -140,8 +83,8 @@ public:
void set_texture(texture_info *texture);
void set_filter(int filter);
- void set_wrap(D3DTEXTUREADDRESS wrap);
- void set_modmode(DWORD modmode);
+ void set_wrap(unsigned int wrap);
+ void set_modmode(int modmode);
void set_blendmode(int blendmode);
void reset_render_states();
@@ -164,15 +107,15 @@ public:
bool is_mod2x_supported() { return (bool)m_mod2x_supported; }
bool is_mod4x_supported() { return (bool)m_mod4x_supported; }
- D3DFORMAT get_screen_format() { return m_screen_format; }
- D3DFORMAT get_pixel_format() { return m_pixformat; }
- D3DDISPLAYMODE get_origmode() { return m_origmode; }
+ D3DFORMAT get_screen_format() { return m_screen_format; }
+ D3DFORMAT get_pixel_format() { return m_pixformat; }
+ D3DDISPLAYMODE get_origmode() { return m_origmode; }
UINT32 get_last_texture_flags() { return m_last_texture_flags; }
- texture_manager * get_texture_manager() { return m_texture_manager; }
- texture_info * get_default_texture() { return m_texture_manager->get_default_texture(); }
- texture_info * get_vector_texture() { return m_texture_manager->get_vector_texture(); }
+ d3d_texture_manager * get_texture_manager() { return m_texture_manager; }
+ texture_info * get_default_texture();
+ texture_info * get_vector_texture();
shaders * get_shaders() { return m_shaders; }
hlsl_options * get_shaders_options() { return m_shaders_options; }
@@ -186,9 +129,9 @@ private:
device * m_device; // pointer to the Direct3DDevice object
int m_gamma_supported; // is full screen gamma supported?
- present_parameters m_presentation; // set of presentation parameters
- D3DDISPLAYMODE m_origmode; // original display mode for the adapter
- D3DFORMAT m_pixformat; // pixel format we are using
+ present_parameters m_presentation; // set of presentation parameters
+ D3DDISPLAYMODE m_origmode; // original display mode for the adapter
+ D3DFORMAT m_pixformat; // pixel format we are using
vertex_buffer * m_vertexbuf; // pointer to the vertex buffer object
vertex * m_lockedbuf; // pointer to the locked vertex buffer
@@ -197,14 +140,14 @@ private:
vertex * m_vectorbatch; // pointer to the vector batch buffer
int m_batchindex; // current index into the vector batch
- poly_info m_poly[VERTEX_BUFFER_SIZE/3];// array to hold polygons as they are created
+ poly_info m_poly[VERTEX_BUFFER_SIZE/3];// array to hold polygons as they are created
int m_numpolys; // number of accumulated polygons
bool m_restarting; // if we're restarting
int m_mod2x_supported; // is D3DTOP_MODULATE2X supported?
int m_mod4x_supported; // is D3DTOP_MODULATE4X supported?
- D3DFORMAT m_screen_format; // format to use for screen textures
+ D3DFORMAT m_screen_format; // format to use for screen textures
texture_info * m_last_texture; // previous texture
UINT32 m_last_texture_flags; // previous texture flags
@@ -213,18 +156,18 @@ private:
int m_last_blendsrc; // previous blendmode
int m_last_blenddst; // previous blendmode
int m_last_filter; // previous texture filter
- D3DTEXTUREADDRESS m_last_wrap; // previous wrap state
- DWORD m_last_modmode; // previous texture modulation
+ UINT32 m_last_wrap; // previous wrap state
+ int m_last_modmode; // previous texture modulation
void * m_hlsl_buf; // HLSL vertex data
shaders * m_shaders; // HLSL interface
hlsl_options * m_shaders_options; // HLSL options
- texture_manager * m_texture_manager; // texture manager
+ d3d_texture_manager * m_texture_manager; // texture manager
int m_line_count;
};
-}
+#endif // OSD_WINDOWS
-#endif
+#endif // __WIN_DRAWD3D__ \ No newline at end of file