From 38dfa2a8b63b34702281f736b1edfdd866b3fc10 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Mon, 20 Dec 2021 13:02:06 -0500 Subject: [PATCH] Update DEVELOPMENT.md with docs on initTexture() --- DEVELOPMENT.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4971431..8d32a0e 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -24,6 +24,13 @@ 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. +Each *panel* also has an `initTexture()` function that you must implement. This +should initialize the texture and should be called in your draw function. It is +up to you to call this, to give you the option of lazy loading it. +*This must be called in `draw()` or later, not in the constructor*. This is +because SDL will not be setup when your constructor is called, and therefore +will not be able to properly create the texture for the renderer. + 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