HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Macros | Functions
crt.hpp File Reference

CRT - Main entry point of a hikogui program. More...

#include "macros.hpp"
#include <vma/vk_mem_alloc.h>
#include "win32_headers.hpp"

Go to the source code of this file.

Macros

#define VMA_IMPLEMENTATION
 
#define hi_main(ARGC, ARGV)
 Main entry-point.
 

Functions

 hi_warning_push ()
 
 hi_warning_ignore_clang ("-Wunused-variable")
 
 hi_warning_ignore_clang ("-Wreorder")
 
 hi_warning_ignore_clang ("-Wunused-private-field")
 
 hi_warning_ignore_msvc (4127)
 
 hi_warning_ignore_msvc (6011)
 
 hi_warning_ignore_msvc (6386)
 
 hi_warning_ignore_msvc (6387)
 
 hi_warning_ignore_msvc (4701)
 
 hi_warning_ignore_msvc (4703)
 
 hi_warning_ignore_msvc (4189)
 
 hi_warning_pop ()
 

Detailed Description

CRT - Main entry point of a hikogui program.

This header file will abstract the entry point for a program for different operating systems, and call the hi_main() function that should be defined as a portable entry point of the program.

This header should be included only once by a only a single translation-unit, as it defines main() or WinMain().

The work done by this abstraction is purposefully very limited, its task it to make sure the command-line arguments are split into tokens according to the rules of the operating system's shell. And that the command line arguments are encoded as UTF-8.

Macro Definition Documentation

◆ hi_main

#define hi_main ( ARGC,
ARGV )
Value:
hi_main_detail(ARGC, ARGV); \
int WINAPI WinMain( \
_In_ HINSTANCE hInstance, \
[[maybe_unused]] _In_opt_ HINSTANCE hPrevInstance, \
[[maybe_unused]] _In_ LPSTR lpCmdLine, \
_In_ int nShowCmd) \
{ \
auto [argc, argv] = hi::crt_start(hInstance, nShowCmd); \
auto const r = hi_main_detail(argc, argv); \
return hi::crt_finish(argc, argv, r); \
} \
int hi_main_detail(ARGC, ARGV)

Main entry-point.

Parameters
ARGCargc type and name
ARGVargv type and name
Returns
Exit code.