Skip to content
fgrimau edited this page Dec 28, 2019 · 10 revisions

The Screen class

Handle all the screen/window related things, such as creating it, naming it, loading images, rendering text, setting fullscreen, ...

Screen Methods

Constructors

  • Screen()
  • Screen(const Screen&)
  • ~Screen()

Override

  • Screen& operator=(const Screen&)

Getters

  • int get_height() const
  • int get_width() const
  • SDL_Window* get_window() const
  • SDL_Color get_background_color() const
  • TTF_Font* get_font() const
  • bool is_running() const
  • bool get_key(SDL_Keycode)
  • SDL_Rect get_mouse_pos() const
  • SDL_Renderer* get_renderer() const

Setters

  • int set_height(int)
  • int set_width(int)
  • void set_background_color(SDL_Color)
  • void set_background_color(Uint8, Uint8, Uint8)
  • void toggle_fps_show()

Others

  • int init()
  • int build_window()
  • SDL_Texture* convert_surface_to_texure(SDL_Surface*)
  • int blit(SDL_Texture*, const SDL_Rect*, int, int)
  • int blit(SDL_Texture*, const SDL_Rect*, int, int, int)
  • int blit(SDL_Texture*, const SDL_Rect*, int, int, int, int)
  • int blit(SDL_Texture*, const SDL_Rect*, SDL_Rect)
  • void handle_events(SDL_Event*)
  • void update_screen()
  • void compute_fps()

Clone this wiki locally