00001 // World.h: interface for the World class. 00002 // 00004 00005 #if !defined(AFX_WORLD_H__A1A33537_BF98_497E_B4CF_3A2839E9C233__INCLUDED_) 00006 #define AFX_WORLD_H__A1A33537_BF98_497E_B4CF_3A2839E9C233__INCLUDED_ 00007 00008 #include "GUI.h" 00009 00010 const real dtDefault=(real)0.02; 00011 00014 class World { 00015 public: 00016 World(); 00017 virtual ~World(); 00018 00019 virtual double getDt() const { return (double) dtDefault; } 00020 00021 virtual void advanceTime()=0; 00022 00023 virtual void draw(GUI *gui); 00024 00026 float mouseX, mouseY; 00028 bool isRightMouseButtonPressed; 00029 bool isLeftMouseButtonPressed; 00030 00031 virtual void setMouseCoordinates(float x, float y){ 00032 mouseX=x; 00033 mouseY=y; 00034 } 00035 00036 virtual void onMouseLeftDown(float x, float y){ 00037 setMouseCoordinates(x,y); 00038 isLeftMouseButtonPressed=true; 00039 } 00040 00041 virtual void onMouseRightDown(float x, float y){ 00042 setMouseCoordinates(x,y); 00043 isRightMouseButtonPressed=true; 00044 } 00045 00046 virtual void onMouseLeftUp(float x, float y){ 00047 setMouseCoordinates(x,y); 00048 isLeftMouseButtonPressed=false; 00049 } 00050 00051 virtual void onMouseRightUp(float x, float y){ 00052 setMouseCoordinates(x,y); 00053 isLeftMouseButtonPressed=false; 00054 } 00055 00056 unsigned long int timeStep; 00057 00058 }; 00059 00060 #endif // !defined(AFX_WORLD_H__A1A33537_BF98_497E_B4CF_3A2839E9C233__INCLUDED_)
Thyrix homepage Users' guide
(C) Arxia 2004-2005