throw api_exception(msg, api_ret);
}
- ///////////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////////////////
template <typename T>
class iunknown_
T* get_internal_if_ptr(){ return m_if; }
T* get_internal_ptr(){ return m_if; }
};
+
+ ///////////////////////////////////////////////////////////////////////////////////////
+
+ typedef ::D3DCOLOR color_t;
+
+ namespace colordef
+ {
+ enum
+ {
+ black = 0x00000000,
+ blue = 0x000000ff,
+ white = 0x00ffffff
+ };
+ }
}
}
if ( hr != D3D_OK )
throw api_error("IDirect3D9::CreateDevice() Failed.", hr);
}
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ void begin_scene()
+ {
+ //if ( m_if == NULL )
+ // throw exception("device::begin_scene() not normally initialized.");
+
+ HRESULT hr = m_if->BeginScene();
+ if ( hr != D3D_OK )
+ throw api_error("IDirect3DDevice9::BeginScene() Failed.", hr);
+ }
+
+ void end_scene()
+ {
+ HRESULT hr = m_if->EndScene();
+ if ( hr != D3D_OK )
+ throw api_error("IDirect3DDevice9::EndScene() Failed.", hr);
+ }
+
+ void clear(const color_t& cl=colordef::black)
+ {
+ HRESULT hr = m_if->EndScene();
+ if ( hr != D3D_OK )
+ throw api_error("IDirect3DDevice9::EndScene() Failed.", hr);
+ }
+ //Clear
+
+ //////////////////////////////////////////////////////////////////////////////
+
idirect3d_device* get_idirect3d_device_ptr(){ return get_internal_ptr(); }
};