This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
aidinabedi
committed
Dec 24, 2010
1 parent
2605c0e
commit 37c43ef
Showing
9 changed files
with
815 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2009 Aidin Abedi. All Rights Reserved. // | ||
//******************************************************// | ||
|
||
#pragma once | ||
|
||
#include "ShinyOgre.h" | ||
|
||
namespace ShinyOgre { | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
|
||
class HistoryGraph { | ||
private: | ||
|
||
Ogre::ManualObject* mObject; | ||
/* | ||
Ogre::Overlay* mOverlay; | ||
Ogre::SceneNode* mNode; | ||
*/ | ||
|
||
std::vector<Real> mPoints; | ||
|
||
float mScale; | ||
|
||
void initialize(void); | ||
void refresh(void); | ||
|
||
public: | ||
|
||
HistoryGraph(void); | ||
~HistoryGraph() { destroy(); } | ||
|
||
void resize(uint count); | ||
void reset(void); | ||
|
||
void addPoint(Ogre::Real value); | ||
void setScale(Ogre::Real scale) { mScale = scale * 2; } | ||
|
||
void create(const String& material = "BaseWhiteNoLighting"); | ||
void destroy(void); | ||
|
||
void show(void); | ||
void hide(void); | ||
}; | ||
|
||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// Copyright (c) 2009 Aidin Abedi. All Rights Reserved. // | ||
//******************************************************// | ||
|
||
#pragma once | ||
|
||
#include "Common.h" | ||
#include "Singleton.h" | ||
#include "System.h" | ||
#include "ProfilerAddon.h" | ||
#include "Action.h" | ||
|
||
|
||
namespace R3 { // tolua_export | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
|
||
class Profiler : // tolua_export | ||
public Singleton<Profiler>, | ||
public System /* if you think public is a mistake, think again */ // tolua_export | ||
, | ||
private Action | ||
{ // tolua_export | ||
private: | ||
|
||
uint m_nFramesElapsed; | ||
uint m_nFramesMax; | ||
float m_fDamping; | ||
|
||
int m_mode; | ||
bool m_firstUpdate; | ||
|
||
typedef vector<ProfilerAddon*> AddonVector; | ||
|
||
AddonVector mAddons; | ||
|
||
static const char* skipNamespace(const char* name); | ||
void removeNamespaces(void); | ||
|
||
virtual bool actionPressed(int clicks); | ||
virtual String actionName(void) { return "CycleProfiler"; } | ||
virtual bool actionUnload(void) { return true; } | ||
|
||
virtual void systemLoad(void); | ||
virtual bool systemUnload(void); | ||
virtual void systemUpdate(void); | ||
|
||
virtual String systemName(void) { return "Profiler"; } | ||
|
||
virtual int systemPriority(void) { return SP_PROFILER; } | ||
|
||
public: // tolua_export | ||
|
||
// tolua_begin | ||
Profiler(void); | ||
~Profiler(void) { destroyAllAddons(); } | ||
// tolua_end | ||
|
||
// tolua_begin | ||
void setMode(PROFILERMODE mode); | ||
PROFILERMODE getMode(void) { return static_cast<PROFILERMODE>(m_mode); } | ||
|
||
void setFrames(uint a_nFrames); | ||
uint getFrames(void) { return m_nFramesMax; } | ||
|
||
void setDamping(float a_fDamping) { m_fDamping = a_fDamping; } | ||
float getDamping(void) { return m_fDamping; } | ||
|
||
static Profiler& getSingleton(void) { return Singleton<Profiler>::getSingleton(); } | ||
static Profiler* getSingletonPtr(void) { return Singleton<Profiler>::getSingletonPtr(); } | ||
|
||
void addon(ProfilerAddon* p); | ||
void removeAddon(ProfilerAddon* p); | ||
|
||
void updateAllAddons(void); | ||
void destroyAllAddons(void); | ||
|
||
void clear(void) { PROFILE_DESTROY(); } | ||
// tolua_end | ||
}; // tolua_export | ||
|
||
} // namespace // tolua_export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) 2009 Aidin Abedi. All Rights Reserved. // | ||
//******************************************************// | ||
|
||
#pragma once | ||
|
||
#include "HistoryGraph.h" | ||
#include "ProfilerAddon.h" | ||
|
||
|
||
namespace R3 { // tolua_export | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
|
||
PROFILE_SHARED_EXTERN(DisplaySystem); | ||
PROFILE_SHARED_EXTERN(ScriptSystem); | ||
PROFILE_SHARED_EXTERN(PhysicsSystem); | ||
PROFILE_SHARED_EXTERN(Debug); | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
|
||
class ProfilerGraph : // tolua_export | ||
public ProfilerAddon // tolua_export | ||
{ // tolua_export | ||
private: | ||
|
||
enum GRAPH { | ||
GRAPH_DISPLAY, | ||
GRAPH_SCRIPT, | ||
GRAPH_PHYSICS, | ||
GRAPH_DEBUG, | ||
|
||
GRAPH_MAX, | ||
GRAPH_ZORDER = 100 | ||
}; | ||
|
||
PROFILERMODE m_mode; | ||
|
||
HistoryGraph m_Graphs[GRAPH_MAX]; | ||
|
||
void show(void); | ||
void hide(void); | ||
|
||
virtual void profilerLoad(); | ||
virtual void profilerMode(PROFILERMODE mode); | ||
|
||
virtual void profilerUpdate(void); | ||
|
||
public: // tolua_begin | ||
|
||
ProfilerGraph(void); | ||
~ProfilerGraph() {} | ||
}; | ||
// tolua_end | ||
|
||
} // namespace // tolua_export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) 2009 Aidin Abedi. All Rights Reserved. // | ||
//******************************************************// | ||
|
||
#pragma once | ||
|
||
#include "Common.h" | ||
#include "ProfilerAddon.h" | ||
|
||
|
||
namespace R3 { // tolua_export | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
|
||
class ProfilerOutput : // tolua_export | ||
public ProfilerAddon // tolua_export | ||
{ // tolua_export | ||
private: | ||
|
||
PROFILERMODE m_mode; | ||
|
||
Ogre::Overlay* m_Overlay; | ||
Ogre::OverlayElement* m_Output; | ||
Ogre::OverlayElement* m_Variables; | ||
|
||
string getVariablesAsString(void); | ||
|
||
public: // tolua_begin | ||
|
||
ProfilerOutput(void); | ||
~ProfilerOutput() {} | ||
|
||
void profilerMode(PROFILERMODE mode); | ||
|
||
void profilerUpdate(void); | ||
}; | ||
// tolua_end | ||
|
||
} // namespace // tolua_export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.