Add font and img
This commit is contained in:
parent
a0c045f792
commit
7e71531f8f
50
DEVELOPMENT.md
Normal file
50
DEVELOPMENT.md
Normal file
@ -0,0 +1,50 @@
|
||||
Development
|
||||
===========
|
||||
|
||||
All the boiler plate needed to show screens has been written. To develop your
|
||||
own custom screens, however, you will need to know some SDL2. There is no real
|
||||
drawing api, to allow you to have as much control over the display as possible.
|
||||
|
||||
dashboard uses a few objects for displaying things to the screen however, to
|
||||
interact with the memory management.
|
||||
|
||||
First off, the default configuration is similar to web development "Carousels".
|
||||
A series of **panels** are shown to the user by cycling through one by one.
|
||||
|
||||
A **board** is a singleton, and represents the physical display board.
|
||||
There is only one per instance of the program, and its has several **panels**
|
||||
|
||||
A **panel** is an object representing a slide on screen. This is a page with
|
||||
weather, a news feed, etc. It is one of the scrolling pages shown to the user.
|
||||
This is what you will need to write.
|
||||
|
||||
Each **panel** has a `draw()` function that you must implement. This will draw
|
||||
everything to the screen using SDL2's API. If you want functions for getting
|
||||
data, several threads, etc, **it is the panel's responsibility to implement
|
||||
this**. The **board** provides a memory API, however you do not have to use
|
||||
it.
|
||||
|
||||
The provided memory api stores textures (SDL_Texture), fonts (TTF_Font), and
|
||||
strings (SDL_Texture). Both static values can be added that will exist for the
|
||||
lifetime of the program, as well as dynamic versions that will be stored in a
|
||||
cache (As of writing, only dynamically cached strings are implemented). All
|
||||
functions related to looking up memory stored in these containers is performed
|
||||
in O(1) time.
|
||||
|
||||
The SDL_Window and SDL_Renderer are provided as static globals, accessible via
|
||||
the **board** object.
|
||||
|
||||
Each **panel** is also recommended to add its own config.hpp file for
|
||||
configuring possible settings. All static files that it needs should be placed
|
||||
in the main config.hpp file
|
||||
|
||||
Things you need to implement as a panel creator
|
||||
-----------------------------------------------
|
||||
|
||||
- `void mypanel::draw()`
|
||||
- `mypanel::mypanel()`
|
||||
- `mypanel::~mypanel()`
|
||||
- `size_t mypanel::_time_on_screen`
|
||||
- `const_resources`
|
||||
|
||||
And be sure to inheret from dashboard::panel !
|
2
Makefile
2
Makefile
@ -10,7 +10,7 @@ FLAGS = -pipe
|
||||
|
||||
CFLAGS = -Wall
|
||||
CFLAGS += -Ofast
|
||||
CFLAGS += -std=c++20
|
||||
CFLAGS += -std=c++17
|
||||
#CFLAGS += -g
|
||||
#CFLAGS += -pg
|
||||
|
||||
|
@ -47,6 +47,13 @@ compile the test.cpp file provided in ./tests . There should be output on the
|
||||
screen as flashing. Feel free to change the desired graphics driver in the
|
||||
raspberry pi config
|
||||
|
||||
Developing your own pannels
|
||||
===========================
|
||||
|
||||
Refer to the
|
||||
[development]
|
||||
(DEVELOPMENT.md)
|
||||
documentation
|
||||
Usage
|
||||
=====
|
||||
|
||||
|
0
font/.gitkeep
Normal file
0
font/.gitkeep
Normal file
BIN
font/elianto-normal.ttf
Normal file
BIN
font/elianto-normal.ttf
Normal file
Binary file not shown.
0
img/.gitkeep
Normal file
0
img/.gitkeep
Normal file
BIN
img/bmp_24.png
Normal file
BIN
img/bmp_24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue
Block a user