Hello there, I'm new to the forums, but by no means I'm new to Lua and Love2D!
So okay, I'm rendering a table with RGB data, but doing so with the CPU, how can I render it faster for more FPS. THANKS!
main.lua file is here: https://github.com/lauriszz123/LuaOS/bl ... r/main.lua
Need Help with faster Rendering
Re: Need Help with faster Rendering
So as far I understand your draw routine it looks like you're trying to draw every single pixel on the screen as a draw point instruction. This is a really slow approach to try to render things. So to help you we would need to know what you really want to try to achieve.
Re: Need Help with faster Rendering
ImageData is your friend, in this case. Rather than having the gfx table, store the graphics data in an ImageData object. It has ImageData:setPixel and ImageData:getPixel methods; however, maybe it's faster to use its :getPointer() method to access it through FFI.
Then, have an Image object with the same dimensions ready for drawing. In the draw callback, use (Image):replacePixels to transfer the ImageData to the Image, and draw the Image.
Then, have an Image object with the same dimensions ready for drawing. In the draw callback, use (Image):replacePixels to transfer the ImageData to the Image, and draw the Image.
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 1 guest