HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
crt.hpp
Go to the documentation of this file.
1// Copyright Take Vos 2021-2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
21#pragma once
22
23#include "macros.hpp"
24
25hi_warning_push();
26hi_warning_ignore_clang("-Wunused-variable");
27hi_warning_ignore_clang("-Wreorder");
28hi_warning_ignore_clang("-Wunused-private-field");
29
30hi_warning_ignore_msvc(4127);
31hi_warning_ignore_msvc(6011);
32hi_warning_ignore_msvc(6386);
33hi_warning_ignore_msvc(6387);
34hi_warning_ignore_msvc(4701);
35hi_warning_ignore_msvc(4703);
36hi_warning_ignore_msvc(4189);
37
38#define VMA_IMPLEMENTATION
39#include <vma/vk_mem_alloc.h>
40
41hi_warning_pop();
42
43#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
44#include "win32_headers.hpp"
45
46// Windows entry-point.
47// This function will call `hi_main()`.
48//
49// It will use GetCommandLineW() to retrieve the command line in Unicode.
50//
51// The nShowCmd is used to insert add a command line argument at index 1:
52// - 1,4,5,8,9,10: (No command line argument added)
53// - 3: --window-state=maximize
54// - 0,2,6,7,11: --window-state=minimize
55//
56
63#define hi_main(ARGC, ARGV) \
64 hi_main_detail(ARGC, ARGV); \
65 int WINAPI WinMain( \
66 _In_ HINSTANCE hInstance, \
67 [[maybe_unused]] _In_opt_ HINSTANCE hPrevInstance, \
68 [[maybe_unused]] _In_ LPSTR lpCmdLine, \
69 _In_ int nShowCmd) \
70 { \
71 auto [argc, argv] = hi::crt_start(hInstance, nShowCmd); \
72 auto const r = hi_main_detail(argc, argv); \
73 return hi::crt_finish(argc, argv, r); \
74 } \
75 int hi_main_detail(ARGC, ARGV)
76
77#else
78#error "Need entry point for this architecture"
79#endif
Rules for working with win32 headers.