Dualie
Loading...
Searching...
No Matches
RenderWindow.hpp
1//
2// Created by caleb on 6/16/24.
3//
4
5#ifndef DUALIE_RENDERWINDOW_HPP
6#define DUALIE_RENDERWINDOW_HPP
7#include <citro2d.h>
8#include <Dualie/Graphics/Color.hpp>
9#include <Dualie/Graphics/Drawable.hpp>
10#include <Dualie/System/Input.hpp>
11#include <Dualie/Graphics/View.hpp>
12#include <Dualie/Audio/Music.hpp>
13#include <vector>
14
15namespace dl {
16
17 enum SCREEN {
18 TOP_SCREEN = 0,
19 BOTTOM_SCREEN = 2
20 };
21
22
23
28
29 public:
32
38 void InitPrintScreen(SCREEN screen);
39
47 void print(std::string str, int x, int y);
48
56 void clear(SCREEN screen, Color color = dl::Color(0,0,0));
57
62 void draw(dl::Drawable& drawable);
63
68 void display();
69
74 bool isOpen();
75
76
81 void setView(const dl::View& view);
82
87 void set3dActive(bool active);
88
94
95
96
97 private:
98 C3D_RenderTarget* m_screens[3];
99 SCREEN m_currentScreen;
100 dl::View m_view;
101 bool m_3dActive;
102 std::vector<dl::Drawable*> m_drawQueue;
103
104
105 };
106
107}
108
109
110#endif //DUALIE_RENDERWINDOW_HPP
A class used to describe a RGBA color.
Definition Color.hpp:19
The base class for any object that can be drawn to the screen.
Definition Drawable.hpp:15
A interface for rendering. Includes both top and bottoms screens as targets.
Definition RenderWindow.hpp:27
bool isOpen()
A function that should be used as a main loop. It also handles the updating of input.
Definition RenderWindow.cpp:53
void clear(SCREEN screen, Color color=dl::Color(0, 0, 0))
Clears a screen and prepares it for rendering. Note that RenderWindow::draw and RenderWindow::display...
Definition RenderWindow.cpp:60
void InitPrintScreen(SCREEN screen)
Initializes a screen to use for printing. Note that if a screen is initialized for printing and then ...
Definition RenderWindow.cpp:43
void setView(const dl::View &view)
Sets a view to the screen.
Definition RenderWindow.cpp:102
void draw(dl::Drawable &drawable)
Draws a drawable to the screen.
Definition RenderWindow.cpp:73
dl::Vector2f getCurrentViewOffset()
Gets the current render offset in pixels that the current view causes.
Definition RenderWindow.cpp:106
void print(std::string str, int x, int y)
Prints text to the screen. A screen must be initialized using RenderWindow::InitPrintScreen for this ...
Definition RenderWindow.cpp:47
void set3dActive(bool active)
Determines whether the stereoscopic 3d effect should be active or not.
Definition RenderWindow.cpp:110
void display()
Displays rendered objects to the screen. Note that this will only display the objects drawn on the la...
Definition RenderWindow.cpp:79
Used as a camera-like object to move the screen view to different positions in world coordinates.
Definition View.hpp:19