Physics-Simulator  v1.4.0-beta.2
screen.h
Go to the documentation of this file.
1 #ifndef __MY_SCREEN_HEADER__
2 #define __MY_SCREEN_HEADER__
3 /*****************************************************************************/
4 #include <SDL2/SDL.h>
5 #include <SDL2/SDL_image.h>
6 #include <string>
7 #include "config.h"
8 /*****************************************************************************/
13 /*****************************************************************************/
19 /*****************************************************************************/
22 struct stcWinAtt {
23  unsigned int width;
24  unsigned int height;
25  SDL_Window *win;
26  SDL_Renderer *ren;
27  SDL_Texture *ball;
28  SDL_Texture *pixel;
29  SDL_Texture *toolbox;
30  SDL_Texture *tools;
31  SDL_Rect toolclips[6];
32 };
33 /*****************************************************************************/
36 struct stcLocation {
37  int x;
38  int y;
39 };
40 
41 typedef struct stcWinAtt WINATT;
42 typedef struct stcLocation LOC;
44 /*****************************************************************************/
45 // It is likely bad practice to hold values like this...
46 namespace screen {
47  extern WINATT screenatt;
48 }
49 /*****************************************************************************/
50 #include "cannonball.h"
51 /*****************************************************************************/
52 class clsScreen {
53  public:
54  clsScreen();
55  ~clsScreen();
56 
57  void update(void);
58  void cleanup(void);
59  void clearscreen(void);
60  bool getSDLStarted(void);
61  void drawline(LOC, LOC);
62 
63  private:
64 
65  bool blnWindow_;
66  bool blnRenderer_;
67  bool blnBall_;
68  bool blnPixel_;
69  bool blnToolbox_;
70  bool blnTools_;
71  bool bln_SDL_started_;
72  SDL_Texture* loadIMG(std::string);
73  void error(void);
74  void setClips(void);
75 };
76 /*****************************************************************************/
77 #endif // __MY_SCREEN_HEADER__
This class will hold all of the functions for the SDL screen.
Definition: screen.h:52
int x
Definition: screen.h:37
SDL_Texture * toolbox
Definition: screen.h:29
unsigned int height
Definition: screen.h:24
SDL_Texture * ball
Definition: screen.h:27
Definition: screen.cpp:15
Definition: screen.h:22
SDL_Renderer * ren
Definition: screen.h:26
SDL_Window * win
Definition: screen.h:25
WINATT screenatt
Definition: screen.cpp:16
int y
Definition: screen.h:38
SDL_Texture * tools
Definition: screen.h:30
Definition: screen.h:36
SDL_Rect toolclips[6]
Definition: screen.h:31
unsigned int width
Definition: screen.h:23
SDL_Texture * pixel
Definition: screen.h:28