Last change
on this file since 140 was
140,
checked in by sam, 12 years ago
|
Implement Video::Capture and create a GROUP_RENDER_CAPTURE tick group.
|
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Line | |
---|
1 | // |
---|
2 | // Deus Hax (working title) |
---|
3 | // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> |
---|
4 | // |
---|
5 | |
---|
6 | // |
---|
7 | // The Asset class |
---|
8 | // --------------- |
---|
9 | // Assets are objects that can be ticked by the game loop and/or the render |
---|
10 | // loop. Assets are implemented as one or several linked lists. See the |
---|
11 | // Ticker class for the ticking logic and the linked list implementation. |
---|
12 | // |
---|
13 | |
---|
14 | #if !defined __DH_ASSET_H__ |
---|
15 | #define __DH_ASSET_H__ |
---|
16 | |
---|
17 | #include <stdint.h> |
---|
18 | |
---|
19 | class Asset |
---|
20 | { |
---|
21 | friend class Ticker; |
---|
22 | friend class TickerData; |
---|
23 | |
---|
24 | public: |
---|
25 | virtual void Ref(); |
---|
26 | virtual int Unref(); |
---|
27 | |
---|
28 | protected: |
---|
29 | typedef enum |
---|
30 | { |
---|
31 | GROUP_BEFORE = 0, |
---|
32 | GROUP_DEFAULT, |
---|
33 | GROUP_AFTER, |
---|
34 | GROUP_RENDER_CAPTURE, |
---|
35 | // Must be the last element |
---|
36 | GROUP_COUNT |
---|
37 | } |
---|
38 | Group; |
---|
39 | |
---|
40 | Asset(); |
---|
41 | virtual ~Asset(); |
---|
42 | |
---|
43 | virtual Group GetGroup(); |
---|
44 | |
---|
45 | virtual void TickGame(float delta_time); |
---|
46 | virtual void TickRender(float delta_time); |
---|
47 | |
---|
48 | Asset *next; |
---|
49 | int ref, destroy; |
---|
50 | |
---|
51 | #if !FINAL_RELEASE |
---|
52 | enum |
---|
53 | { |
---|
54 | STATE_IDLE = 0, |
---|
55 | STATE_PRETICK_GAME, |
---|
56 | STATE_POSTTICK_GAME, |
---|
57 | STATE_PRETICK_RENDER, |
---|
58 | STATE_POSTTICK_RENDER, |
---|
59 | } |
---|
60 | state; |
---|
61 | #endif |
---|
62 | }; |
---|
63 | |
---|
64 | #endif // __DH_ASSET_H__ |
---|
65 | |
---|
Note: See
TracBrowser
for help on using the repository browser.