Physics-Simulator  v1.4.0-beta.2
clsScreen Class Reference

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)
 

Detailed Description

This class will hold all of the functions for the SDL screen.

Constructor & Destructor Documentation

◆ clsScreen()

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::~clsScreen ( )

This is the default deconstructor, it will just call clsScreen::cleanup to ensure everything is cleared from memory, and then quit SDL.

Member Function Documentation

◆ cleanup()

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

  • Ball texture
  • Pixel Texture
  • Renderer
  • Window
Returns
void

◆ clearscreen()

void clsScreen::clearscreen ( void  )

Will delete all textures currently shown on the screen

Returns
void

◆ drawline()

void clsScreen::drawline ( LOC  Current,
LOC  Old 
)

Will draw a line (using the pixel texture) from the old mouse location to the Current mouse location

Parameters
Current= Current Mouse Location in terms of X and Y
Old= Old Mouse Location (start of click) in terms of X and Y
Returns
void

◆ getSDLStarted()

bool clsScreen::getSDLStarted ( void  )

Returns if SDL is started and running without issues

Returns
bln_SDL_started

◆ update()

void clsScreen::update ( void  )

Will update the SDL screen with whatever has been drawn see clsCannonball::show

Returns
void

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