2013-01-19 20:02:34 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/*
|
|
|
|
This code combines all headers for Salmon engine into one header file
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "include/SalmonEngineInterface.h"
|
|
|
|
|
|
|
|
namespace SE
|
|
|
|
{
|
|
|
|
|
|
|
|
//==============================================================
|
|
|
|
//========= GLOBAL VARIABLES - REMEMBER THIS LIST!!! ===========
|
|
|
|
//==============================================================
|
|
|
|
|
|
|
|
extern TFileConsole* Console;
|
|
|
|
extern TSalmonRenderer* Renderer;
|
|
|
|
extern TResourceManager* ResourceManager;
|
|
|
|
|
|
|
|
|
|
|
|
extern HGLRC hRC; //Render context
|
|
|
|
extern HWND Hwnd; //Main window handle
|
|
|
|
extern HDC hDC; //Device context
|
|
|
|
|
|
|
|
|
|
|
|
class TApplication : public TApplicationAncestor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-02-05 20:17:58 +00:00
|
|
|
TApplication();
|
2013-01-19 20:02:34 +00:00
|
|
|
|
2013-02-05 20:17:58 +00:00
|
|
|
~TApplication();
|
2013-01-19 20:02:34 +00:00
|
|
|
|
|
|
|
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!
|
2013-11-11 22:12:29 +00:00
|
|
|
|
|
|
|
virtual void InnerOnKeyPress(cardinal key) { }
|
2013-01-19 20:02:34 +00:00
|
|
|
};
|
|
|
|
|
2013-02-05 20:17:58 +00:00
|
|
|
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();
|
2013-01-19 20:02:34 +00:00
|
|
|
|
2013-02-06 20:45:00 +00:00
|
|
|
|
|
|
|
//APPTYPE must be inherited from TApplication
|
|
|
|
template<typename APPTYPE>
|
|
|
|
void OuterMainLoop(int width, int height)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (CreateEngine(width, height))
|
|
|
|
{
|
|
|
|
TApplication* app = new APPTYPE;
|
|
|
|
|
|
|
|
app->OuterInit(width, height, static_cast<float>(width), static_cast<float>(height));
|
|
|
|
|
|
|
|
MainLoop(app);
|
|
|
|
|
|
|
|
app->OuterDeinit();
|
|
|
|
|
|
|
|
DestroyEngine();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-01-27 21:31:32 +00:00
|
|
|
} //namespace SE
|
|
|
|
|
|
|
|
//This file includes templates that call any of three singletones: Console, ResourceManager or Renderer
|
|
|
|
|
|
|
|
#include "include/GUIManager/WidgetTemplatesImpl.h"
|
2013-02-03 13:11:16 +00:00
|
|
|
#include "include/Utils/ThreadUtilsImpl.h"
|
|
|
|
|
2013-01-27 21:31:32 +00:00
|
|
|
|