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

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

#include "architecture.hpp"
#include "subsystem.hpp"
#include "URL.hpp"
#include "strings.hpp"
#include "cast.hpp"
#include "console.hpp"
#include "time_stamp_count.hpp"
#include "GUI/gui_system.hpp"
#include <chrono>

Go to the source code of this file.

Functions

void tt::crt_configure_process () noexcept
 Configure the process for use with ttauri library.
 
int tt_main (int argc, char *argv[])
 Main entry-point.
 
int WINAPI WinMain (_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd)
 Windows entry-point.
 

Detailed Description

CRT - Main entry point of a ttauri program.

This header file will abstract the entry point for a program for different operating systems, and call the tt_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.

Function Documentation

◆ crt_configure_process()

void tt::crt_configure_process ( )
noexcept

Configure the process for use with ttauri library.

This function is used to put the process in a state that is compatible with the ttauri library.

Examples of configurations:

  • win32: GetSystemTimePreciseAsFileTime() should include leap-seconds.

◆ tt_main()

int tt_main ( int argc,
char * argv[] )

Main entry-point.

Parameters
argcNumber of arguments
argvA nullptr terminated list of pointers to null terminated strings.
Returns
Exit code.

◆ WinMain()

int WINAPI WinMain ( _In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
_In_ int nShowCmd )

Windows entry-point.

This function will call tt_main().

It will use GetCommandLineW() to retrieve the command line in Unicode.

The nShowCmd is used to insert add a command line argument at index 1:

  • 1,4,5,8,9,10: (No command line argument added)
  • 3: –window-state=maximize
  • 0,2,6,7,11: –window-state=minimize