Urgent bug in renderer

When a window is resized, renderer is broken.

thanks

You need to re-load the textures on a window re-size.
This problem is only seen when using the direct3d renderer, of course.On 25-09-2012 16:29, wahono sri wrote:

When a window is resized, renderer is broken.

thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Pallav Nawani
Game Designer/CEO
http://www.ironcode.com
Twitter: http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming

I got this error when I use SDL_RENDERER_SOFTWARE and
SDL_RENDERER_ACCELERATED, AFAIK SDL_RENDERER_SOFTWARE use GDI for
Windows, right?

I think the problem is the surface of window didn’t resized after
window resized.

ThanksOn 25 September 2012 19:03, Pallav Nawani wrote:

You need to re-load the textures on a window re-size.
This problem is only seen when using the direct3d renderer, of course.

Can you write a test-case that demonstrates the bug?On Tue, Sep 25, 2012 at 10:59 AM, wahono sri wrote:

On 25 September 2012 19:03, Pallav Nawani wrote:

You need to re-load the textures on a window re-size.
This problem is only seen when using the direct3d renderer, of course.

I got this error when I use SDL_RENDERER_SOFTWARE and
SDL_RENDERER_ACCELERATED, AFAIK SDL_RENDERER_SOFTWARE use GDI for
Windows, right?

I think the problem is the surface of window didn’t resized after
window resized.

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I use SDL with FreePascal, but please you run testsprite2 project from
SDL mercurial, and drag window to resize it, and you can see that
window painting will broke.

ThanksOn 25 September 2012 23:01, Alex Barry <alex.barry at gmail.com> wrote:

Can you write a test-case that demonstrates the bug?

By default when the window is resized the renderer will try to re-center
the previous viewport in the new window. I think this is the behavior you
were seeing with testsprite2.

I just fixed it so that when testsprite2 gets a window size change it will
reset it’s viewport to the new window size, so it behaves more like how
you’d expect:

    switch (event->window.event) {
    case SDL_WINDOWEVENT_SIZE_CHANGED:
        {
            SDL_Window *window =

SDL_GetWindowFromID(event->window.windowID);
if (window) {
for (i = 0; i < state->num_windows; ++i) {
if (window == state->windows[i] &&
(state->window_flags & SDL_WINDOW_RESIZABLE)) {
SDL_Rect viewport;

                        viewport.x = 0;
                        viewport.y = 0;
                        SDL_GetWindowSize(window, &viewport.w,

&viewport.h);
SDL_RenderSetViewport(state->renderers[i],
&viewport);
}
}
}
}
break;

Cheers!On Tue, Sep 25, 2012 at 10:29 AM, wahono sri wrote:

On 25 September 2012 23:01, Alex Barry <alex.barry at gmail.com> wrote:

Can you write a test-case that demonstrates the bug?

I use SDL with FreePascal, but please you run testsprite2 project from
SDL mercurial, and drag window to resize it, and you can see that
window painting will broke.

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks Sam, but I test testsprite2 again, and this problem still
exists. After resized the sprites is stopped.
Should we recreate all surface, texture after form resizing?

Thanks

What platform are you running on? I’ve never seen this happen here.On Sun, Sep 30, 2012 at 6:37 AM, wahono sri wrote:

Thanks Sam, but I test testsprite2 again, and this problem still
exists. After resized the sprites is stopped.
Should we recreate all surface, texture after form resizing?

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

What platform are you running on? I’ve never seen this happen here.

Win7 64bit, but I use compiled SDL 32bit (compiled from MSVC 2010 Express).

thanks