summaryrefslogtreecommitdiff
path: root/Runtime/Graphics
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-04 12:55:25 +0800
committerchai <chaifix@163.com>2021-11-04 12:55:25 +0800
commitd24f17b88d901b779c81c7434995675eb2a17429 (patch)
treed8f4cfee93d70598ef4b1419316b30acfff0eb04 /Runtime/Graphics
parent94a9a28de16badb75e66a60efca3b01d31cc0fc6 (diff)
- Internal::
Diffstat (limited to 'Runtime/Graphics')
-rw-r--r--Runtime/Graphics/GfxDevice.cpp9
-rw-r--r--Runtime/Graphics/GfxDevice.h13
-rw-r--r--Runtime/Graphics/PolyLine.cpp6
-rw-r--r--Runtime/Graphics/Texture.cpp3
-rw-r--r--Runtime/Graphics/Texture.h3
5 files changed, 19 insertions, 15 deletions
diff --git a/Runtime/Graphics/GfxDevice.cpp b/Runtime/Graphics/GfxDevice.cpp
index 2c740ed..e172756 100644
--- a/Runtime/Graphics/GfxDevice.cpp
+++ b/Runtime/Graphics/GfxDevice.cpp
@@ -1,5 +1,6 @@
#include <vector>
#include "GfxDevice.h"
+#include "Runtime/Math/Math.h"
static bool deviceInited = false;
@@ -94,7 +95,7 @@ void GfxDevice::UnuseShader()
glUseProgram(0);
}
-void GfxDevice::SetUniformVec2(const char* name, Internal::Vector2 vec2)
+void GfxDevice::SetUniformVec2(const char* name, Vector2 vec2)
{
if (!m_Shader)
return;
@@ -102,7 +103,7 @@ void GfxDevice::SetUniformVec2(const char* name, Internal::Vector2 vec2)
glUniform2f(loc, vec2.x, vec2.y);
}
-void GfxDevice::SetUniformVec3(const char* name, Internal::Vector3 vec3)
+void GfxDevice::SetUniformVec3(const char* name, Vector3 vec3)
{
if (!m_Shader)
return;
@@ -110,7 +111,7 @@ void GfxDevice::SetUniformVec3(const char* name, Internal::Vector3 vec3)
glUniform3f(loc, vec3.x, vec3.y, vec3.z);
}
-void GfxDevice::SetUniformVec4(const char* name, Internal::Vector4 vec4)
+void GfxDevice::SetUniformVec4(const char* name, Vector4 vec4)
{
if (!m_Shader)
return;
@@ -118,7 +119,7 @@ void GfxDevice::SetUniformVec4(const char* name, Internal::Vector4 vec4)
glUniform4f(loc, vec4.x, vec4.y, vec4.z, vec4.w);
}
-void GfxDevice::SetUniformMat4(const char* name, Internal::Matrix44 mat4)
+void GfxDevice::SetUniformMat4(const char* name, Matrix44 mat4)
{
if (!m_Shader)
return;
diff --git a/Runtime/Graphics/GfxDevice.h b/Runtime/Graphics/GfxDevice.h
index 437696a..f00a58f 100644
--- a/Runtime/Graphics/GfxDevice.h
+++ b/Runtime/Graphics/GfxDevice.h
@@ -1,5 +1,6 @@
#ifndef DEVICE_H
#define DEVICE_H
+#include "Runtime/Math/Math.h"
#include "../Utilities/NonCopyable.h"
#include "../Utilities/Type.h"
@@ -63,10 +64,10 @@ public:
void UseShader(LuaBind::State& state, Shader* shader, int idx);
void UnuseShader();
- void SetUniformVec2(const char* name, Internal::Vector2 vec2);
- void SetUniformVec3(const char* name, Internal::Vector3 vec3);
- void SetUniformVec4(const char* name, Internal::Vector4 vec4);
- void SetUniformMat4(const char* name, Internal::Matrix44 mat4);
+ void SetUniformVec2(const char* name, Vector2 vec2);
+ void SetUniformVec3(const char* name, Vector3 vec3);
+ void SetUniformVec4(const char* name, Vector4 vec4);
+ void SetUniformMat4(const char* name, Matrix44 mat4);
void SetUniformTexture(const char* name, Texture* texture);
void ResetUniformsState();
@@ -79,7 +80,7 @@ public:
DynamicVertexBuffer* GetSharedVBO() { return &m_DynamicVBO; }
- GET_SET(Internal::Color, ClearColor, m_ClearColor);
+ GET_SET(Color, ClearColor, m_ClearColor);
GET_SET(ETextureFilterMode, DefaultFilterMode, m_DefaultFilterMode);
GET_SET(ETextureWrapMode, DefaultWrapMode, m_DefaultWrapMode);
@@ -88,7 +89,7 @@ private:
// äÖȾ״̬
uint m_EnableFlag;
- Internal::Color m_ClearColor;
+ Color m_ClearColor;
EDepthTest m_DepthTest;
EStencilTest m_StencilTest;
EStencilOp m_StencilOp;
diff --git a/Runtime/Graphics/PolyLine.cpp b/Runtime/Graphics/PolyLine.cpp
index 24686f9..279a493 100644
--- a/Runtime/Graphics/PolyLine.cpp
+++ b/Runtime/Graphics/PolyLine.cpp
@@ -1,9 +1,9 @@
#include "PolyLine.h"
-#include "../Math/Vector3.h"
#include "Color.h"
+#include "Runtime/Math/Math.h"
struct PolyLineVBOLayout
{
- Internal::Vector3 position;
- Internal::Color32 color;
+ Vector3 position;
+ Color32 color;
};
diff --git a/Runtime/Graphics/Texture.cpp b/Runtime/Graphics/Texture.cpp
index 0cabd07..19042e9 100644
--- a/Runtime/Graphics/Texture.cpp
+++ b/Runtime/Graphics/Texture.cpp
@@ -1,5 +1,6 @@
#include "ImageData.h"
#include "Texture.h"
+#include "Runtime/Math/Math.h"
using namespace LuaBind;
@@ -196,7 +197,7 @@ Texture::~Texture()
glDeleteTextures(1, &m_GPUID);
}
-void Texture::UpdateSubImage(Internal::Rect rect, int format, int type, const void* data)
+void Texture::UpdateSubImage(Rect rect, int format, int type, const void* data)
{
glBindTexture(GL_TEXTURE_2D, m_GPUID);
diff --git a/Runtime/Graphics/Texture.h b/Runtime/Graphics/Texture.h
index 9633db5..5c23fd7 100644
--- a/Runtime/Graphics/Texture.h
+++ b/Runtime/Graphics/Texture.h
@@ -4,6 +4,7 @@
#include "Runtime/Lua/LuaHelper.h"
#include "../Utilities/UtilMacros.h"
#include "OpenGL.h"
+#include "Runtime/Math/Math.h"
class ImageData;
@@ -66,7 +67,7 @@ public:
Texture(LuaBind::VM* vm, TextureSetting setting, ImageData* imgData)/*throw TextureException*/;
~Texture();
- void UpdateSubImage(Internal::Rect rect, int format, int type, const void* data);
+ void UpdateSubImage(Rect rect, int format, int type, const void* data);
GET(int, Width, m_Width);
GET(int, Height, m_Height);