Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - CrimsonLaceStudio

Pages: [1]
1
C / Backbuffer capture or multiple sprite copy to texture, CSFML 2.5.0
« on: October 18, 2022, 04:12:21 pm »
So what I need to do is either capture the backbuffer to a sprite or find a way to render an entire scene's worth of sprites to another texture so I can utilize that... basically, I need to be able to capture the current frame and utilize it as a sprite. I have been pulling out my non-existant hair for 8 hours now trying to figure out a way to do this and I got nothin'. Everything I have tried either doesn't work or gives me incorrect results. For example, I've tried using sfRenderWindow_capture, which would actually make the most sense, and it returns the total window size (my window at present is 1592x896, which is what the capture grabs, but I only need the backbuffer size of 398x224), which isn't what I need... and then sfTexture_updateFromRenderWindow doesn't even work at all, despite there being a code example in the header. I can't see any functions to copy sprites from one texture to another, and the Image header is of no help either. The reason for all of this? Well, I want to capture the current frame to a sprite so I can create a transition from one scene to the next... basically, I capture the current frame and use it as a fading overlay as the next scene is displaying. I hope that all makes sense. I don't care how expensive a process it is, since it only has to be done once, even if it's just manually copying pixels (which I also don't see any way to do). The header descriptions.... aren't the best, unfortunately. I have read about RenderTexture a bit, and I figured maybe I could just do a second draw of all my sprites to that, but then how do I even utilize the RenderTexture? I see nothing outside of just sfRenderTexture_display, which doesn't look like it will work very well, since I see no options for setting its opacity. What am I missing? Am I a total dunce? I'm really stumped here, and that ain't easy. Any ideas? Thanks a billion in advance. :D

Pages: [1]