summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documents/代码.xlsxbin42793 -> 44165 bytes
-rw-r--r--Runtime/Graphics/CustomVertexLayout.h5
-rw-r--r--Runtime/Graphics/Shader.cpp2
-rw-r--r--Runtime/Graphics/ShaderCompiler.cpp3
-rw-r--r--Runtime/Rendering/UIQuad.cpp2
-rw-r--r--Runtime/Utilities/StaticInitiator.h5
6 files changed, 12 insertions, 5 deletions
diff --git a/Documents/代码.xlsx b/Documents/代码.xlsx
index 878e310..4e76a47 100644
--- a/Documents/代码.xlsx
+++ b/Documents/代码.xlsx
Binary files differ
diff --git a/Runtime/Graphics/CustomVertexLayout.h b/Runtime/Graphics/CustomVertexLayout.h
index cd68a27..8f9dda8 100644
--- a/Runtime/Graphics/CustomVertexLayout.h
+++ b/Runtime/Graphics/CustomVertexLayout.h
@@ -12,6 +12,11 @@ struct CustomVertexLayout
GLuint buffer; // ʱ
std::vector<VertexAttributeDescriptor> attributes;
+ CustomVertexLayout()
+ {
+ int n = buffer;
+ }
+
// pointerstartOffsetΪ0
void RestorePointer()
{
diff --git a/Runtime/Graphics/Shader.cpp b/Runtime/Graphics/Shader.cpp
index 4b4c9e0..60e165f 100644
--- a/Runtime/Graphics/Shader.cpp
+++ b/Runtime/Graphics/Shader.cpp
@@ -75,7 +75,7 @@ void Shader::CompileProgram(const char* vert, const char* frag, bool keepSrc)
const char* fragCode = frag;
// vertex shader
m_VertID = glCreateShader(GL_VERTEX_SHADER);
- glShaderSource(m_VertID, 1, &vertCode, NULL);
+ glShaderSource(m_VertID, 1, &vertCode, NULL);//Ϊ֧עͣȴNULL
glCompileShader(m_VertID);
checkCompileshaderErrorors(m_VertID, "VERTEX");
// fragment Shader
diff --git a/Runtime/Graphics/ShaderCompiler.cpp b/Runtime/Graphics/ShaderCompiler.cpp
index a3dcf50..20b19f5 100644
--- a/Runtime/Graphics/ShaderCompiler.cpp
+++ b/Runtime/Graphics/ShaderCompiler.cpp
@@ -31,8 +31,7 @@ if(pos == string::npos || !IsLabelActive(src, label)) {\
CheckLabel(VSH_END);
CheckLabel(FSH_BEGIN);
CheckLabel(FSH_END);
-
-
+
vsh = GetContent(src, VSH_BEGIN, VSH_END);
fsh = GetContent(src, FSH_BEGIN, FSH_END);
diff --git a/Runtime/Rendering/UIQuad.cpp b/Runtime/Rendering/UIQuad.cpp
index 35dcf7e..089d0e1 100644
--- a/Runtime/Rendering/UIQuad.cpp
+++ b/Runtime/Rendering/UIQuad.cpp
@@ -10,7 +10,7 @@ struct UIQuadLayout
static CustomVertexLayout layout;
-InitializeStaticVariables([](){
+InitializeStaticVariables([]() {
VertexAttributeDescriptor POSITION = VertexAttributeDescriptor(0, 2, VertexAttrFormat_Float, sizeof(UIQuadLayout));
VertexAttributeDescriptor UV = VertexAttributeDescriptor(sizeof(Internal::Vector2), 2, VertexAttrFormat_Float, sizeof(UIQuadLayout));
diff --git a/Runtime/Utilities/StaticInitiator.h b/Runtime/Utilities/StaticInitiator.h
index bbcdbee..b7b41aa 100644
--- a/Runtime/Utilities/StaticInitiator.h
+++ b/Runtime/Utilities/StaticInitiator.h
@@ -1,5 +1,8 @@
#pragma once
+//https://stackoverflow.com/questions/1005685/c-static-initialization-order
+//https://stackoverflow.com/questions/211237/static-variables-initialisation-order
+
// ̬캯
#include "ThirdParty/StaticConstructor/include/StaticConstructor.h"
@@ -21,7 +24,7 @@ public:
#define InvokeStaticFunc(func)\
static StaticFuncInvoker staticInvokerOf_##func(func);
-// ʼǰcppľ̬
+// ʼǰcppľ̬Ҫעstaticʼ˳Static Initialization Order
#define InitializeStaticVariables(lambda)\
static StaticFuncInvoker staticInvoker(lambda);