ho3/Template/main.h

86 lines
1.9 KiB
C
Raw Normal View History

2024-06-06 13:25:38 +00:00
#pragma once
/* Path to the engine */
#include "SalmonEngineWindows.h"
#include "gameMap.h"
using namespace SE;
//Application class
class TMyApplication : public SE::TApplication
{
/*
TLiteModel* lm;
TSimpleLandClass* TestLand;
glmat3 LiteModelRotateMatrix;
glmat3 LiteModelDeltaRotateMatrix;
cardinal LiteModelUpdateTimer;
*/
TGameMap GameMap;
bool MouseRightButtonPressed;
//Rotate camera on mouse right button pressed
bool MouseLeftButtonPressed;
int MouseX0, MouseY0;
//Mouse pos caught on right button click
2024-06-08 17:55:56 +00:00
int view = 0;
2024-06-06 13:25:38 +00:00
float WaterTimer;
void DrawSceneWithoutWater();
void DrawToCubemap();
void DrawToShadowMap();
void DrawWaterSurface();
2024-06-08 17:55:56 +00:00
void DrawCubemap();
2024-06-08 22:09:17 +00:00
void DrawCubemapDay();
2024-06-08 17:55:56 +00:00
2024-06-09 07:38:02 +00:00
void DrawFrameFullScreen();
2024-06-08 17:55:56 +00:00
cardinal cubemapTexture;
2024-06-08 22:09:17 +00:00
cardinal cubemapTextureDay;
cardinal cubemapTextureNight;
2024-06-08 17:55:56 +00:00
VertexDataStruct cubemapVertexDataStruct;
2024-06-08 20:24:26 +00:00
VertexDataStruct waterVertexDataStruct;
2024-06-09 07:38:02 +00:00
VertexDataStruct frameVertexDataStruct;
2024-06-06 13:25:38 +00:00
public:
//Constructor
2024-06-08 22:09:17 +00:00
TMyApplication() : MouseRightButtonPressed(false), MouseLeftButtonPressed(false), WaterTimer(0) {
Width = 1920;
Height = 1080;
}
2024-06-06 13:25:38 +00:00
virtual void InnerInit();
//What to do on init
virtual void InnerDeinit();
//What to do on deinit
virtual void InnerDraw();
//What to do on draw
virtual void InnerUpdate(cardinal timer);
//What to do on update. timer means how many ms passed since last 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 move (with or without pressed buttons)
virtual void OnMouseUp(TMouseState& mouseState);
//To do on mouse move (with or without pressed buttons)
virtual void OnMouseWheel(short int delta);
//To do on mouse wheel move
};