diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_line.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_line.cpp b/libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_line.cpp deleted file mode 100644 index 9442243..0000000 --- a/libraries/evas/src/modules/engines/direct3d/evas_direct3d_object_line.cpp +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | |||
2 | #include "evas_direct3d_object_line.h" | ||
3 | #include "evas_direct3d_device.h" | ||
4 | #include "evas_direct3d_shader_pack.h" | ||
5 | |||
6 | TArray<D3DObjectLine::Vertex> D3DObjectLine::_cache; | ||
7 | bool D3DObjectLine::_cache_enabled = false; | ||
8 | |||
9 | D3DObjectLine::D3DObjectLine() | ||
10 | { | ||
11 | _x1 = _y1 = 0; | ||
12 | _x2 = _y2 = 0; | ||
13 | } | ||
14 | |||
15 | void D3DObjectLine::BeginCache() | ||
16 | { | ||
17 | _cache.Allocate(0); | ||
18 | _cache_enabled = true; | ||
19 | } | ||
20 | |||
21 | void D3DObjectLine::EndCache(D3DDevice *d3d) | ||
22 | { | ||
23 | if (!_cache_enabled || _cache.Length() == 0) | ||
24 | return; | ||
25 | D3DShaderPack::Current()->SetVDecl(d3d, D3DShaderPack::VDECL_XYC); | ||
26 | D3DShaderPack::Current()->SetVS(d3d, D3DShaderPack::VS_COPY_COLOR); | ||
27 | D3DShaderPack::Current()->SetPS(d3d, D3DShaderPack::PS_COLOR); | ||
28 | d3d->GetDevice()->DrawPrimitiveUP(D3DPT_LINELIST, _cache.Length() / 2, | ||
29 | _cache.Data(), sizeof(Vertex)); | ||
30 | |||
31 | DBG("Line cache drawn: %d items", _cache.Length() / 2); | ||
32 | _cache_enabled = false; | ||
33 | } | ||
34 | |||
35 | void D3DObjectLine::Draw(D3DDevice *d3d) | ||
36 | { | ||
37 | Vertex data[2] = {{_x1, _y1, _color}, {_x2, _y2, _color}}; | ||
38 | |||
39 | if (!_cache_enabled) | ||
40 | { | ||
41 | D3DShaderPack::Current()->SetVDecl(d3d, D3DShaderPack::VDECL_XYC); | ||
42 | D3DShaderPack::Current()->SetVS(d3d, D3DShaderPack::VS_COPY_COLOR); | ||
43 | D3DShaderPack::Current()->SetPS(d3d, D3DShaderPack::PS_COLOR); | ||
44 | d3d->GetDevice()->DrawPrimitiveUP(D3DPT_LINELIST, 1, data, sizeof(Vertex)); | ||
45 | } | ||
46 | else | ||
47 | { | ||
48 | _cache.Add(data[0]); | ||
49 | _cache.Add(data[1]); | ||
50 | } | ||
51 | } | ||
52 | |||
53 | void D3DObjectLine::Setup(FLOAT x1, FLOAT y1, FLOAT x2, FLOAT y2, DWORD color) | ||
54 | { | ||
55 | _x1 = x1; | ||
56 | _y1 = y1; | ||
57 | _x2 = x2; | ||
58 | _y2 = y2; | ||
59 | _color = color; | ||
60 | } | ||