Physics-Simulator
v1.4.0-beta.2
|
This class will hold all of the functions for the SDL screen. More...
#include "source/screen.h"
Public Member Functions | |
clsScreen () | |
~clsScreen () | |
void | update (void) |
void | cleanup (void) |
void | clearscreen (void) |
bool | getSDLStarted (void) |
void | drawline (LOC, LOC) |
This class will hold all of the functions for the SDL screen.
clsScreen::clsScreen | ( | ) |
The default constructor for the SDL screen it will try start SDL, and create and window and a renderer, then try to load the textures it will need, if any of these fail it will set bln_SDL_Started to false and return void, when main in main.cpp it checks bln_SDL_Started and will end the entire program if it is false. If, however, bln_SDL_Started is true it will continue on with the rest of the program.
clsScreen::~clsScreen | ( | ) |
This is the default deconstructor, it will just call clsScreen::cleanup to ensure everything is cleared from memory, and then quit SDL.
void clsScreen::cleanup | ( | void | ) |
This will attempt to delete Textures, and the Window / Renderer from memory if their representative loaded boolean is true. Will delete
void clsScreen::clearscreen | ( | void | ) |
Will delete all textures currently shown on the screen
Will draw a line (using the pixel texture) from the old mouse location to the Current mouse location
Current | = Current Mouse Location in terms of X and Y |
Old | = Old Mouse Location (start of click) in terms of X and Y |
bool clsScreen::getSDLStarted | ( | void | ) |
Returns if SDL is started and running without issues
void clsScreen::update | ( | void | ) |
Will update the SDL screen with whatever has been drawn see clsCannonball::show