Optimizations
This commit is contained in:
1 parent
916a41e064
commit
f2dca8749b
15 files changed
+126
-260
No files matched your search
@@ -15,7 +15,7 @@ public:
|
||||
|
||||
TApplicationInterface();
|
||||
|
||||
virtual ~TApplicationInterface() { }
|
||||
virtual ~TApplicationInterface();
|
||||
|
||||
virtual void OuterInit(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight);
|
||||
|
||||
|
||||
@@ -40,8 +40,6 @@ public:
|
||||
|
||||
TDataTriangleList Data;
|
||||
|
||||
bool NeedRefreshBuffer;//Dummy for Android, but you need this for PC
|
||||
|
||||
virtual void RefreshBuffer() { } //Dummy for Android, but you need this for PC
|
||||
|
||||
TTriangleListAncestor();
|
||||
@@ -78,12 +76,16 @@ public:
|
||||
|
||||
class TTriangleList : public TTriangleListAncestor //Implementation differs for Windows and Android
|
||||
{
|
||||
public:
|
||||
|
||||
mutable std::map<std::string, std::shared_ptr<VBOObject> > VertBufferArr;
|
||||
protected:
|
||||
virtual void InnerRefreshBuffer();
|
||||
|
||||
bool NeedPrepareBufferObjects;
|
||||
|
||||
bool NeedRefreshBuffer; //Dummy for Android, but you need this for PC
|
||||
public:
|
||||
|
||||
mutable std::map<std::string, std::shared_ptr<VBOObject>> VertBufferArr;
|
||||
|
||||
TTriangleList();
|
||||
|
||||
~TTriangleList();
|
||||
|
||||
@@ -17,28 +17,11 @@ class TApplication : public TApplicationAncestor
|
||||
{
|
||||
protected:
|
||||
public:
|
||||
int X, Y, Width, Height; //Window position and size
|
||||
|
||||
TApplication() : X(0), Y(0), Width(4), Height(4) { }
|
||||
|
||||
virtual void OuterInit(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight);
|
||||
|
||||
virtual void InnerInit() = 0;
|
||||
//To do on init
|
||||
|
||||
virtual void OuterDeinit();
|
||||
|
||||
virtual void InnerDeinit() = 0;
|
||||
//To do on deinit
|
||||
|
||||
virtual void InnerDraw() = 0;
|
||||
//What to draw
|
||||
|
||||
virtual void InnerUpdate(cardinal timer) = 0;
|
||||
//To do on update
|
||||
|
||||
};
|
||||
|
||||
void CreateEngine();
|
||||
void DestroyEngine();
|
||||
|
||||
} //namespace SE
|
||||
|
||||
#include "include/GUIManager/WidgetTemplatesImpl.h"
|
||||
|
||||
@@ -109,12 +109,6 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
TApplicationAncestor();
|
||||
|
||||
|
||||
virtual void OuterDeinit();
|
||||
//To do on deinit
|
||||
|
||||
virtual void OuterDraw();
|
||||
//What to draw
|
||||
|
||||
|
||||
@@ -17,47 +17,11 @@ class TApplication : public TApplicationAncestor
|
||||
{
|
||||
protected:
|
||||
public:
|
||||
int X, Y, Width, Height; //Window position and size
|
||||
|
||||
TApplication() : X(0), Y(0), Width(4), Height(4) { }
|
||||
|
||||
virtual void OuterInit(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight);
|
||||
|
||||
virtual void InnerInit() = 0;
|
||||
//To do on init
|
||||
|
||||
virtual void OuterDeinit();
|
||||
|
||||
virtual void InnerDeinit() = 0;
|
||||
//To do on deinit
|
||||
|
||||
//virtual void OuterDraw();
|
||||
|
||||
virtual void InnerDraw() = 0;
|
||||
//What to draw
|
||||
|
||||
//virtual void OuterUpdate(cardinal timer);
|
||||
|
||||
virtual void InnerUpdate(cardinal timer) = 0;
|
||||
//To do on update
|
||||
|
||||
virtual void UpdateQuick() { };
|
||||
//To process input - this method is called more frequently than Update()
|
||||
|
||||
virtual void OnMouseMove(TMouseState& mouseState) { }
|
||||
//To do on mouse move (with or without pressed buttons)
|
||||
|
||||
virtual void OnMouseDown(TMouseState& mouseState) { }
|
||||
//To do on mouse up (with or without pressed buttons)
|
||||
|
||||
virtual void OnMouseUp(TMouseState& mouseState) { }
|
||||
//To do on mouse down (with or without pressed buttons)
|
||||
//Be careful - even when user "upped" button, in mouseState this button appears as pressed
|
||||
|
||||
virtual void OnMouseWheel(short int delta) { }
|
||||
//To do on mouse wheel move
|
||||
};
|
||||
|
||||
void CreateEngine();
|
||||
void DestroyEngine();
|
||||
|
||||
} //namespace SE
|
||||
|
||||
|
||||
|
||||
@@ -25,40 +25,24 @@ extern HDC hDC; //Device context
|
||||
|
||||
class TApplication : public TApplicationAncestor
|
||||
{
|
||||
protected:
|
||||
std::string LogFilename; //Log file name
|
||||
public:
|
||||
int X, Y, Width, Height; //Window position and size
|
||||
|
||||
std::string WindowName; //Window name
|
||||
TApplication();
|
||||
|
||||
TApplication() : X(0), Y(0), Width(800), Height(600), WindowName("Salmon Engine"), LogFilename("log.txt") { }
|
||||
|
||||
const std::string& GetLogFilename() { return LogFilename; }
|
||||
|
||||
virtual void InnerInit() = 0;
|
||||
//To do on init
|
||||
|
||||
virtual void InnerDeinit() = 0;
|
||||
//To do on deinit
|
||||
|
||||
virtual void InnerDraw() = 0;
|
||||
//What to draw
|
||||
|
||||
virtual void InnerUpdate(cardinal timer) = 0;
|
||||
//To do on update
|
||||
~TApplication();
|
||||
|
||||
virtual void UpdateQuick() { };
|
||||
//To process input - this method is called more frequently than Update()
|
||||
|
||||
|
||||
virtual void OnMouseWheel(short int delta) { }
|
||||
//To do on mouse wheel move
|
||||
|
||||
virtual void OnKeyPress(cardinal key); //Try not to override this. But if you need to override, call ancestor!
|
||||
};
|
||||
|
||||
int MainLoop(TApplication& application);
|
||||
bool CreateEngine(int width, int height, int x = 0, int y = 0, std::string windowName = "Salmon Engine App", std::string logFileName = "log.txt");
|
||||
void MainLoop(TApplication* app);
|
||||
void DestroyEngine();
|
||||
|
||||
} //namespace SE
|
||||
|
||||
|
||||
Reference in new issue
Block a user