summaryrefslogtreecommitdiff
path: root/Source/modules/asura-core/Graphics/GPUBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/modules/asura-core/Graphics/GPUBuffer.cpp')
-rw-r--r--Source/modules/asura-core/Graphics/GPUBuffer.cpp13
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