From 077ef3a50443d3a1543a3854fb749f19f81a358b Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 10 Apr 2021 11:46:45 +0200 Subject: [PATCH] Finished up 24_sdl_main_scene.txt. --- 24_sdl_main_scene.txt | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/24_sdl_main_scene.txt b/24_sdl_main_scene.txt index 0cfda33..5590691 100644 --- a/24_sdl_main_scene.txt +++ b/24_sdl_main_scene.txt @@ -1,4 +1,9 @@ +Implementájunk egy Scene-t, ami kirajzol valamit a képernyőre. Például az esetünkben egy Sprite-ot. + +Az ApplicationImpl már kész, az fog ebből egyet csinálni, és beállítani aktívnak. + +Itt az UML diagram: |---------------------------------------------------------------------------------------| | class MainScene : public Scene | @@ -17,14 +22,20 @@ | + int _dir | |---------------------------------------------------------------------------------------| +A függvények pszeudokódja: +----------- void event(const SDL_Event &ev): return +----------- + void update(float delta): return +----------- + void render(): Renderer::get_singleton()->clear() @@ -39,6 +50,7 @@ void render(): _sprite->draw() +----------- MainScene(): _camera = new Camera() @@ -51,6 +63,7 @@ MainScene(): _dir = 1 +----------- ~MainScene(): _texture->free() @@ -61,27 +74,4 @@ MainScene(): delete _image delete _camera - - - - - - -#ifndef IMPL_APPLICATION_H -#define IMPL_APPLICATION_H - -#include "application.h" - -#include "main_scene.h" - -class ImplApplication : public Application: -public: - ImplApplication() : Application(): - scene = new MainScene() - - ~ImplApplication(): - delete scene - - - -#endif \ No newline at end of file +-----------