TouchCPLib  1.0.0
A touch-enabled GUI interface based on SDL and libTS. It provides a simple desktop-free UI for your embedded Raspberry projects.
Window.h
Go to the documentation of this file.
1 #pragma once
2 
13 #include <SDL2/SDL.h>
14 #include <exception>
15 #include <string>
16 #include "SDLException.h"
17 
21 class Window
22 {
23 public:
30  Window(int width, int height, SDL_Color color);
31  ~Window();
36  SDL_Window *getWindowObject() const;
41  SDL_Surface *getSurface() const;
46  SDL_Renderer *getRenderer() const;
47  void update();
48 
49 private:
50  SDL_Window *window = nullptr;
51  SDL_Surface *screenSurf = nullptr;
52  SDL_Renderer *renderer = nullptr;
53  int WIDTH, HEIGHT;
54 };
The main window object.
Definition: Window.h:21
SDL_Surface * getSurface() const
Get the native SDL surface.
Definition: Window.cpp:33
Window(int width, int height, SDL_Color color)
Create a window object.
Definition: Window.cpp:3
SDL_Renderer * getRenderer() const
Get the native SDL renderer.
Definition: Window.cpp:38
SDL_Window * getWindowObject() const
Get the native SDL window object.
Definition: Window.cpp:28
~Window()
Definition: Window.cpp:22
void update()
Definition: Window.cpp:43