56 lines
2.5 KiB
C
56 lines
2.5 KiB
C
/*********************************************************************************/
|
|
/* Module Name: ui.c */
|
|
/* Project: AurixOS */
|
|
/* */
|
|
/* Copyright (c) 2024-2025 Jozef Nagy */
|
|
/* */
|
|
/* This source is subject to the MIT License. */
|
|
/* See License.txt in the root of this repository. */
|
|
/* All other rights reserved. */
|
|
/* */
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
|
|
/* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
|
|
/* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
|
|
/* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
|
|
/* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
|
|
/* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
|
|
/* SOFTWARE. */
|
|
/*********************************************************************************/
|
|
|
|
#include <ui/framebuffer.h>
|
|
#include <ui/mouse.h>
|
|
#include <ui/font.h>
|
|
#include <ui/ui.h>
|
|
#include <config/config.h>
|
|
|
|
#include <print.h>
|
|
#include <stdint.h>
|
|
|
|
void ui_init()
|
|
{
|
|
struct ui_context ctx;
|
|
|
|
if (!get_framebuffer(&ctx.fb_addr, &ctx.fb_modes, &ctx.total_modes, &ctx.current_mode)) {
|
|
debug("Failed to acquire a framebuffer!\n");
|
|
while (1);
|
|
}
|
|
|
|
debug("Dumping framebuffer information\n");
|
|
debug("--------------------------------\n");
|
|
debug("Address: 0x%llx\n", ctx.fb_addr);
|
|
|
|
for (int i = 0; i < ctx.total_modes; i++) {
|
|
debug("\nMode %u:%s\n", i, (i == ctx.current_mode) ? " (current)" : "");
|
|
debug("Resolution: %ux%u\n", ctx.fb_modes[i].width, ctx.fb_modes[i].height);
|
|
debug("Bits Per Pixel: %u\n", ctx.fb_modes[i].bpp);
|
|
debug("Pitch: %u\n", ctx.fb_modes[i].pitch);
|
|
debug("Format: %s\n", ctx.fb_modes[i].format == FB_RGBA ? "RGBA" : "BGRA");
|
|
}
|
|
|
|
//font_init("\\AxBoot\\fonts\\DreamOrphans.ttf", 20);
|
|
|
|
//while (1) {
|
|
//get_mouse(&m_x, &m_y, &m_but);
|
|
//debug("Mouse X = %u | Mouse Y = %u\n", m_x, m_y);
|
|
//}
|
|
}
|