init
This commit is contained in:
15
TempleWare-CS2/source/debug/debug.cpp
Normal file
15
TempleWare-CS2/source/debug/debug.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "debug.h"
|
||||
#include <Windows.h>
|
||||
#include <iostream>
|
||||
|
||||
void initDebug() {
|
||||
if (AllocConsole()) {
|
||||
FILE* pFile;
|
||||
freopen_s(&pFile, "CONOUT$", "w", stdout);
|
||||
freopen_s(&pFile, "CONOUT$", "w", stderr);
|
||||
freopen_s(&pFile, "CONIN$", "r", stdin);
|
||||
printf("Console allocated.\n\n");
|
||||
} else {
|
||||
MessageBoxA(NULL, "Failed to allocate console", "Error", MB_OK | MB_ICONERROR);
|
||||
}
|
||||
}
|
||||
3
TempleWare-CS2/source/debug/debug.h
Normal file
3
TempleWare-CS2/source/debug/debug.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void initDebug();
|
||||
Reference in New Issue
Block a user