Hi Paul,
On Wed, Nov 11, 2009 at 4:43 PM, Paul Martz <[email protected]> wrote:
> Hm. You have made several other changes to GL3-specific code without being
> able to test it, why not this as well?
The code changes I made were to paths that are compiled under other GL
targets, so the risk is much lower. This is one of the key reasons
why I strive to avoid having separate code paths - because with them I
and others can't test easily targets we don't have.
In the case of GraphicsWindowWin32.cpp I have now way to test it, so
the risk of breaking the build is much higher.
> Are you saying you want me to do an update and fix GraphicsWindowWin32.cpp
> so that it works with your rewrite of my submission? If so, please let me
> know and I'll take a look at it.
Yes, could you update your changes to GraphicsWindowWin32.cpp.
>
>> I also have query about one of the
>>
>> changes to GraphicsWindowWin32.cpp, could you explain why you removed
>> the ResotreContext code block from bool
>> GraphicsWindowWin32::realizeImplementation():
>>
>> struct RestoreContext
>> {
>> RestoreContext()
>> {
>> _hdc = wglGetCurrentDC();
>> _hglrc = wglGetCurrentContext();
>> }
>> ~RestoreContext()
>> {
>> if (_hdc)
>> {
>> wglMakeCurrent(_hdc,_hglrc);
>> }
>> }
>> protected:
>> HDC _hdc;
>> HGLRC _hglrc;
>> } restoreContext;
>>
>>
>> The reason why I'm perplexed by the removal of this code is that there
>> must have been a reason for the code in the first place, it seems odd
>> that this reason has just disappeared. I don't have any expertise or
>> experience with the GraphicsWindowWin32 so I have defer to experts
>> like yourself.
>>
>> Thanks for any clarification you can provide.
>
> I removed this struct definition because I could not see that it was used
> anywhere. It was essentially dead code that was decreasing the readability
> of the context creation.
Actually I don't believe the code is dead at all. From my
understanding of reading the code it will declare a local structure
called restoreContext in the local scope and when the scope closed
it'll clean up after itself. This resource clean up trick is used by
help templates like OpenThreads::ScopeLock.
I'm I reading this correctly?
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org