Closed jimrthy closed 11 years ago
I'm not sure I see where you're coming from. with-init
seems to me to be a pretty straight-forward solution to starting GLFW. If you are for some reason unsure about the scope of the program that will need to have GLFW initialized, sticking with-init
at your program's entry point should be the solution. This way it shouldn't matter how many windows you want to have, and the structure seems crystal clear to me.
Still, I'm having trouble imagining what it is you created, so I'm curious to have a look. If you want to share the branch that has what you are working on, I can give you my thoughts.
Sometimes (?) I'm a moron. These changes crept in to that last patch, even though I meant to keep them separate.
It was just exporting initialize and terminate.
with-init is almost definitely the right approach in at least 99% of use cases. The more I think about mine (at the moment, that's kicking off windows into a separate thread from the repl), the more convinced I am that it's what I want here, too.
It's just that, for a little while, I thought it would make things a little less complicated to call terminate explicitly. The more I think about it, the more inclined I feel to agree with your original version: people probably don't really want to do this, so making it slightly more painful is probably a good hint that it's a bad idea.
I don't have any sort of real opinion either way. I'd close this now, except for the possibility that rolling those specific changes back out would probably be a slight improvement. Fewer obvious choices for newbs, without actually taking any options away from people who honestly have a valid reason for bypassing with-init.
Ah, yeah, I accepted that patch because it I didn't feel like it complicated the existing code any, so I was fine with it. Of course, there is something to be said for having one clear way of doing things, but I can't say I care enough to roll it back.
So consider this closed. In any case, thanks for your involvement!
I'm not sure about this, but I think I want to take responsibility for doing this myself, rather than wrapping everything inside with-init.
For bigger, more ambitious projects (I'm thinking of multiple transient windows), it seems like this would help make the structure a little less complicated.
Then again, the alternative is just to do what that macro's doing manually, so I don't know whether it's actually worth making the change. It would take more time to discuss the merits than it would to just do it.
I have this done, if you think it's worth adding. If not, I'm more than a little tempted to just roll it back and forget that I ever had the thought.
I'm glad my last patch helped. Your changes were definitely an improvement. Thanks for doing this. It's so much better than the cobbled-together version I was trying.