34 #include "freertos/FreeRTOS.h" 41 #define FABGL_DEFAULT_SCENETASK_STACKSIZE 2048 64 Scene(
int maxSpritesCount,
int updateTimeMS,
int width,
int height,
int stackSize = FABGL_DEFAULT_SCENETASK_STACKSIZE);
95 void start(
bool suspendTask =
true);
105 virtual void init() = 0;
112 virtual void update(
int updateCount) = 0;
166 static void updateTask(
void * pvParameters);
172 TaskHandle_t m_updateTaskHandle;
175 SemaphoreHandle_t m_mutex;
179 TaskHandle_t m_suspendedTask;
181 volatile bool m_running;
This file contains fabgl::CollisionDetector class definition.
void addSprite(Sprite *sprite)
Adds the specified sprite to collision detector.
int getHeight()
Determines scene height.
virtual void collisionDetected(Sprite *spriteA, Sprite *spriteB, Point collisionPoint)=0
This is an abstract method called whenever a collision has been detected.
void addSprite(Sprite *sprite)
Adds the specified sprite to collision detector.
A class to detect sprites collisions.
Scene is an abstract class useful to encapsulate functionalities of a scene (sprites, collision detector and updates).
void removeSprite(Sprite *sprite)
Removes the specified sprite from collision detector.
Scene(int maxSpritesCount, int updateTimeMS, int width, int height, int stackSize=FABGL_DEFAULT_SCENETASK_STACKSIZE)
The Scene constructor.
Represents the coordinate of a point.
virtual void init()=0
This is an abstract method called when the scene needs to be initialized.
This file contains FabGL library configuration settings, like number of supported colors...
void updateSprite(Sprite *sprite)
Updates collision detector.
void removeSprite(Sprite *sprite)
Removes the specified sprite from collision detector.
void updateSpriteAndDetectCollisions(Sprite *sprite)
Updates collision detector and generate collision events.
void update(Sprite *sprite)
Updates collision detector.
void start(bool suspendTask=true)
Starts scene updates and suspends current task.
int getWidth()
Determines scene width.
void stop()
Stops scene updates and resumes suspended task.
virtual void update(int updateCount)=0
This is an abstract method called whenever the scene needs to be updated.