1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     device.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 46365 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_SAMPLE_DEMOS_DEMO1_DEVICE_H_
17 #define NN_SAMPLE_DEMOS_DEMO1_DEVICE_H_
18 
19 #include "demo.h"
20 
21 enum DEVICE_STATE
22 {
23     DEVICE_STATE_OFF = 0,
24     DEVICE_STATE_STANDBY,
25     DEVICE_STATE_ON
26 };
27 
28 class Device
29 {
30 public:
Device()31     Device() : mp_RenderSystem(0), m_State(DEVICE_STATE_OFF) {}
~Device()32     ~Device() {}
33 
Initialize(demo::RenderSystemDrawing * p_RenderSystem)34     virtual void Initialize(demo::RenderSystemDrawing* p_RenderSystem)
35     {
36         mp_RenderSystem = p_RenderSystem;
37         m_State = DEVICE_STATE_STANDBY;
38     }
39 
Finalize(void)40     virtual void Finalize(void)
41     {
42         m_State = DEVICE_STATE_OFF;
43     }
44 
Start(void)45     virtual void Start(void)
46     {
47         m_State = DEVICE_STATE_ON;
48     }
49 
End(void)50     virtual void End(void)
51     {
52         m_State = DEVICE_STATE_STANDBY;
53     }
54 
GetState(void)55     DEVICE_STATE GetState(void) const
56     {
57         return m_State;
58     }
59 
Draw(void)60     void Draw(void)
61     {
62         if(m_State == DEVICE_STATE_ON)
63         {
64             DrawFrame();
65         }
66     }
67 
68     virtual void DrawFrame(void) = 0;
69 
70 protected:
71     demo::RenderSystemDrawing* mp_RenderSystem;
72     DEVICE_STATE m_State;
73     NN_PADDING3;
74 };
75 
76 /* NN_SAMPLE_DEMOS_DEMO1_DEVICE_H_ */
77 #endif
78 
79 /*---------------------------------------------------------------------------*
80   End of file
81  *---------------------------------------------------------------------------*/
82