Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Actor.h

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 #ifndef OPENCAL_ACTOR_H 00012 #define OPENCAL_ACTOR_H 00013 00014 // Includes 00015 #include <OpenCAL/global.h> 00016 00017 namespace OpenCAL 00018 { 00019 // Forward declarations 00020 class System; 00021 00025 class OPENCAL_API Actor 00026 { 00027 protected: 00028 // Member variables 00029 System *m_parent; 00030 bool m_initialized, m_draw; 00031 bool m_enabled; 00032 00033 public: 00034 // Destructor 00035 virtual ~Actor(); 00036 00037 // Get functions 00038 const System *getParent() const { return m_parent; } 00039 00040 // Enable functions 00041 bool isEnabled() const { return m_enabled; } 00042 void enable() { m_enabled = true; } 00043 void disable() { m_enabled = false; } 00044 void toggle() { m_enabled = !m_enabled; } 00045 void setEnabled(bool enabled) { m_enabled = enabled; } 00046 00047 // Draw functions 00048 bool getDraw() const { return m_draw; } 00049 void setDraw(bool enabled = true) { m_draw = enabled; } 00050 void enableDraw() { m_draw = true; } 00051 void disableDraw() { m_draw = false; } 00052 void toggleDraw() { m_draw = !m_draw; } 00053 00054 // General functions 00055 virtual bool isInitialized() const { return m_initialized; } 00056 virtual void initialize(); 00057 00058 // Execute functions 00059 virtual void execute(float seconds); 00060 00061 // Render functions 00062 virtual void render() {} 00063 00064 /* 00065 #ifdef USE_OPENGL 00066 virtual void drawGL() {} 00067 #endif // USE_OPENGL 00068 */ 00069 00070 protected: 00071 // Constructors 00072 // protected, so no instance of this base class can be made 00073 Actor(System *parent); 00074 }; 00075 }; 00076 00077 #endif // OPENCAL_ACTOR_H

Generated on Sun Aug 15 19:19:21 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8