src/ascension/ui.h

Sun, 25 Jan 2026 13:18:04 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 25 Jan 2026 13:18:04 +0100
changeset 292
25931abee09f
parent 231
0da563c4e39c
permissions
-rw-r--r--

fix compilation errors introduced by recent UCX update

/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 * Copyright 2024 Mike Becker. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   1. Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *
 *   2. Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef ASCENSION_UI_H
#define ASCENSION_UI_H

#ifndef ASCENSION_UI_IMPLEMENTATION
#include "text.h"
#endif

/**
 * Sets the UI scaling factor for the active window.
 *
 * @param scale the scaling factor
 */
void asc_ui_scale(float scale);

/**
 * Returns the current UI scaling factor for the active window.
 *
 * @return the scaling factor
 */
float asc_ui_get_scale(void);

/**
 * Automatically chooses a UI scaling factor depending on display resolution.
 *
 * @note you need to call this function again when the window changes the display
 * // TODO: check if there is an SDL event when the window changes the display and implement a reaction
 * @return the scaling factor that was applied
 */
float asc_ui_scale_auto(void);

/**
 * Adds a node to the active window's UI.
 *
 * @param node the node to add
 */
void asc_ui_add_node(AscSceneNode *node);

#endif /* ASCENSION_UI_H */

mercurial