-
Notifications
You must be signed in to change notification settings - Fork 0
/
oglblock.h
47 lines (33 loc) · 1.02 KB
/
oglblock.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
#ifndef NICO_OGLBLOCK_H
#define NICO_OGLBLOCK_H NICO_OGLBLOCK_H
#include "common.h"
#include "GL/glew.h"
#include <vector>
#include <string>
#include "bmdread.h"
bool hasShaderHardware();
void setTexWrapMode(u8 sMode, u8 tMode);
struct OglMaterial
{
std::string vertexShaderString;
std::string fragmentShaderString;
bool needsColor[2];
bool needsTexCoord[8];
//etc
GLhandleARB vertexShader;
GLhandleARB fragmentShader;
GLhandleARB glslProgram;
};
struct OglBlock
{
std::vector<OglMaterial> materials;
};
OglBlock* createOglBlock(const Mat3& mat, const std::string& baseName = "");
void freeOglBlock(OglBlock*& oglBlock);
GLenum texFilter(u8 filter);
void setFilters(int magFilter, int minFilter, int mipCount);
void setMaterial(int index, const OglBlock& block, const BModel& bmd);
void loadShaderStrings(OglBlock& block, const std::string& baseName);
void saveShaderStrings(OglBlock& block, const std::string& baseName);
void generateShaderStrings(OglBlock& block, const Mat3& mat);
#endif //NICO_OGLBLOCK_H