3 #ifndef __SFJP_ROAST_EX__graphics__directx__dx10__shader_HPP__
4 #define __SFJP_ROAST_EX__graphics__directx__dx10__shader_HPP__
6 #include "roast/graphics/directx/dx10/device.hpp"
7 #include "roast/graphics/directx/dx10/buffer.hpp"
17 ///////////////////////////////////////////////////////////////////////////
24 exception_codes__head = exception_code_root::shader,
26 buffer__CreateBuffer_Failed
32 shader_device(device &d) : m_dev(d)
38 template <typename VERTEX_TYPE>
39 void set_vertex_buffer(const input_vertex_buffer<VERTEX_TYPE> &vb)// const OK...?
41 typename const input_vertex_buffer<VERTEX_TYPE>::_IfType *buffer_ptr = vb.get_buffer_ptr();
42 UINT stride = sizeof(VERTEX_TYPE);
44 m_dev.get_d3ddevice_ptr()->IASetVertexBuffers( 0, 1, (ID3D10Buffer *const *)&buffer_ptr, &stride, &offset );
47 void set_primitive_topology(::D3D10_PRIMITIVE_TOPOLOGY topology)
49 m_dev.get_d3ddevice_ptr()->IASetPrimitiveTopology(topology);
52 void draw(UINT vertex_count, UINT vertex_offset=0)
54 m_dev.get_d3ddevice_ptr()->Draw(vertex_count, vertex_offset);
57 void draw_primitive(::D3D10_PRIMITIVE_TOPOLOGY topology, UINT vertex_count, UINT vertex_offset=0)
59 set_primitive_topology(topology);
60 draw(vertex_count, vertex_offset);
63 typedef shader_device render_device, renderer;
65 ///////////////////////////////////////////////////////////////////////////
71 #endif//__SFJP_ROAST_EX__graphics__directx__dx10__shader_HPP__