diff options
author | chai <chaifix@163.com> | 2019-08-16 08:54:08 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-16 08:54:08 +0800 |
commit | a077eb38b01292611f4f6031b75e3e2c1c20f06e (patch) | |
tree | 8f760483d7b0290952bbdb5bcd8f3943102aeb3a /source/modules/asura-core/Graphics/GPUBuffer.cpp | |
parent | 6a065c913e9308cc72e1ad0723b6167048f439b6 (diff) |
Diffstat (limited to 'source/modules/asura-core/Graphics/GPUBuffer.cpp')
-rw-r--r-- | source/modules/asura-core/Graphics/GPUBuffer.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/modules/asura-core/Graphics/GPUBuffer.cpp b/source/modules/asura-core/Graphics/GPUBuffer.cpp index f28b914..ded4708 100644 --- a/source/modules/asura-core/Graphics/GPUBuffer.cpp +++ b/source/modules/asura-core/Graphics/GPUBuffer.cpp @@ -69,16 +69,16 @@ bool GPUBuffer::Fill(const void * data, size_t size, uint offset) return false; if (m_Buffer == 0) { - g_Device.WipeError(); + g_GfxDevice.WipeError(); glGenBuffers(1, &m_Buffer); if (m_Buffer == 0) throw Exception("OpenGL glGenBuffers failed."); glBindBuffer(m_Target, m_Buffer); glBufferData(m_Target, m_Size, NULL, m_Usage); - if (g_Device.HasError()) + if (g_GfxDevice.HasError()) { glBindBuffer(m_Target, 0); - throw Exception("OpenGL glBufferData failed. Errorcode=%d.", g_Device.GetError()); + throw Exception("OpenGL glBufferData failed. Errorcode=%d.", g_GfxDevice.GetError()); } #if ASURA_DEBUG m_Data = (byte*)malloc(size); @@ -87,11 +87,12 @@ bool GPUBuffer::Fill(const void * data, size_t size, uint offset) } else glBindBuffer(m_Target, m_Buffer); - glBufferSubData(m_Target, offset, size, data); - if (g_Device.HasError()) + //glBufferSubData(m_Target, offset, size, data); + GL_CALL(glBufferSubData, m_Target, offset, size, data); + if (g_GfxDevice.HasError()) { glBindBuffer(m_Target, 0); - throw Exception("OpenGL glBufferSubData failed. Errorcode=%d.", g_Device.GetError()); + throw Exception("OpenGL glBufferSubData failed. Errorcode=%d.", g_GfxDevice.GetError()); } glBindBuffer(m_Target, 0); #if ASURA_DEBUG |