Skip to content

Getting started

Nathan S edited this page Jun 22, 2020 · 7 revisions

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:

  1. import <borealis.hpp>
  2. init the application with the brls::Application::init() method
  3. create your view tree
  4. push the root view to the view stack
  5. run your app using brls::Application::mainLoop() in a while loop
  6. 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).

Resources (romfs)

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).

Services initialization

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).

Clone this wiki locally