Led Shooter

That’s what I need. But how to get stream, that I create in lua, in C?

Something like this. https://github.com/Lerg/extension-openal/blob/master/openal/src/extension.cpp#L53

4 Likes

I don’t understand. How it should work? How to convert dmScript::LuaHBuffer* to dmBuffer::HBuffer

size for dmBuffer::GetStream is(null)

dmScript::LuaHBuffer* buffer = dmScript::CheckBuffer(L, 2);
uint8_t* stream = 0x0;
uint32_t size_ignored = 0;
dmBuffer::Result r = dmBuffer::GetStream((dmBuffer::HBuffer)buffer, dmHashString64("rgb"), (void**)&stream, &size_ignored);

It has property buffer->m_Buffer, which is of type HBuffer.

1 Like

Something like that? It is fall on line dmBuffer::GetStream.

dmScript::LuaHBuffer* buffer = dmScript::CheckBuffer(L, 2);
uint8_t* stream = 0x0;
uint32_t size_ignored = 0;
dmBuffer::HBuffer hBuffer = buffer->m_Buffer;
dmBuffer::Result r = dmBuffer::GetStream(hBuffer, dmHashString64("rgb"), (void**)&stream, &size_ignored);

What error message?

1 Like

no error message =(
2017-12-26_23-25-43

Sometimes there is something useful in that textbox you know.

1 Like

My mistake. It fall on line.

printf("%i",size_ignored);

Thanks for @sergey.lerg. It work realy fast. :+1:

DEBUG:SCRIPT: native: 0.001
DEBUG:SCRIPT: native old: 0.025
DEBUG:SCRIPT: lua:0.038
DEBUG:SCRIPT: native: 0.001
DEBUG:SCRIPT: native old: 0.025
DEBUG:SCRIPT: lua:0.039
DEBUG:SCRIPT: native: 0.002
DEBUG:SCRIPT: native old: 0.025
DEBUG:SCRIPT: lua:0.037
10 Likes