-
Notifications
You must be signed in to change notification settings - Fork 87
Getting started
To start using borealis, you first have to include the library in your project. The README
contains the steps needed to achieve that.
Once that step is done, using the library is very simple:
- import
<borealis.hpp>
- init the application with the
brls::Application::init()
method - create your view tree
- push the root view to the view stack
- run your app using
brls::Application::mainLoop()
in awhile
loop - exit!
This repository contains an example app that can be used as a base. It is recommended to use one class per component to avoid having everything in the main
function... which is not what the example does.
You can also have a look at the sys-clk manager, another homebrew powered by borealis.
Please note that borealis runs on a single thread at the moment, and is therefore not thread safe. Please do not try to run UI code on a separate thread. If you do so, consider writing a proper background task class and making a pull request (see Tasks page for more info).
You can mix your own resources and those of borealis by putting the borealis resources in a subfolder and have the BOREALIS_RESOURCES
define point to that subfolder (for instance romfs:/library/borealis
).
borealis redefines the userAppInit
and userAppExit
functions to initialize the needed services. All initialized services can be seen in the switch_wrapper.c
file.
For now, the library does not offer any way for users to redefine those functions. You should place your services initialization and exit in your main function, before initializing borealis and after the main loop (as usual).