Project Skeleton 1/2
This commit is contained in:
74
Engine/Src/Imp/CPP/Engine.cpp
Normal file
74
Engine/Src/Imp/CPP/Engine.cpp
Normal file
@ -0,0 +1,74 @@
|
||||
// IAEngine: 2D Game Engine by IA
|
||||
// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include <Engine.hpp>
|
||||
#include <IAEngine/Engine.hpp>
|
||||
|
||||
GameFunctionTable g_gameFunctions{};
|
||||
|
||||
//SDL_SetAppMetadata("SDL Hello World Example", "1.0", "com.example.sdl-hello-world");
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#include <IAEngine/EngineInterface.hpp>
|
||||
|
||||
BOOL ValidateGameFunctionTable(IN GameFunctionTable gameFunctionTable)
|
||||
{
|
||||
if(!gameFunctionTable.OnInitialize) return false;
|
||||
if(!gameFunctionTable.OnTerminate) return false;
|
||||
if(!gameFunctionTable.OnDebugDraw) return false;
|
||||
if(!gameFunctionTable.OnFixedUpdate) return false;
|
||||
if(!gameFunctionTable.OnUpdate) return false;
|
||||
if(!gameFunctionTable.OnResize) return false;
|
||||
if(!gameFunctionTable.GetName) return false;
|
||||
if(!gameFunctionTable.GetVersion) return false;
|
||||
if(!gameFunctionTable.GetPackageName) return false;
|
||||
if(!gameFunctionTable.GetDeveloperName) return false;
|
||||
if(!gameFunctionTable.GetPublisherName) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
C_DECL(IAE_DLL_API ia::BOOL IAEngine_OnInitialize(IN GameFunctionTable gameFunctionTable))
|
||||
{
|
||||
if(!ValidateGameFunctionTable(gameFunctionTable))
|
||||
{
|
||||
IAE_LOG_ERROR("Invalid game function table was passed to the engine. Exiting..");
|
||||
return false;
|
||||
}
|
||||
|
||||
g_gameFunctions = gameFunctionTable;
|
||||
|
||||
IAE_LOG_INFO("Booting IAEngine for ", gameFunctionTable.GetName());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
C_DECL(IAE_DLL_API ia::VOID IAEngine_OnTerminate())
|
||||
{
|
||||
IAE_LOG_INFO("Shutting down IAEngine");
|
||||
}
|
||||
|
||||
C_DECL(IAE_DLL_API ia::BOOL IAEngine_OnIterate())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
C_DECL(IAE_DLL_API ia::VOID IAEngine_OnEvent(IN PVOID event))
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user