Resize window problem

Hello,

I have recently been upgrading a little game of mine to use OpenGL,
instead of just SDL for graphics. I have a function which resizes the
window, by calling SDL_SetVideoMode, but when I use it, each time it
leaks a lot of memory, proportional to the size that I am resizing to.
Why does this happen? Isn’t SDL_SetVideoMode supposed to release the
old screen surface? After resizing the window this way, I reload my
textures and OpenGL attributes and stuff, and there are no memory
leaks there.

Thanks

are you freeing the old textures before you reload them?On 12 May 2010 01:21, Nikola Whallon <alokin.nollahwe at gmail.com> wrote:

After resizing the window this way, I reload my textures and OpenGL
attributes and stuff, and there are no memory leaks there.

Yes. I have tested that code separately too (reinitializing the OpenGL
stuff and textures without resizing the screen), and do not have any
leaks there.On Wed, May 12, 2010 at 3:42 PM, Kenneth Bull wrote:

On 12 May 2010 01:21, Nikola Whallon <@Alokin_Nollahwe> wrote:

After resizing the window this way, I reload my textures and OpenGL
attributes and stuff, and there are no memory leaks there.

are you freeing the old textures before you reload them?


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

Did you try using the display quit, then init again as well?

cheers,On Wed, May 12, 2010 at 9:24 PM, Alokin Nollahwe <alokin.nollahwe at gmail.com>wrote:

Yes. I have tested that code separately too (reinitializing the OpenGL
stuff and textures without resizing the screen), and do not have any
leaks there.

On Wed, May 12, 2010 at 3:42 PM, Kenneth Bull wrote:

On 12 May 2010 01:21, Nikola Whallon <alokin.nollahwe at gmail.com> wrote:

After resizing the window this way, I reload my textures and OpenGL
attributes and stuff, and there are no memory leaks there.

are you freeing the old textures before you reload them?


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

Yes, I run:

SDL_QuitSubSystem(SDL_INIT_VIDEO);
SDL_InitSubSystem(SDL_INIT_VIDEO);
screen = SDL_SetVideoMode(xrez, yrez 16, SDL_OpenGL);

etc

in my resize window function.On Thu, May 13, 2010 at 11:12 AM, Ren? Dudfield wrote:

Did you try using the display quit, then init again as well?
cheers,

On Wed, May 12, 2010 at 9:24 PM, Alokin Nollahwe <@Alokin_Nollahwe> wrote:

Yes. I have tested that code separately too (reinitializing the OpenGL
stuff and textures without resizing the screen), and do not have any
leaks there.

On Wed, May 12, 2010 at 3:42 PM, Kenneth Bull wrote:

On 12 May 2010 01:21, Nikola Whallon <@Alokin_Nollahwe> wrote:

After resizing the window this way, I reload my textures and OpenGL
attributes and stuff, and there are no memory leaks there.

are you freeing the old textures before you reload them?


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


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