diff options
author | chai <chaifix@163.com> | 2019-06-06 00:11:18 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-06-06 00:11:18 +0800 |
commit | 88b882ed0b432c6aff2063213e2f793a36dd25f7 (patch) | |
tree | 5fe5d5334050e1a1146aa63e61e88aa2f5170727 /source/modules/asura-core/graphics/gpu_buffer.cpp | |
parent | f6c0498c9728a286c13980ed3b60763d02e1b3a0 (diff) |
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/gpu_buffer.cpp')
-rw-r--r-- | source/modules/asura-core/graphics/gpu_buffer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/modules/asura-core/graphics/gpu_buffer.cpp b/source/modules/asura-core/graphics/gpu_buffer.cpp index e16a4ac..4c84b7e 100644 --- a/source/modules/asura-core/graphics/gpu_buffer.cpp +++ b/source/modules/asura-core/graphics/gpu_buffer.cpp @@ -72,16 +72,16 @@ namespace AsuraEngine if (mBuffer == 0) { // ʼ - gl.WipeError(); + gfx.WipeError(); glGenBuffers(1, &mBuffer); if (mBuffer == 0) throw Exception("OpenGL glGenBuffers failed."); glBindBuffer(mTarget, mBuffer); glBufferData(mTarget, mSize, NULL, mUsage); // ʼСΪsizeĻ壬usageŵӦԴ - if (gl.HasError()) + if (gfx.HasError()) { glBindBuffer(mTarget, 0); - throw Exception("OpenGL glBufferData failed. Errorcode=%d.", gl.GetError()); + throw Exception("OpenGL glBufferData failed. Errorcode=%d.", gfx.GetError()); } #if ASURA_DEBUG mData = (byte*)malloc(size); @@ -91,10 +91,10 @@ namespace AsuraEngine else glBindBuffer(mTarget, mBuffer); glBufferSubData(mTarget, offset, size, data); - if (gl.HasError()) + if (gfx.HasError()) { glBindBuffer(mTarget, 0); - throw Exception("OpenGL glBufferSubData failed. Errorcode=%d.", gl.GetError()); + throw Exception("OpenGL glBufferSubData failed. Errorcode=%d.", gfx.GetError()); } glBindBuffer(mTarget, 0); #if ASURA_DEBUG @@ -108,7 +108,7 @@ namespace AsuraEngine { glBindBuffer(mTarget, mBuffer); } - + void GPUBuffer::UnBind() { glBindBuffer(mTarget, 0); |