mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
Added util/platform module
This commit is contained in:
parent
ab7e832218
commit
665347213d
2 changed files with 22 additions and 0 deletions
14
src/util/platform.cpp
Normal file
14
src/util/platform.cpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "platform.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
|
||||
void platform::configure_encoding() {
|
||||
// set utf-8 encoding to console output
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
setvbuf(stdout, nullptr, _IOFBF, 1000);
|
||||
}
|
||||
#else
|
||||
void platform::configure_encoding(){
|
||||
}
|
||||
#endif
|
||||
8
src/util/platform.h
Normal file
8
src/util/platform.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef UTIL_PLATFORM_H_
|
||||
#define UTIL_PLATFORM_H_
|
||||
|
||||
namespace platform {
|
||||
extern void configure_encoding();
|
||||
}
|
||||
|
||||
#endif // UTIL_PLATFORM_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue