[SDL] iOS Memory Warnings - Small Fix; How To Improve?

Gorm Lai gorm at kotoristudios.com
Wed Mar 27 06:40:55 PDT 2013


Since there was not suggestions for a proper way to handle this. I have cleaned up my fix and attached to this email. 

Basically, I have introduced 

SDL_MEMORY_WARNING as an enum in SDL_events.h, right after SDL_QUIT as I think they kind of belong in the same group together, and have been implemented in a similar way.

Then in in the AppDelegate I have added

- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application 
{
  SDL_Event event;
  event.type = SDL_MEMORY_WARNING;
  SDL_PushEvent(&event);
  
}


And that's it. I hope you will accept my fix or let me know how to refactor it and I will.

I should get to the Android version in a month or two, at which time I can implement the fix for that platform as well.

Cheers,
Gorm



On Thursday, March 14, 2013 at 9:45 PM, Sik the hedgehog wrote:

> Remember that "compatibility with 16-bit Windows-based applications"
> means "you can port code made for 16-bit Windows without having to
> rewrite it". It's for the same reason the unused parameter in WinMain
> exists - even though in modern Windows it's always NULL. WM_COMPACTING
> is most likely never sent at all, ever.
> 
> 2013/3/14, Nathaniel J Fries <nfries88 at yahoo.com (mailto:nfries88 at yahoo.com)>:
> > 
> > Sik wrote:
> > > About WM_COMPACTING:
> > > http://msdn.microsoft.com/en-us/library/windows/desktop/ms632618(v=vs.85).aspx
> > > "Note This message is provided only for compatibility with 16-bit
> > > Windows-based applications."
> > > 
> > > I guess it's useless, especially since I doubt 32-bit Windows ever
> > > compacted memory at all in the first place :P
> > > 
> > 
> > 
> > 
> > I had that feeling myself, but it doesn't really say.
> > 
> > ------------------------
> > Nate Fries
> > 
> 
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org (mailto:SDL at lists.libsdl.org)
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130327/de487e22/attachment-0009.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SDL_events.h
Type: application/octet-stream
Size: 24424 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130327/de487e22/attachment-0018.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SDL_uikitappdelegate.m
Type: application/octet-stream
Size: 9084 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130327/de487e22/attachment-0019.obj>


More information about the SDL mailing list