A few simple rendering questions

  1. Is there a way to change the window your renderer is attached to, without destroying/recreating the renderer and every texture associated with it?
  2. If your renderer is initialised with the hardware acceleration flag, will it fall back to software if hardware acceleration is not available? Or will it return an error?
  3. Ditto no.2 for the other renderer initialisation flags?
  1. Not currently, though you are welcome to submit a patch if you have need
    of this.
  2. It will return an error.
  3. Ditto. If you pass -1 to pick any renderer, it will try to find one
    that supports the flags you provide. If none of them match it will return
    an error and you can iterate over the renderers and open a specific one
    yourself.On Wed, Oct 2, 2013 at 5:43 PM, mattbentley wrote:

**

  1. Is there a way to change the window your renderer is attached to,
    without destroying/recreating the renderer and every texture associated
    with it?
  2. If your renderer is initialised with the hardware acceleration flag,
    will it fall back to software if hardware acceleration is not available? Or
    will it return an error?
  3. Ditto no.2 for the other renderer initialisation flags?

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

I’d be curious to know if anybody would know the general (or even
relatively detailed) outlines of implementing that #1 feature - changing
window while keeping context. It’s really a shame windows doesn’t have the
same resize feature as we get for free in Linux. I won’t claim I could
write the patch, but maybe I could contemplate putting together some
essential pieces if I knew where to start.On Thu, Oct 3, 2013 at 2:25 AM, Sam Lantinga wrote:

  1. Not currently, though you are welcome to submit a patch if you have
    need of this.
  2. It will return an error.
  3. Ditto. If you pass -1 to pick any renderer, it will try to find one
    that supports the flags you provide. If none of them match it will return
    an error and you can iterate over the renderers and open a specific one
    yourself.

On Wed, Oct 2, 2013 at 5:43 PM, mattbentley wrote:

**

  1. Is there a way to change the window your renderer is attached to,
    without destroying/recreating the renderer and every texture associated
    with it?
  2. If your renderer is initialised with the hardware acceleration flag,
    will it fall back to software if hardware acceleration is not available? Or
    will it return an error?
  3. Ditto no.2 for the other renderer initialisation flags?

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


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

Sam Lantinga wrote:

  1. Not currently, though you are welcome to submit a patch if you have need of this.

Thanks Sam. I don’t specifically have need of it but it would certainly be useful in general game development from the perspective of wanting to change screen-sizes without quitting/restarting the game.

One more quick question in a similar vein-
does destroying a window automatically deallocate the surface associated with that window? Or should the window surface be freed beforehand?
I’m guessing the answer is yes to the first, but thought I’d double-check!