drarem Posted April 18, 2016 Share Posted April 18, 2016 How can I draw to a single texture? I want to assemble an image and rotate the whole image, instead of rotating the individual pieces. Like cards on a table, i want to rotate the table with the cards in 2d without including any other images being displayed. I'm trying out the LED library, seems to work ok but I keep hitting the wall of not being able to rotate the group of images. thanks. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 18, 2016 Share Posted April 18, 2016 The buffer class has what you need. It's not official, so take a look at the headers and ask if you have any questions. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
drarem Posted April 18, 2016 Author Share Posted April 18, 2016 thanks Quote Link to comment Share on other sites More sharing options...
drarem Posted April 18, 2016 Author Share Posted April 18, 2016 Looks like I need to do this, is this the idea? -- get current buffer, set as old buffer -- set context to buffer -- draw stuff on it (image texture, drawrect, etc) -- blit to destination texture -- reset buffer to old buffer Quote Link to comment Share on other sites More sharing options...
shadmar Posted April 18, 2016 Share Posted April 18, 2016 I don't understand what you are trying to do. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted April 18, 2016 Share Posted April 18, 2016 blit to destination texture Just get the color component of the buffer, and that is your texture. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
martyj Posted April 19, 2016 Share Posted April 19, 2016 I believe @Drarem is trying to do 2d game rendering in Leadwerks. Leadwerks isn't really designed for 2d. It could do 2d games, but it would require additional programming on the users end to work with 2d concepts. You're not going to have to worry about double buffering or any of that with leadwerks. The best way to do 2d rendering in leadwerks in the way that you're wanting to is to use this Camera::SetProjectionMode Then to render your objects as a sprite. http://www.leadwerks.com/werkspace/page/api-reference/_/sprite/ Quote Link to comment Share on other sites More sharing options...
drarem Posted April 19, 2016 Author Share Posted April 19, 2016 Are you saying to create a pivot at run-time and then parent it to the sprites, so just rotating the pivot will rotate all the sprites at once around the pivot? Not trying to do 2d rendering, trying to create graphics at run-time on a 2d billboard or plane. It will be part of the initialization process; it wont be rebuilt with game loop. Quote Link to comment Share on other sites More sharing options...
shadmar Posted April 19, 2016 Share Posted April 19, 2016 Is it beacuse of the rotation you want to use buffers? You can rotate 2d textures using a shader and a mat2 rotation matrix with drawimage, but I don't think I get it what it is you want to do Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
drarem Posted April 19, 2016 Author Share Posted April 19, 2016 it would if it rotates the group of drawn 2d textures and not each one individually, as what I'm doing does now. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 19, 2016 Share Posted April 19, 2016 http://www.leadwerks.com/werkspace/page/api-reference/_/context/contextsetrotation-r727 Quote My job is to make tools you love, with the features you want, and performance you can't live without. 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.