diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/evas/src/modules/engines/direct3d/evas_direct3d_device.h | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/modules/engines/direct3d/evas_direct3d_device.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/libraries/evas/src/modules/engines/direct3d/evas_direct3d_device.h b/libraries/evas/src/modules/engines/direct3d/evas_direct3d_device.h new file mode 100644 index 0000000..c5a4b49 --- /dev/null +++ b/libraries/evas/src/modules/engines/direct3d/evas_direct3d_device.h | |||
@@ -0,0 +1,87 @@ | |||
1 | #ifndef __EVAS_DIRECT3D_DEVICE_H__ | ||
2 | #define __EVAS_DIRECT3D_DEVICE_H__ | ||
3 | |||
4 | #include "evas_engine.h" | ||
5 | |||
6 | #include <assert.h> | ||
7 | |||
8 | #include "ref.h" | ||
9 | #include "array.h" | ||
10 | |||
11 | |||
12 | class D3DDevice : virtual public Referenc | ||
13 | { | ||
14 | public: | ||
15 | D3DDevice(); | ||
16 | |||
17 | bool Init(HWND window, int depth, bool fullscreen = false); | ||
18 | bool Reset(int width, int height, int fullscreen); | ||
19 | void Destroy(); | ||
20 | bool Begin(); | ||
21 | bool End(); | ||
22 | |||
23 | inline LPDIRECT3DDEVICE9 GetDevice(); | ||
24 | inline int GetWidth(); | ||
25 | inline int GetHeight(); | ||
26 | inline HWND GetWindow(); | ||
27 | inline bool GetFullscreen(); | ||
28 | |||
29 | TArray<DWORD> &GetRenderData(); | ||
30 | |||
31 | HRESULT SetTexture(DWORD stage, LPDIRECT3DTEXTURE9 tex); | ||
32 | |||
33 | private: | ||
34 | HRESULT RestoreDevice(); | ||
35 | HRESULT ResetDevice(); | ||
36 | void ResetParams(); | ||
37 | |||
38 | HRESULT CreateRenderTarget(); | ||
39 | |||
40 | private: | ||
41 | HWND _window; | ||
42 | LPDIRECT3D9 _object; | ||
43 | LPDIRECT3DDEVICE9 _device; | ||
44 | int _width; | ||
45 | int _height; | ||
46 | int _rot; | ||
47 | int _depth; | ||
48 | bool _device_lost; | ||
49 | bool _scene_rendering; | ||
50 | D3DPRESENT_PARAMETERS _d3dpp; | ||
51 | D3DSURFACE_DESC _backbuffer_desc; | ||
52 | //LPDIRECT3DSURFACE9 _render_target; | ||
53 | LPDIRECT3DSURFACE9 _render_target_data; | ||
54 | //LPDIRECT3DSURFACE9 _original_render_target; | ||
55 | //bool _render_to_texture; | ||
56 | TArray<DWORD> _render_data; | ||
57 | bool _render_data_updated; | ||
58 | |||
59 | TArray<LPDIRECT3DTEXTURE9> _textures; | ||
60 | }; | ||
61 | |||
62 | LPDIRECT3DDEVICE9 D3DDevice::GetDevice() | ||
63 | { | ||
64 | return _device; | ||
65 | } | ||
66 | |||
67 | int D3DDevice::GetWidth() | ||
68 | { | ||
69 | return _width; | ||
70 | } | ||
71 | |||
72 | int D3DDevice::GetHeight() | ||
73 | { | ||
74 | return _height; | ||
75 | } | ||
76 | |||
77 | HWND D3DDevice::GetWindow() | ||
78 | { | ||
79 | return _window; | ||
80 | } | ||
81 | |||
82 | bool D3DDevice::GetFullscreen() | ||
83 | { | ||
84 | return (_d3dpp.Windowed == 0); | ||
85 | } | ||
86 | |||
87 | #endif // __EVAS_DIRECT3D_DEVICE_H__ | ||