gKit2 light
Loading...
Searching...
No Matches
app_time.h
Go to the documentation of this file.
1
2#ifndef _APP_TIME_H
3#define _APP_TIME_H
4
5#include <chrono>
6
7#include "glcore.h"
8#include "app.h"
9#include "text.h"
10
11
13
14const int MAX_FRAMES= 6;
15
18class AppTime : public App
19{
20public:
22 AppTime( const int width, const int height, const int major= 3, const int minor= 3, const int samples= 0 );
23 virtual ~AppTime( );
24
26 virtual int init( ) = 0;
28 virtual int quit( ) = 0;
29
31 virtual int update( const float time, const float delta ) { return 0; }
32
34 virtual int render( ) = 0;
35
36protected:
37 virtual int prerender( );
38 virtual int postrender( );
39
40 std::chrono::high_resolution_clock::time_point m_cpu_start;
41 std::chrono::high_resolution_clock::time_point m_cpu_stop;
42
43 GLuint m_time_query[MAX_FRAMES];
44 GLint64 m_frame_time;
45 int m_frame;
46
47 Text m_console;
48};
49
50
51#endif // _APP_H
virtual int init()=0
a deriver pour creer les objets openGL.
virtual int render()=0
a deriver pour afficher les objets.
AppTime(const int width, const int height, const int major=3, const int minor=3, const int samples=0)
constructeur, dimensions de la fenetre et version d'openGL.
Definition app_time.cpp:8
virtual int quit()=0
a deriver pour detruire les objets openGL.
virtual int update(const float time, const float delta)
a deriver et redefinir pour animer les objets en fonction du temps.
Definition app_time.h:31
App(const int width, const int height, const int major=3, const int minor=3, const int samples=0)
constructeur, dimensions de la fenetre et version d'openGL.
Definition app.cpp:11
Definition text.h:62