diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_rect.cpp | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to 'libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_rect.cpp')
-rw-r--r-- | libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_rect.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_rect.cpp b/libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_rect.cpp deleted file mode 100644 index ebdd22b..0000000 --- a/libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_rect.cpp +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | #include "evas_direct3d_object_rect.h" | ||
2 | #include "evas_direct3d_device.h" | ||
3 | #include "evas_direct3d_shader_pack.h" | ||
4 | |||
5 | TArray<D3DObjectRect::Vertex> D3DObjectRect::_cache; | ||
6 | bool D3DObjectRect::_cache_enabled = false; | ||
7 | |||
8 | D3DObjectRect::D3DObjectRect() | ||
9 | { | ||
10 | _x = _y = 0; | ||
11 | _w = _h = 0; | ||
12 | } | ||
13 | |||
14 | void D3DObjectRect::BeginCache() | ||
15 | { | ||
16 | _cache.Allocate(0); | ||
17 | _cache_enabled = true; | ||
18 | } | ||
19 | |||
20 | void D3DObjectRect::EndCache(D3DDevice *d3d) | ||
21 | { | ||
22 | if (!_cache_enabled || _cache.Length() == 0) | ||
23 | return; | ||
24 | D3DShaderPack::Current()->SetVDecl(d3d, D3DShaderPack::VDECL_XYC); | ||
25 | D3DShaderPack::Current()->SetVS(d3d, D3DShaderPack::VS_COPY_COLOR); | ||
26 | D3DShaderPack::Current()->SetPS(d3d, D3DShaderPack::PS_COLOR); | ||
27 | d3d->GetDevice()->DrawPrimitiveUP(D3DPT_TRIANGLELIST, _cache.Length() / 3, | ||
28 | _cache.Data(), sizeof(Vertex)); | ||
29 | |||
30 | DBG("Rect cache drawn: %d items", _cache.Length() / 6); | ||
31 | _cache_enabled = false; | ||
32 | } | ||
33 | |||
34 | void D3DObjectRect::Draw(D3DDevice *d3d) | ||
35 | { | ||
36 | Vertex data[6] = { | ||
37 | {_x, _y, _color}, {_x + _w, _y, _color}, {_x, _y + _h, _color}, | ||
38 | {_x, _y + _h, _color}, {_x + _w, _y, _color}, {_x + _w, _y + _h, _color}}; | ||
39 | |||
40 | if (!_cache_enabled) | ||
41 | { | ||
42 | D3DShaderPack::Current()->SetVDecl(d3d, D3DShaderPack::VDECL_XYC); | ||
43 | D3DShaderPack::Current()->SetVS(d3d, D3DShaderPack::VS_COPY_COLOR); | ||
44 | D3DShaderPack::Current()->SetPS(d3d, D3DShaderPack::PS_COLOR); | ||
45 | d3d->GetDevice()->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 2, data, sizeof(Vertex)); | ||
46 | } | ||
47 | else | ||
48 | { | ||
49 | _cache.Add(data[0]); | ||
50 | _cache.Add(data[1]); | ||
51 | _cache.Add(data[2]); | ||
52 | _cache.Add(data[3]); | ||
53 | _cache.Add(data[4]); | ||
54 | _cache.Add(data[5]); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | void D3DObjectRect::Setup(FLOAT x, FLOAT y, FLOAT w, FLOAT h, DWORD color) | ||
59 | { | ||
60 | _x = x; | ||
61 | _y = y; | ||
62 | _w = w; | ||
63 | _h = h; | ||
64 | _color = color; | ||
65 | } | ||