2023-12-01 22:39:38 +03:00
|
|
|
#ifndef __PLATFORM_SCREEN_H__
|
|
|
|
#define __PLATFORM_SCREEN_H__
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2024-03-06 23:56:20 +03:00
|
|
|
|
|
|
|
#ifdef __MINGW32__
|
2024-03-06 23:50:27 +03:00
|
|
|
#include <windows.h>
|
2024-03-06 23:56:20 +03:00
|
|
|
#else
|
|
|
|
#include <Windows.h>
|
|
|
|
#endif /* __MINGW32__ */
|
|
|
|
|
2023-12-01 22:39:38 +03:00
|
|
|
#else
|
|
|
|
#include <stdio.h>
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
static inline void resetCoordinates(void)
|
|
|
|
{
|
|
|
|
HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
SetConsoleCursorPosition(output, (COORD){0});
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static inline void resetCoordinates(void)
|
|
|
|
{
|
|
|
|
printf("\e[1;1H\e[2J");
|
|
|
|
}
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
|
|
|
#endif /* __PLATFORM_SCREEN_H__ */
|