[SDL] Kill Window without SDL_Quit()
Bob Pendleton
bob at pendleton.com
Thu Feb 21 07:49:21 PST 2008
On 2/20/08, Micah Brening <micah.brening at gmail.com> wrote:
>
> Bob Pendleton <bob <at> pendleton.com> writes:
>
> > How many nanoseconds are you saving by doing that? Is the CPU time
> saved by
> this worth anyone enough to make this problem worth the timeneeded to
> solve
> it?Seriously, just get the pointer again when you restart SDL. Or, if that
> just
> isn't possible then waste a few bytes of memory and store the whole table,
> or
> just the parts you need, and keep the copy around for as long as you need
> it.
> > So the request: Kill SDL window without killing SDL. Is it
> possible? How is
> it done? If it isn't possible... It'll be my request for SDL1.3/2.0
> >
> > Why? To save a handful of nanoseconds or a handful of bytes? Anyway, 1.3
> supports multiple windows so the problem would be very different. Bob
> Pendleton
>
> heh, actually, it isn't about saving time. It was a convieniance feature
> FLTK
> offered I was hoping to take advantage of. I guess I could do what you
> said, it
> just seems redundant to do.
Sorry, you hit a bit of a hot button. I teach programming and I have been a
programmer for 35 years. I can't tell you the number of times I have seen
programmers, including myself, tie them selves up in knots trying to avoid
doing something twice in piece of code. It seems to be an instinct in people
who become programmers to want to avoid doing anything twice.
1) initialize fltk window.
> 2) initialize sdl video data.
> 3) initialize drop down box with video data.
> 4) let user do whatever.
> 5) show sdl video
> 6) kill sdl video
>
> My hopes were to then loop back to the fourth procedure, but if I have to
> go all
> the way back to the second, then that is what I'll do.
>
> I could store them too, true. And it would be less redundant.
>
> It doesn't cause any issues to call SDL_Quit, and then reinitialize
> shortly
> after, or after at all, right?
No issue at all.
So, copy and store the data, and Init and Quit SDL as needed.
Yep.
Thanks for the reply! I think I got what I needed.
I'm glad to be of help.
Bob Pendleton
_______________________________________________
> SDL mailing list
> 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/20080221/da7797ba/attachment.htm
More information about the SDL
mailing list