Hi Carsten,

the patch solved the problem completely!

thanks!

On Tue, Nov 17, 2009 at 4:45 PM, Carsten Neumann <carsten_neum...@gmx.net>wrote:

>        Hello Pablo,
>
>
> Pablo Carneiro Elias wrote:
>
>> I've recently updated our version of OpenSG to the current svn version and
>> we're experiencing a problem when we try to re-open a project (destroy the
>> whole scene
>> and the window and create a new one).
>>
>> The problem occurs right when we call init() method of the PassiveWindow,
>> immediately after re-creating it.
>>
>> Tracking the error lead us to the following call stack:
>>
>>     msvcr80d.dll!strlen(unsigned char * buf=0x0012f9d4)  Line 81    Asm
>>     msvcp80d.dll!std::char_traits<char>::length(const char *
>> _First=0x00000000)  Line 559 + 0x9 bytes    C++
>>
>> msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char>
>>  >::assign(const char * _Ptr=0x00000000)  Line 1080 + 0x9 bytes    C++
>>     OSGSystemD.dll!OSG::Window::setupGL()  Line 1889 + 0x2d bytes    C++
>>     OSGSystemD.dll!OSG::Window::init(boost::function<void
>> __cdecl(void),std::allocator<void> > oFunc={...})  Line 2280 + 0x12 bytes
>>  C++
>>
>
> the backtrace shows that you get NULL back from glGetString(GL_VERSION) on
> line 1889 in OSGWindow.cpp, which most likely means you do not have an
> OpenGL context at that point.
>
>
>  The first time init() is called, everything works fine.. however the
>> problem occurs if we try to re-create the window.
>>
>> To assure ourselves we weren't doing anything wrong, we created a small
>> program based on the simple example of yours (hello01.cpp)
>> that creates a simple scene, and by pressing a key, destroys the window
>> and re-creates it (along with the scene).
>>
>> The exact same error occurs (as listed above by the call stack).
>> The folowing code are the modifications of the example ( hello01.cpp )
>> stated above:
>>
>
> [SNIP - code]
>
> err, that codes uses GLUTWindow? Anyway, switching it to PassiveWindow
> reproduces the bug. The WIN32Window destroys the OpenGL context in its d'tor
> and since PassiveWindow derives from it on windows you not only destroy the
> window, but also the context.
> I've attached a patch that moves the context destruction to the terminate()
> function (should have been there in the first place I think) and overrides
> that function in PassiveWindow to allow the context to outlive the
> PassiveWindow.
>
> @Gerrit: Can you please take a look at the patch if it makes sense? Thanks!
>
>        Cheers,
>                Carsten
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Opensg-users mailing list
> Opensg-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to