Files
dae16-VerhulstBram-GameProject/Game/main.cpp
Bram Verhulst 5477b8a7f2 Fix digging
2024-04-20 20:20:54 +02:00

43 lines
924 B
C++

#include "pch.h"
#include <ctime>
#include "Game.h"
#define DEBUG
void StartHeapControl();
void DumpMemoryLeaks();
Vector2f Viewport { 900.f, 500.f };
int SDL_main(int argv, char** args) {
srand(static_cast<unsigned int>(time(nullptr)));
StartHeapControl();
auto pGame { new Game { Window { "Motherload - Verhulst, Bram - 1DAEGD16E", Viewport.x, Viewport.y } } };
pGame->Run();
delete pGame;
DumpMemoryLeaks();
return 0;
}
void StartHeapControl() {
#if defined(DEBUG) | defined(_DEBUG)
// Notify user if heap is corrupt
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
// Report detected leaks when the program exits
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
// Set a breakpoint on the specified object allocation order number
//_CrtSetBreakAlloc( 156 );
#endif
}
void DumpMemoryLeaks() {
#if defined(DEBUG) | defined(_DEBUG)
_CrtDumpMemoryLeaks();
#endif
}