/// Initializes a Kinc application and creates an initial window for systems which support windows (systems which do not support windows are treated as if the
/// would provide a single window which cannot change). This has to be called before any other Kinc-function with the exception of the Display-API which can
/// optionally be initialized beforehand using kinc_display_init.
/// </summary>
/// <returns>The id of the initial window</returns>
/// Returns the current width of the initial application-window which is equivalent to calling kinc_window_width(0).
/// </summary>
/// <returns>The width of the initial window</returns>
KINC_FUNCintkinc_width(void);
/// <summary>
/// Returns the current height of the initial application-window which is equivalent to calling kinc_window_height(0).
/// </summary>
/// <returns>The height of the initial window</returns>
KINC_FUNCintkinc_height(void);
/// <summary>
/// Instruct the system to load up the provided URL which will usually open it in the system's default browser.
/// </summary>
/// <param name="url">The URL to open</param>
KINC_FUNCvoidkinc_load_url(constchar*url);
/// <summary>
/// Returns an ID representing the current type of target-system.
/// </summary>
/// <returns>The ID representing the target system</returns>
KINC_FUNCconstchar*kinc_system_id(void);
/// <summary>
/// Returns the current system-language.
/// </summary>
/// <returns>The current system-language as a two-letter language code</returns>
KINC_FUNCconstchar*kinc_language(void);
/// <summary>
/// Vibrates the whole system if supported. This is primarily supported on mobile phones but don't blame us if your computer falls over.
/// </summary>
KINC_FUNCvoidkinc_vibrate(intmilliseconds);
/// <summary>
/// Returns the portion of the screen which can be safely used for important content. This is mostly relevant for TVs which often scale the image by default and
/// thefore cut off some of the content.
/// </summary>
/// <returns>The safe-zone which can be multiplied with the width or height of the display to convert it to pixels</returns>
KINC_FUNCfloatkinc_safe_zone(void);
/// <summary>
/// Returns whether the system itself handles configuration of the safe-zone.
/// </summary>
/// <returns>Whether the safe-zone is handlet by the syste</returns>
KINC_FUNCboolkinc_automatic_safe_zone(void);
/// <summary>
/// Sets the safe-zone for systems which return false for kinc_automatic_safe_zone.
/// </summary>
/// <param name="value">The safe-zone for width and height as a ratio of the full display-resolution.</param>
KINC_FUNCvoidkinc_set_safe_zone(floatvalue);
typedefuint64_tkinc_ticks_t;
/// <summary>
/// Returns the frequency of system-timestamps.
/// </summary>
/// <returns>The frequency of the system's timestamps in 1 / second</returns>
KINC_FUNCdoublekinc_frequency(void);
/// <summary>
/// Returns a timestamp for right now in a system-specific unit.
/// </summary>
/// <returns>The current timestamp</returns>
KINC_FUNCkinc_ticks_tkinc_timestamp(void);
/// <summary>
/// Returns the number of proper CPU-cores (not the number of hardware-threads)
/// </summary>
/// <returns>Number of cores</returns>
KINC_FUNCintkinc_cpu_cores(void);
/// <summary>
/// Returns the number of hardware-threads
/// </summary>
/// <returns>Number of hardware-threads</returns>
KINC_FUNCintkinc_hardware_threads(void);
/// <summary>
/// Returns the current time. This can also be calculated ala kinc_timestamp() / kinc_frequency() but kinc_time is a little more precise on some systems.
/// </summary>
/// <returns>The current time in seconds</returns>
KINC_FUNCdoublekinc_time(void);
/// <summary>
/// Starts Kinc's main-loop. kinc_set_update_callback should be called before kinc_start so the main-loop actually has something to do.
/// </summary>
KINC_FUNCvoidkinc_start(void);
/// <summary>
/// Stops Kinc's main loop and thereby returns to the function which called kinc_start.
/// </summary>
KINC_FUNCvoidkinc_stop(void);
/// <summary>
/// Instructs the system to login a user if that is supported.
/// </summary>
KINC_FUNCvoidkinc_login(void);
/// <summary>
/// Returns true if kinc_login was called and the login-process is still ongoing.
/// </summary>
/// <returns>Whether a login-process is still in progress</returns>
KINC_FUNCboolkinc_waiting_for_login(void);
/// <summary>
/// Unlocks an achievement or trophy or however you prefer to call it.
/// </summary>
/// <param name="id">The id of the achievement/tropy</param>
KINC_FUNCvoidkinc_unlock_achievement(intid);
/// <summary>
/// Disallows the system to logout the current user.
/// </summary>
KINC_FUNCvoidkinc_disallow_user_change(void);
/// <summary>
/// Allows the system to logout the current user.
/// </summary>
KINC_FUNCvoidkinc_allow_user_change(void);
/// <summary>
/// Instructs the system whether it is allowed to turn off the screen while the application is running.
/// </summary>
/// <param name="on">Whether turning off the screen is allowed</param>
KINC_FUNCvoidkinc_set_keep_screen_on(boolon);
/// <summary>
/// Tries to halt program-execution in an attached debugger when compiled in debug-mode (aka when NDEBUG is not defined).
/// </summary>
KINC_INLINEvoidkinc_debug_break(void){
#ifndef NDEBUG
#if defined(_MSC_VER)
__debugbreak();
#elif defined(__clang__)
__builtin_debugtrap();
#else
#if defined(__aarch64__)
__asm__volatile(".inst 0xd4200000");
#elif defined(__x86_64__)
__asm__volatile("int $0x03");
#else
kinc_log(KINC_LOG_LEVEL_WARNING,"Oh no, kinc_debug_break is not implemented for the current compiler and CPU.");
#endif
#endif
#endif
}
/// <summary>
/// Returns whether a debugger is currently attached to the running program. This is not yet working though.
/// </summary>
/// <returns>Whether a debugger is currently attached</returns>
KINC_FUNCboolkinc_debugger_attached(void);
/// <summary>
/// Copies the provided string to the system's clipboard.
/// </summary>
/// <param name="text">The text to be copied into the clipboard</param>