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_scene.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 'libraries/evas/src/modules/engines/direct3d/evas_direct3d_scene.h')
-rw-r--r-- | libraries/evas/src/modules/engines/direct3d/evas_direct3d_scene.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/libraries/evas/src/modules/engines/direct3d/evas_direct3d_scene.h b/libraries/evas/src/modules/engines/direct3d/evas_direct3d_scene.h new file mode 100644 index 0000000..e2f5f94 --- /dev/null +++ b/libraries/evas/src/modules/engines/direct3d/evas_direct3d_scene.h | |||
@@ -0,0 +1,63 @@ | |||
1 | #ifndef __EVAS_DIRECT3D_SCENE_H__ | ||
2 | #define __EVAS_DIRECT3D_SCENE_H__ | ||
3 | |||
4 | #include "evas_engine.h" | ||
5 | |||
6 | #include <assert.h> | ||
7 | #include <typeinfo> | ||
8 | |||
9 | #include "ref.h" | ||
10 | #include "array.h" | ||
11 | |||
12 | #include "evas_direct3d_object.h" | ||
13 | |||
14 | class D3DDevice; | ||
15 | |||
16 | class D3DScene : virtual public Referenc | ||
17 | { | ||
18 | public: | ||
19 | D3DScene(); | ||
20 | |||
21 | void FreeObjects(); | ||
22 | |||
23 | inline void AddObject(D3DObject *object); | ||
24 | inline int GetObjectCount(); | ||
25 | void DeleteObject(D3DObject *object); | ||
26 | |||
27 | void DrawAll(D3DDevice *d3d); | ||
28 | |||
29 | template <class T> T *GetFreeObject() | ||
30 | { | ||
31 | for (int i = 0; i < _objects.Length(); i++) | ||
32 | { | ||
33 | if (typeid(T) == typeid(*_objects[i].Addr()) && _objects[i]->IsFree()) | ||
34 | return (T *)_objects[i].Addr(); | ||
35 | } | ||
36 | return NULL; | ||
37 | } | ||
38 | |||
39 | template <class T> void GetObjectsOfType(TArray<T *> &res) | ||
40 | { | ||
41 | for (int i = 0; i < _objects.Length(); i++) | ||
42 | { | ||
43 | if (typeid(T) == typeid(*_objects[i].Addr())) | ||
44 | res.Add((T *)_objects[i].Addr()); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | private: | ||
49 | TArray<Ref<D3DObject> > _objects; | ||
50 | }; | ||
51 | |||
52 | void D3DScene::AddObject(D3DObject *object) | ||
53 | { | ||
54 | assert(object != NULL); | ||
55 | _objects.Add(object); | ||
56 | } | ||
57 | |||
58 | int D3DScene::GetObjectCount() | ||
59 | { | ||
60 | return _objects.Length(); | ||
61 | } | ||
62 | |||
63 | #endif // __EVAS_DIRECT3D_SCENE_H__ | ||