Which is basically just the main entry function for a win32 application and a return 0 at the end.
He's still giving me a memory leak output at the exact line of the "_CrtDumpMemoryLeaks();" call.
How is this even possible ? Is it a bug ? Or is windows somehow leaking memory ?
It also doesn't let me break at those allocs.
/*
****************************************************
Main.cpp - Source File
Usage: Implements Main-Entry function
****************************************************
*/
// Header for memory leak search
#ifdef MEM_DEBUG
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#endif
#define _USE_MATH_DEFINES
// Includes
#include "../Framework/Engine/Core/Engine.h"
#include <cmath>
//***********************************************************
//* WinMain (int)
//* Usage: Win32 Entry-function
//* Parameters:
//* - Handle to applications instance (HINSTANCE)
//* - PreviousInstance <unused> (HINSTANCE)
//* - CommandLine string (LPSTR)
//* - CommandLine parameter (int)
//**********************************************************
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
// Search for memory leaks
#ifdef MEM_DEBUG
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF |_CRTDBG_LEAK_CHECK_DF );
_CrtDumpMemoryLeaks();
//_CrtSetBreakAlloc(147);
#endif
//// Define information of our engine
//EngineDescription engineDesc;
//// Window
//engineDesc.windowDesc.Windowed = true;
//engineDesc.windowDesc.hasBorder = false;
//engineDesc.windowDesc.windowTitle = L"DirectX11 based Engine";
//engineDesc.windowDesc.windowWidth = 1280;
//engineDesc.windowDesc.windowHeight = 720;
//// Graphics
//engineDesc.graphicsDesc.VSync = false;
//engineDesc.graphicsDesc.viewport.TopLeftX = 0.0f;
//engineDesc.graphicsDesc.viewport.TopLeftY = 0.0f;
//engineDesc.graphicsDesc.viewport.MinDepth = 0.0f;
//engineDesc.graphicsDesc.viewport.MaxDepth = 0.999f;
//engineDesc.graphicsDesc.viewport.Width = (float)engineDesc.windowDesc.windowWidth;
//engineDesc.graphicsDesc.viewport.Height = (float)engineDesc.windowDesc.windowHeight;
//engineDesc.graphicsDesc.rasterizer_state.fillMode = FM_Solid;
//engineDesc.graphicsDesc.rasterizer_state.cullMode = Cull_Back;
//
//// Global Illumination
//engineDesc.graphicsDesc.GlobalIllumination.SSAO.useSSAO = false;
//// Post Processing
//engineDesc.graphicsDesc.postFXDesc.DepthOfField = false;
//engineDesc.graphicsDesc.postFXDesc.ColorCorrection = false;
//engineDesc.graphicsDesc.postFXDesc.VolumetricScattering = false;
//engineDesc.graphicsDesc.postFXDesc.PostAA = false;
//
//
//// Camera
//engineDesc.cameraDesc.type = Free;
//engineDesc.cameraDesc.MoveSpeed = 0.5f;
//engineDesc.cameraDesc.RotationSpeed = 2.0f;
//engineDesc.cameraDesc.cameraPosition = XMFLOAT3(0.0f, -0.25f, -1.0f);
//engineDesc.cameraDesc.cameraUp = XMFLOAT3(0.0f, 1.0f, 0.0f);
//engineDesc.cameraDesc.cameraTarget = XMFLOAT3(0.0f, 0.0f, 1.0f);
//engineDesc.cameraDesc.nearClip = 0.05f;
//engineDesc.cameraDesc.farClip = 500.0f;
//engineDesc.cameraDesc.FoV = 55.0f;
//engineDesc.cameraDesc.Aspect = (float)(engineDesc.windowDesc.windowWidth / (float)engineDesc.windowDesc.windowHeight);
//
// Initialize our engine
//Engine* engine = new Engine(engineDesc);
// Start our engine
//engine->Run(new Scene(engine));
//// Release allocated memory
//if(engine)
//{
// delete engine;
// engine = NULL;
//}
return 0;
}
And the following output:
Detected memory leaks!
Dumping objects ->
{147} normal block at 0x009F5710, 80 bytes long.
Data: < W W W > 10 57 9F 00 10 57 9F 00 10 57 9F 00 CD CD CD CD
{146} normal block at 0x009F1AD0, 8 bytes long.
Data: < > D4 88 CC 01 00 00 00 00
Object dump complete.