hx3d  1
2D/3D Simple Game Framework
sdl2_application.hpp
1 /*
2  SDL2 Application.
3  Copyright (C) 2015 Denis BOURGE
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #ifndef HX3D_WINDOW_SDL2_SDL2APPLICATION
22 #define HX3D_WINDOW_SDL2_SDL2APPLICATION
23 
24 #include "hx3d/window/application.hpp"
25 
26 #include <SDL2/SDL.h>
27 
28 namespace hx3d {
29 namespace window {
30 
31 class Game;
32 
37 
38 public:
45  virtual ~SDL2Application();
46 
47  virtual void start(const Ptr<Game>& game) override;
48 
49 private:
50  SDL_Window* _window;
51  SDL_GLContext _context;
52 
60  void create(int width, int height, std::string title);
61 
65  void display();
66 
70  void render();
71 
77  void update(float delta);
78 };
79 
80 } /* window */
81 } /* hx3d */
82 
83 #endif /* HX3D_WINDOW_SDL2_SDL2APPLICATION */
Application configuration.
Application management.
Definition: application.hpp:42
hx3d framework namespace
Definition: audio.hpp:26
SDL2Application(ApplicationConfig config)
Create a SDL2 window.
SDL2 application implementation.
virtual void start(const Ptr< Game > &game) override
Start the window.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Definition: ptr.hpp:34