summaryrefslogtreecommitdiff
path: root/Client/Source/Graphics/ShaderCompiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Source/Graphics/ShaderCompiler.h')
-rw-r--r--Client/Source/Graphics/ShaderCompiler.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/Client/Source/Graphics/ShaderCompiler.h b/Client/Source/Graphics/ShaderCompiler.h
new file mode 100644
index 0000000..f374567
--- /dev/null
+++ b/Client/Source/Graphics/ShaderCompiler.h
@@ -0,0 +1,55 @@
+#pragma once
+
+#include <exception>
+#include <string>
+#include "../Threading/Mutex.h"
+#include "../Threading/Job.h"
+#include "../Graphics/RenderCommands.h"
+
+// ±ąŅėGLSL(GameLab Shader)
+
+// in: .glsl path
+// out: vsh & fsh
+class CompileGLSLJob : public Job
+{
+
+};
+
+// in: glsl shader
+// out: vsh & fsh
+class CompileGLSLShaderJob : public Job
+{
+
+};
+
+class GLSLCompileException : public std::exception
+{
+public:
+ GLSLCompileException(const char* what)
+ : std::exception(what)
+ {
+ }
+
+};
+
+class GLSLCompiler
+{
+public:
+ static void Compile(std::string& src, std::string& vsh, std::string& fsh, RenderCommandGroup& cmd)/*throw GLSLCompileException*/;
+
+private:
+ static std::string GetContent(std::string& src, const char* from, const char* to);
+ static std::string TrimContent(std::string& src, const char* from, const char* to);
+ static bool IsLabelActive(std::string& src, const char* label);
+
+ static void ParseCmd(std::string& cmd, RenderCommandGroup& group);
+ static bool IsCommandActive(std::string& src, const char* label);
+ static bool FindCmdPos(std::string& line, int* start, int* end);
+ static bool IsLineCommentd(std::string& line);
+ static void CommandCull(std::string& params, RenderCommandGroup& group);
+ static void CommandBlend(std::string& params, RenderCommandGroup& group);
+ static void CommandDepthTest(std::string& params, RenderCommandGroup& group);
+ static void CommandDepthWrite(std::string& params, RenderCommandGroup& group);
+ static void GetParams(const char* cmdName, std::string& params, std::string* out, int n);
+
+};