drarem Posted April 14, 2016 Share Posted April 14, 2016 How would I draw an image onto a backbuffer, then render that to current ? Looking at reducing many looped draws to one. Thanks. Quote Link to comment Share on other sites More sharing options...
martyj Posted April 14, 2016 Share Posted April 14, 2016 Are you referring to 2D drawing of double buffering? Since Leadwerks uses OpenGL, you don't have to worry about problems of double buffering on 2d draws I believe. I think leadwerks renders a 2d image by rendering a texture on a quad with a specific Matrix to render it. I don't think leadwerks draws on the actual post rendered OpenGL buffer. To render 2d images with the CPU instead of the GPU would be very CPU intensive comparatively. Since leadwerks loads texture data to the graphics card, you're basically saying "Graphics card, draw image X". To do double buffering you would be passing image buffers to and from the graphics card every render frame which defeats the purposes of OpenGL buffers. Quote Link to comment Share on other sites More sharing options...
drarem Posted April 14, 2016 Author Share Posted April 14, 2016 Ok, I was thinking more about when I put together 2d 'panels' with dynamic and static text, wouldn't a loop drawing on several of those panels impact the performance with every game frame? These panels would be built at run-time and only drawn once each game loop. Quote Link to comment Share on other sites More sharing options...
martyj Posted April 14, 2016 Share Posted April 14, 2016 I don't know about text as I have never done 2d text in OpenGL, but your panels would be sent to the GPU on creation, so multiple draw frames wouldn't really impact performance compared to double buffering. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.