blob: 80ef4dca3dc674d618e377370255713638f3e244 (
plain)
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
|
#ifndef __JIN_JSL_H
#define __JIN_JSL_H
#include <string>
#include <map>
#include "color.h"
#include "image.h"
#include "canvas.h"
#include "3rdparty/GLee/GLee.h"
namespace jin
{
namespace render
{
class JSLProgram
{
public:
void init(const char* program);
void use();
static void unuse();
void sendFloat(const char* name, float number);
void sendImage(const char* name, const Image* image);
void sendVec2(const char* name, float x, float y);
void sendVec3(const char* name, float x, float y, float z);
void sendVec4(const char* name, float x, float y, float z, float w);
void sendCanvas(const char* name, const Canvas* canvas);
void sendColor(const char* name, const color* col);
private:
JSLProgram();
GLuint pid;
static JSLProgram* current_JSL_program;
static GLint current_texture_unit;
static GLint max_texture_units;
static GLint getTextureUnit(const std::string& name);
};
}
}
#endif
|