mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 20:41:47 +01:00
Update README.md
Add GameProject to Solution
This commit is contained in:
40
Game/main.cpp
Normal file
40
Game/main.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "pch.h"
|
||||
#include <ctime>
|
||||
#include "Game.h"
|
||||
|
||||
|
||||
void StartHeapControl();
|
||||
void DumpMemoryLeaks();
|
||||
|
||||
int SDL_main(int argv, char** args) {
|
||||
srand(static_cast<unsigned int>(time(nullptr)));
|
||||
|
||||
StartHeapControl();
|
||||
|
||||
Game* pGame { new Game { Window { "Project name - Name, first name - 1DAEXX", 846.f, 500.f } } };
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user