double-hit-balls/game/main_code.cpp

78 lines
1.3 KiB
C++
Raw Normal View History

2017-01-10 12:43:06 +00:00
#include "main_code.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include "include/Engine.h"
2017-11-14 17:04:04 +00:00
TMyApplication* Application;
2017-01-10 12:43:06 +00:00
2017-11-14 17:04:04 +00:00
void TMyApplication::InnerInit()
2017-01-10 12:43:06 +00:00
{
Application = this;
#ifdef TARGET_WIN32
#ifdef NDEBUG
ST::PathToResources = "resources/";
#else
ST::PathToResources = "../../../assets/";
#endif
#endif
#ifdef TARGET_IOS
ST::PathToResources = "assets/";
#endif
if (Console != NULL)
{
*Console<<"APP INIT\n";
}
2017-11-14 17:04:04 +00:00
srand (static_cast<size_t>(time(NULL)));
2017-01-10 12:43:06 +00:00
2017-12-19 10:54:34 +00:00
ResourceManager->ShaderManager.AddShader("DefaultShader", "texture-shader.vertex", "texture-shader.fragment");
2017-01-10 12:43:06 +00:00
Renderer->PushShader("DefaultShader");
2017-11-14 17:04:04 +00:00
2017-12-19 10:54:34 +00:00
ResourceManager->FrameManager.AddFrameRenderBuffer("FrameBuffer", Renderer->GetMatrixWidth(), Renderer->GetMatrixHeight());
2017-01-10 12:43:06 +00:00
Renderer->SetOrthoProjection();
}
2017-11-14 17:04:04 +00:00
void TMyApplication::InnerDeinit()
2017-01-10 12:43:06 +00:00
{
}
2017-11-14 17:04:04 +00:00
void TMyApplication::InnerOnTapDown(Vector2f p)
{
2017-01-10 12:43:06 +00:00
}
2017-11-14 17:04:04 +00:00
void TMyApplication::InnerOnTapUp(Vector2f p)
{
2017-01-10 12:43:06 +00:00
}
2017-02-26 23:07:37 +00:00
2017-11-14 17:04:04 +00:00
void TMyApplication::InnerOnTapUpAfterMove(Vector2f p)
2017-02-26 23:07:37 +00:00
{
}
2017-11-14 17:04:04 +00:00
void TMyApplication::InnerOnMove(Vector2f p, Vector2f shift)
2017-01-10 12:43:06 +00:00
{
}
2017-11-14 17:04:04 +00:00
void TMyApplication::InnerDraw()
2017-01-10 12:43:06 +00:00
{
glDisable(GL_DEPTH_TEST);
2017-12-19 10:54:34 +00:00
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
2017-01-10 12:43:06 +00:00
}
2017-11-14 17:04:04 +00:00
void TMyApplication::InnerUpdate(size_t dt)
2017-01-10 12:43:06 +00:00
{
2017-12-19 10:54:34 +00:00
}