-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCApp.h
66 lines (50 loc) · 1.33 KB
/
CApp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// ============================================================================
// [Include Section]
// ============================================================================
#ifdef _WIN32
#include <SDL.h>
#else
#include <SDL2/SDL.h> //---------| includes start |----------->>
#include <iostream>
#include "player.h"
#include "renderUtils.h"
#include "texture.h"
#include "viewport.h" //---------| includes stop |------------>>
#endif
// ============================================================================
// [CApp]
// ============================================================================
// This is just a sample SDL application class to test that the app works.
class CApp
{
public:
// Application state
enum APP_STATE
{
APP_OK = 0,
APP_FAILED = 1
};
CApp();
~CApp();
// Run application, called by your code.
int OnExecute();
private:
SDL_Surface* surface;
SDL_Texture* texture;
//my objects
Player player;
// Whether the application is running.
bool running;
SDL_Window* window;
SDL_Renderer* renderer;
// Initialize application
int OnInit();
// Clean up the application
void OnCleanup();
// Called to process SDL event.
void OnEvent(SDL_Event* event);
// Called to update game logic
void OnUpdate();
// Called to render the app.
void OnRender();
};