Thanks for the reply. Yes, i tried it with this results:

If i call viewer.frame() from the WM_PAINT that's what happens:
 - main Window.WndProc:
    case WM_PAINT, call viewer.frame()
     - in Viewer::frame( double simulationTime)
                  call Viewer::advance. OK.
                  -call Viewer::eventTraversal, in this function:
                           - it iterates the GrapchisContexts, for the
first context (which is GraphicsWindowWin32) it calls gw->checkEvents.
                                   checkEvents have a messageloop, and call
TranslateMessage and DispatchMessage.
                                   DispatchMessage  take me again to my
WndProc.

  The result is one pretty nonresponsive window with no content rendered at
all.

 I don't have any idea where the problem could be. I tried to look at the
source of the osgWin32demo example, but the link is broken. Are there any
minimal example about how to control the window creation, make OSG use it
for render, and controlling the render cycle? Haven't found any yet. The MFC
example (OSGMFC in examples directory) makes a good job, but another one
without MFC, only pure Win32 will be helpful to me (the MFC example renders
within a thread calling viewer.run or the equivalent loop). I will be glad
to share my test scenario with the community if it can help anyone starting
with OSG, but first i need to finish it..

Again, thanks a lot for the reply, it makes me not feeling alone (joke
pretended..)

2007/6/19, Serge Lages <[EMAIL PROTECTED]>:

Hi Himar,

On 6/19/07, Himar Carmona <[EMAIL PROTECTED]> wrote:
>
> hello all,
>
>     does anybody know how can i render only when its needed?
>
>      I'm constructing  a visualization system, and i use OSG 2.0release. The 
application will be a WPF one, and i want to integrate a viewer
> into the main window. I have achieved render with it into my own window (i
> followed the example about MFC, is it the best method or are there other
> methods?), but i just can't use viewer.run, because the main loop will
> be anywhere else. I just need to render the view on a WM_PAINT basis, only
> when needed, but when i called viewer.frame from my WndProc on paint
> message it just call WndProc again (from eventsTraversal). I haven't found
> yet any clues about how to resolve this.
>

viewer.frame() is the best way to only render one frame, and it should
work well. Have you tried to go step by step to follow what's happening when
you call it ?


        Using the source helps, but i'm lacking on a high-level
> description of what's going on (i'm new to OSG) and i haven't found any
> description about the render loop or the frame cycle or whatever else. (i
> read the GettingStartedGuide). I think i have a misconception about how OSG
> works and a lot of confusion.
>
>      Any ideas how to do this or where to found information about will
> be appreciated.
>
> Thanks everybody, have a nice day and bugfree programs.
> Himar
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>



--
Serge Lages
http://www.magrathea-engine.org
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to