Dualie
Loading...
Searching...
No Matches
dl::RenderWindow Class Reference

A interface for rendering. Includes both top and bottoms screens as targets. More...

#include <RenderWindow.hpp>

Public Member Functions

void InitPrintScreen (SCREEN screen)
 Initializes a screen to use for printing. Note that if a screen is initialized for printing and then rendered to, it will render garbage.
 
void print (std::string str, int x, int y)
 Prints text to the screen. A screen must be initialized using RenderWindow::InitPrintScreen for this to work.
 
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 will target the screen last cleared.
 
void draw (dl::Drawable &drawable)
 Draws a drawable to the screen.
 
void display ()
 Displays rendered objects to the screen. Note that this will only display the objects drawn on the last cleared screen. Screens must be cleared, drawn to, and displayed separately.
 
bool isOpen ()
 A function that should be used as a main loop. It also handles the updating of input.
 
void setView (const dl::View &view)
 Sets a view to the screen.
 
void set3dActive (bool active)
 Determines whether the stereoscopic 3d effect should be active or not.
 
dl::Vector2f getCurrentViewOffset ()
 Gets the current render offset in pixels that the current view causes.
 

Detailed Description

A interface for rendering. Includes both top and bottoms screens as targets.

Member Function Documentation

◆ clear()

void dl::RenderWindow::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 will target the screen last cleared.

Parameters
screenThe screen to clear
colorThe clear color

◆ draw()

void dl::RenderWindow::draw ( dl::Drawable & drawable)

Draws a drawable to the screen.

Parameters
drawableThe drawable object to draw to the screen

◆ getCurrentViewOffset()

dl::Vector2f dl::RenderWindow::getCurrentViewOffset ( )

Gets the current render offset in pixels that the current view causes.

Returns
The render offset in pixels that the current view causes

◆ InitPrintScreen()

void dl::RenderWindow::InitPrintScreen ( dl::SCREEN screen)

Initializes a screen to use for printing. Note that if a screen is initialized for printing and then rendered to, it will render garbage.

Parameters
screenScreen to initizalize printing for

◆ isOpen()

bool dl::RenderWindow::isOpen ( )

A function that should be used as a main loop. It also handles the updating of input.

Returns
Whether the program is open or not.

◆ print()

void dl::RenderWindow::print ( std::string str,
int x,
int y )

Prints text to the screen. A screen must be initialized using RenderWindow::InitPrintScreen for this to work.

Parameters
strThe string to print
xX position of text
yY position of text

◆ set3dActive()

void dl::RenderWindow::set3dActive ( bool active)

Determines whether the stereoscopic 3d effect should be active or not.

Parameters
activeWhether the effect is active

◆ setView()

void dl::RenderWindow::setView ( const dl::View & view)

Sets a view to the screen.

Parameters
viewThe view to set

The documentation for this class was generated from the following files: