~ubuntu-branches/debian/wheezy/gource/wheezy

« back to all changes in this revision

Viewing changes to src/core/sdlapp.h

  • Committer: Package Import Robot
  • Author(s): Andrew Caudwell
  • Date: 2012-04-24 11:25:45 UTC
  • mfrom: (1.2.13)
  • Revision ID: package-import@ubuntu.com-20120424112545-18fbnycu9xrsl4s5
Tags: 0.38-1
* New upstream release (closes: #667189)
* New build dependencies on libglm-dev and libboost-filesystem-dev. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#ifndef SDLAPP_H
29
29
#define SDLAPP_H
30
30
 
 
31
#ifdef _WIN32
 
32
 
 
33
#ifdef _WIN32_WINNT
 
34
#undef _WIN32_WINNT
 
35
#endif
 
36
 
 
37
#define _WIN32_WINNT 0x0501
 
38
#include "windows.h"
 
39
#endif
 
40
 
31
41
#include "display.h"
32
42
#include "logger.h"
33
43
 
42
52
extern std::string gSDLAppExec;
43
53
 
44
54
#ifdef _WIN32
 
55
extern HWND gSDLAppConsoleWindow;
 
56
 
 
57
bool SDLAppAttachToConsole();
45
58
void SDLAppCreateWindowsConsole();
46
59
void SDLAppResizeWindowsConsole(int height);
47
60
#endif
63
76
    SDLAppException(const char* str, ...) : showhelp(false) {
64
77
 
65
78
        va_list vl;
66
 
        char msg[1024];
 
79
        char msg[4096];
67
80
 
68
81
        va_start(vl, str);
69
 
            vsnprintf(msg, 1024, str, vl);
 
82
            vsnprintf(msg, 4096, str, vl);
70
83
        va_end(vl);
71
84
 
72
85
        message = std::string(msg);
87
100
    int fps_updater;
88
101
    int return_code;
89
102
 
90
 
 
91
103
    void updateFramerate();
92
104
protected:
 
105
    int  min_delta_msec;
93
106
    bool appFinished;
94
107
    void stop(int return_code);
95
108
public:
100
113
 
101
114
    int run();
102
115
 
 
116
    virtual void resize(int width, int height) {};
 
117
 
103
118
    virtual void update(float t, float dt) {};
104
119
    virtual void init() {};
105
120
 
106
121
    virtual void logic(float t, float dt) {};
107
122
    virtual void draw(float t, float dt) {};
108
123
 
 
124
    virtual void quit() { appFinished = true; };
 
125
    
109
126
    virtual void mouseMove(SDL_MouseMotionEvent *e) {};
110
127
    virtual void mouseClick(SDL_MouseButtonEvent *e) {};
111
128
    virtual void keyPress(SDL_KeyboardEvent *e) {};
112
129
 
 
130
#if SDL_VERSION_ATLEAST(1,3,0)
 
131
    virtual void mouseWheel(SDL_MouseWheelEvent *e) {};
 
132
#endif
 
133
 
113
134
    int returnCode();
114
135
    bool isFinished();
115
136
};