-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlslHotProg.h
40 lines (31 loc) · 881 Bytes
/
GlslHotProg.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
//
// GlslHotProg.cpp
// GlslHotProg
//
// Created by Joel Pryde on 6/14/12.
//
#include "cinder/cinder.h"
#include "cinder/DataSource.h"
#include "cinder/Function.h"
#include "cinder/Filesystem.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/GlslProg.h"
class GlslHotProg
{
ci::fs::path mVertPath;
ci::fs::path mFragPath;
std::time_t mLastVertTime;
std::time_t mLastFragTime;
ci::gl::GlslProg mProg;
bool loadFile();
public:
GlslHotProg() {}
/* !!! NOTE: only works with asset paths */
GlslHotProg( const char* vertPath, const char* fragPath );
//-----------------------------------------------------------------
bool update();
bool hasChanged();
bool reload();
//-----------------------------------------------------------------
ci::gl::GlslProg& getProg() { return mProg; }
};