summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-28 11:09:59 +0800
committerchai <chaifix@163.com>2021-10-28 11:09:59 +0800
commit92dd401d75e19281dc7a01492ab3c0996de330fc (patch)
tree489abcea143fc269e77a0553c6f12ec821bf2feb
parentf6327c0948d666a4b61358c7aefed36eb070198d (diff)
*misc
-rw-r--r--Runtime/Graphics/Color.h54
-rw-r--r--Runtime/Graphics/GfxDevice.h14
-rw-r--r--Runtime/Graphics/PolyLine.cpp2
-rw-r--r--Runtime/Graphics/ShaderCompiler.cpp4
-rw-r--r--Runtime/Graphics/ShaderCompiler.h12
-rw-r--r--Runtime/Scripting/GL/GL.bind.cpp2
6 files changed, 48 insertions, 40 deletions
diff --git a/Runtime/Graphics/Color.h b/Runtime/Graphics/Color.h
index 3cff7a5..abc0724 100644
--- a/Runtime/Graphics/Color.h
+++ b/Runtime/Graphics/Color.h
@@ -1,33 +1,35 @@
-#ifndef COLOR_H
-#define COLOR_H
+#pragma once
#include "../Utilities/Type.h"
-class Color
+namespace Internal
{
-public:
- Color(float r = 0, float g = 0, float b = 0, float a = 0)
- {
- this->r = r;
- this->g = g;
- this->b = b;
- this->a = a;
- }
- float r, g, b, a;
-};
-class Color32
-{
-public:
- Color32(int r = 0, int g = 0, int b = 0, int a = 0)
- {
- this->r = r;
- this->g = g;
- this->b = b;
- this->a = a;
- }
- int r, g, b, a;
+ class Color
+ {
+ public:
+ Color(float r = 0, float g = 0, float b = 0, float a = 0)
+ {
+ this->r = r;
+ this->g = g;
+ this->b = b;
+ this->a = a;
+ }
+ float r, g, b, a;
+ };
+
+ class Color32
+ {
+ public:
+ Color32(int r = 0, int g = 0, int b = 0, int a = 0)
+ {
+ this->r = r;
+ this->g = g;
+ this->b = b;
+ this->a = a;
+ }
+ int r, g, b, a;
-};
+ };
-#endif \ No newline at end of file
+}
diff --git a/Runtime/Graphics/GfxDevice.h b/Runtime/Graphics/GfxDevice.h
index ab35428..0931eae 100644
--- a/Runtime/Graphics/GfxDevice.h
+++ b/Runtime/Graphics/GfxDevice.h
@@ -47,7 +47,7 @@ public:
SharedVertexBuffer* GetSharedVBO() { return &m_SharedVBO; }
- GET_SET(Color, ClearColor, m_ClearColor);
+ GET_SET(Internal::Color, ClearColor, m_ClearColor);
GET_SET(ETextureFilterMode, DefaultFilterMode, m_DefaultFilterMode);
GET_SET(ETextureWrapMode, DefaultWrapMode, m_DefaultWrapMode);
@@ -55,12 +55,12 @@ private:
bool m_IsInsideFrame;
// äÖȾ״̬
- uint m_EnableFlag;
- Color m_ClearColor;
- EDepthTest m_DepthTest;
- EStencilTest m_StencilTest;
- EStencilOp m_StencilOp;
- byte m_StencilMask;
+ uint m_EnableFlag;
+ Internal::Color m_ClearColor;
+ EDepthTest m_DepthTest;
+ EStencilTest m_StencilTest;
+ EStencilOp m_StencilOp;
+ byte m_StencilMask;
// ÌùͼĬÈÏÉèÖÃ
ETextureFilterMode m_DefaultFilterMode;
diff --git a/Runtime/Graphics/PolyLine.cpp b/Runtime/Graphics/PolyLine.cpp
index db27903..24686f9 100644
--- a/Runtime/Graphics/PolyLine.cpp
+++ b/Runtime/Graphics/PolyLine.cpp
@@ -5,5 +5,5 @@
struct PolyLineVBOLayout
{
Internal::Vector3 position;
- Color32 color;
+ Internal::Color32 color;
};
diff --git a/Runtime/Graphics/ShaderCompiler.cpp b/Runtime/Graphics/ShaderCompiler.cpp
index d68b64e..66413e9 100644
--- a/Runtime/Graphics/ShaderCompiler.cpp
+++ b/Runtime/Graphics/ShaderCompiler.cpp
@@ -1,7 +1,7 @@
#include "ShaderCompiler.h"
-int GLSLCompiler::Compile(std::string& src, std::string& vsh, std::string& fsh)
+void GLSLCompiler::Compile(std::string& src, std::string& vsh, std::string& fsh)
{
- return 0;
+
}
diff --git a/Runtime/Graphics/ShaderCompiler.h b/Runtime/Graphics/ShaderCompiler.h
index 2917cf4..f4dc0a5 100644
--- a/Runtime/Graphics/ShaderCompiler.h
+++ b/Runtime/Graphics/ShaderCompiler.h
@@ -1,5 +1,6 @@
#pragma once
+#include <exception>
#include <string>
#include "Runtime/Threading/Mutex.h"
#include "Runtime/Threading/Job.h"
@@ -20,14 +21,19 @@ class CompileGLSLShaderJob : public Job
};
-enum EGLSLCompileErrorCode
+class GLSLCompileException : std::exception
{
- Success = 0,
+public:
+ GLSLCompileException(const char* what)
+ : std::exception(what)
+ {
+ }
+
};
class GLSLCompiler
{
public:
- static int Compile(std::string& src, std::string& vsh, std::string& fsh);
+ static void Compile(std::string& src, std::string& vsh, std::string& fsh)/*throw GLSLCompileException*/;
};
diff --git a/Runtime/Scripting/GL/GL.bind.cpp b/Runtime/Scripting/GL/GL.bind.cpp
index fe391c7..903e706 100644
--- a/Runtime/Scripting/GL/GL.bind.cpp
+++ b/Runtime/Scripting/GL/GL.bind.cpp
@@ -117,7 +117,7 @@ int End(lua_State* L)
int Vertex(lua_State* L)
{
LUA_BIND_STATE(L);
- if (LuaHelper::IsType(state, "GameLab.Engine.Math.Internal::Vector3", 1))
+ if (LuaHelper::IsType(state, "GameLab.Engine.Math.Vector3", 1))
{
float x = state.GetField(-1, "x", 0);
float y = state.GetField(-1, "y", 0);