ddnet/src/engine/client/opengl_sl.h

56 lines
1.1 KiB
C
Raw Normal View History

#ifndef ENGINE_CLIENT_OPENGL_SL_H
#define ENGINE_CLIENT_OPENGL_SL_H
#include <GL/glew.h>
2020-08-19 05:05:51 +00:00
#include <vector>
#include <string>
class CGLSLCompiler;
class CGLSL {
public:
2020-08-19 05:05:51 +00:00
bool LoadShader(CGLSLCompiler* pCompiler, class IStorage *pStorage, const char *pFile, int Type);
void DeleteShader();
bool IsLoaded();
GLuint GetShaderID();
CGLSL();
virtual ~CGLSL();
private:
GLuint m_ShaderID;
int m_Type;
bool m_IsLoaded;
2017-10-20 07:08:49 +00:00
};
2020-08-19 05:05:51 +00:00
class CGLSLCompiler
{
private:
friend class CGLSL;
struct SGLSLCompilerDefine
{
SGLSLCompilerDefine(const std::string& DefineName, const std::string& DefineValue)
{
m_DefineName = DefineName;
m_DefineValue = DefineValue;
}
std::string m_DefineName;
std::string m_DefineValue;
};
std::vector<SGLSLCompilerDefine> m_Defines;
int m_OpenGLVersionMajor;
int m_OpenGLVersionMinor;
int m_OpenGLVersionPatch;
public:
CGLSLCompiler(int OpenGLVersionMajor, int OpenGLVersionMinor, int OpenGLVersionPatch);
void AddDefine(const std::string& DefineName, const std::string& DefineValue);
void AddDefine(const char* pDefineName, const char* pDefineValue);
void ClearDefines();
};
#endif // ENGINE_CLIENT_OPENGL_SL_H