| SDL_RenderClear not clearing entire render target |
|
Dark_Oppressor
|
I've posted a video showing what I'm talking about here: http://www.youtube.com/watch?v=v7Np5S3Bgj0
The game is a 2D top-down affair, and the animated texture I'm making is falling raindrops. The game world is divided into "chunks" of 1024x1024 pixels, and weather occurs at this resolution, so my 1024x1024 rain texture is rendered over any chunk in which it is raining. As you can see, the bottom section of the texture quickly fills with raindrop color and is never cleared. |
|||||||||||
|
|
||||||||||||
|
Dark_Oppressor
|
I just did some more tests, and 'SDL_RenderFillRect(main_window.renderer,NULL)' DOES fill the entire texture with color. Unfortunately, you cannot erase color, only cover it with new color, so this won't work for me.
|
|||||||||||
|
|
||||||||||||
|
Dark_Oppressor
|
I just thought to try 'SDL_SetHint(SDL_HINT_RENDER_DRIVER,"opengl")' as SDL was defaulting to direct3d. That fixed the problem! So that narrows it down a bit more if someone wants to try to figure out what's going on here.
|
|||||||||||
|
|
||||||||||||
| SDL_RenderClear not clearing entire render target |
|
Joseph Carter
|
Try:
SDL_SetRenderTarget(main_window.renderer,texture); SDL_SetRenderDrawColor(main_window.renderer,0,0,0,255); SDL_RenderClear(main_window.renderer); See if that does what you want. Joseph On Thu, Oct 17, 2013 at 11:35:33PM +0000, Dark_Oppressor wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|
|
||||||||||||||||
| Re: SDL_RenderClear not clearing entire render target |
|
Dark_Oppressor
|
That won't help in my situation because I need the texture to be cleared to transparency. I did try that though, and it doesn't help. The top 3/4s of the texture are cleared to black and the bottom remains uncleared. I've just reported both this and another (apparently related) issue I've been having. Both of them were solved by switching to the opengl render driver. You can see them here: https://bugzilla.libsdl.org/show_bug.cgi?id=2160 https://bugzilla.libsdl.org/show_bug.cgi?id=2162 |
|||||||||||||||
|
|
||||||||||||||||

