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/binding/VertexBuffer.binding.cpp | |
parent | 6a065c913e9308cc72e1ad0723b6167048f439b6 (diff) |
Diffstat (limited to 'Source/modules/asura-core/Graphics/binding/VertexBuffer.binding.cpp')
-rw-r--r-- | Source/modules/asura-core/Graphics/binding/VertexBuffer.binding.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/modules/asura-core/Graphics/binding/VertexBuffer.binding.cpp b/Source/modules/asura-core/Graphics/binding/VertexBuffer.binding.cpp new file mode 100644 index 0000000..8ed487b --- /dev/null +++ b/Source/modules/asura-core/Graphics/binding/VertexBuffer.binding.cpp @@ -0,0 +1,38 @@ +#include "../VertexBuffer.h" + +using namespace std; +using namespace Luax; + +namespace_begin(AsuraEngine) +namespace_begin(Graphics) + + + LUAX_REGISTRY(VertexBuffer) + { + LUAX_REGISTER_METHODS(state, + { "New", _New } + ); + } + + LUAX_POSTPROCESS(VertexBuffer) + { + + } + + // vbo = VertexBuffer.New(usage, data_type, count) + LUAX_IMPL_METHOD(VertexBuffer, _New) + { + LUAX_STATE(L); + + BufferUsage usage = (BufferUsage)state.CheckValue<uint>(1); + BufferDataType datatype = (BufferDataType)state.CheckValue<uint>(2); + uint count = state.CheckValue<uint>(3); + + VertexBuffer* vbo = new VertexBuffer(usage, datatype, count * GPUBuffer::GetDataTypeSize(datatype)); + vbo->PushLuaxUserdata(state); + + return 1; + } + + } +} |