Hi all,

I again have to ask some questions ;)
I changed the basic example into one which uses "numChannels" windows,
so more than 2 aspects.
Unfortunately, I get a crash during reallocation of aspect storage,
please see the call stack.
Perhaps it is meant to be used differently ..

Thanks a lot,
Christoph

On 12.12.2011 13:26, Gerrit Voß wrote:
> ok, attached a basic version that renders with the two windows. The main
> change is syncing from aspect 0 to aspect 1 between barriers and the
> use of the aspect 1 pointer for the second window.
>
> kind regards
>   gerrit
>

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
#include "OSGGLUT.h"
#include "OSGConfig.h"
#include "OSGSimpleGeometry.h"
#include "OSGGLUTWindow.h"
#include "OSGSimpleSceneManager.h"
#include "OSGSceneFileHandler.h"

#include <OSGImageFileHandler.h>
#include <OSGMatrixUtility.h>
#include <OSGNameAttachment.h>
#include <OSGSceneFileHandler.h>
#include <OSGShaderProgram.h>
#include <OSGShaderProgramChunk.h>
#include <OSGSimpleGeometry.h>
#include <OSGSimpleSceneManager.h>
#include <OSGSkinnedGeometry.h>
#include <OSGSkyBackground.h>
#include <OSGTextureObjChunk.h>
#include <OSGNavigationManager.h>

#include "OSGDrawable.h"
#include "OSGSimpleStatisticsForeground.h"
#include "OSGStatElemTypes.h"
#include "OSGStatCollector.h"
#include "OSGRenderAction.h"
#include "OSGTextureObjChunk.h"
#include "OSGMaterialChunk.h"
#include "OSGSimpleSHLChunk.h"
#include "OSGSolidBackground.h"
#include "OSGPerspectiveCamera.h"
#include "OSGPassiveWindow.h"
#include "OSGSimpleGeometry.h"

OSG::Real32 skySize = 5.0f;
unsigned win_width = 500;
unsigned win_height = 500;

OSG::SimpleSceneManager*   mgr  = NULL;
OSG::RenderAction*         ract = NULL;

bool show = true;
bool bGLFinish = false;

// windows
unsigned winId = 0;
OSG::GLUTWindowRecPtr gwin;

OSG::Thread*       pAppThread   = NULL;
OSG::BarrierRefPtr pSyncBarrier = NULL;

const unsigned numChannels = 2;
OSG::ThreadRefPtr  pDrawThread[numChannels];
// API data for win[]
HDC       hDC [numChannels];            // Private GDI Device Context
HWND      hWnd[numChannels];            // Holds Our Window Handle
HGLRC     hRC [numChannels];
HINSTANCE hInstance;    // Holds The Instance Of The Application
OSG::PassiveWindowRecPtr win[numChannels];

// GLUT redraw the window
void display(void)
{
   // apply changelist to current scenegraph
   OSG::commitChanges();

   pSyncBarrier->enter(numChannels+1);
   pSyncBarrier->enter(numChannels+1);

   OSG::Thread::getCurrent()->getChangeList()->clear();

   //glutSetWindow(winId);
   mgr->redraw();
}

// GLUT react to size changes
void reshape(int w, int h)
{
    glViewport(0, 0, w, h);

    mgr->resize(w,h);
    //glutPostRedisplay();
}

// GLUT react to mouse button presses
void mouse(int button, int state, int x, int y)
{
   if (state) {
        mgr->mouseButtonRelease(button, x, y);
   } else {
        mgr->mouseButtonPress(button, x, y);
   }

   glutPostRedisplay();
}

// GLUT react to mouse motions with pressed buttons
void motion(int x, int y)
{
    mgr->mouseMove(x, y);
    glutPostRedisplay();
}

// GLUT react to keys
void keyboard(unsigned char k, int, int)
{
    switch(k) {
        case 27:
        {
            delete mgr;
            gwin   = NULL;
            //pDrawThread  = NULL;
            for (unsigned i=0; i<numChannels; ++i) {
              win[i]  = NULL;
            }
            delete ract;

            OSG::osgExit();
            exit(0);
        }

        // Output help about the controls
        // - If you add an option, please add it here too.
       case '?':
       case '/':
       case 'h':
       {
          std::cerr << "\nControls:"
                    << "v: Toggle drawing of volumes.\n"
                    << "z: Toggle zwrite on rendering action.\n"
                    << "r: switch to render action.\n"
                    << "t: switch to traversal action.\n"
                    << "n: toggle state sorting on action.\n"
                    << "m: set keygen to 0.\n"
                    << "s: set keygen for shaders.\n"
                    << "g: toggle using gl finish.\n"
                    << "x: toggle stat mode.\n"
                    << std::endl;
       }
       break;

        case 'v':
        {
            mgr->getRenderAction()->setVolumeDrawing(
                !mgr->getRenderAction()->getVolumeDrawing());
            std::cerr << "Volume Drawing: "
                      << (mgr->getRenderAction()->getVolumeDrawing() ?
                          "on":"off")
                      << std::endl;
        }
        break;

        case 'm':
            ract->setKeyGen(0);
            break;

        case 's':
        {
            OSG::UInt32 uiSId = 
                OSG::SimpleSHLChunk  ::getStaticClassId() & 0x000003FF;
            OSG::UInt32 uiTId = 
                OSG::TextureBaseChunk::getStaticClassId() & 0x000003FF;
            OSG::UInt32 uiMId = 
                OSG::MaterialChunk   ::getStaticClassId() & 0x000003FF;


            OSG::UInt32 uiKeyGen = (uiSId) | (uiTId << 10) | (uiMId << 20);

            ract->setKeyGen(uiKeyGen);
        }
        break;

        case 'g':
            bGLFinish = !bGLFinish;
            ract->setUseGLFinish(bGLFinish);
            //act->setUseGLFinish(bGLFinish);
            std::cerr << "Set use gl finish to: " << bGLFinish << std::endl;
            break;
    }
}

// change the geometry created with makePlaneGeo into quad with center origin 
in plane given by (dirx, diry)
// edge length is 2*size
void changePlaneGeo (OSG::GeometryUnrecPtr geo,
                     OSG::Real32 size, 
                     OSG::Pnt3f origin,
                     OSG::Vec3f dirx,
                     OSG::Vec3f diry) 
{
  //geo->removeFromProperties (OSG::Geometry::PositionsIndex);
  //geo->removeFromProperties (OSG::Geometry::NormalsIndex);

    OSG::GeoPnt3fPropertyUnrecPtr  pnts  = OSG::GeoPnt3fProperty ::create();
    OSG::GeoVec3fPropertyUnrecPtr  norms = OSG::GeoVec3fProperty ::create();
    geo->setPositions(pnts);
    geo->setNormals  (norms);

    OSG::GeoPnt3fProperty::StoredFieldType *p  = pnts ->editFieldPtr();
    OSG::GeoVec3fProperty::StoredFieldType *n  = norms->editFieldPtr();

    p->push_back(origin - size*dirx - size*diry);
    p->push_back(origin - size*dirx + size*diry);
    p->push_back(origin + size*dirx - size*diry);
    p->push_back(origin + size*dirx + size*diry);
    OSG::Vec3f normal = dirx.cross(diry);
    n->push_back(normal);
    n->push_back(normal);
    n->push_back(normal);
    n->push_back(normal);
}

// load sky-box imitation; uses 
skyFront.jpg/skyBack.jpg/skyLeft.jpg/skyRight.jpg/skyTop.jpg/skyBottom.jpg
OSG::NodeUnrecPtr loadBackground (void)
{
    OSG::ImageUnrecPtr           imgFront  = 
OSG::ImageFileHandler::the()->read("skyFront.jpg");
    OSG::TextureObjChunkUnrecPtr texFront  = OSG::TextureObjChunk::create();
    texFront->setImage(imgFront);

    OSG::ImageUnrecPtr           imgBack   = 
OSG::ImageFileHandler::the()->read("skyBack.jpg");
    OSG::TextureObjChunkUnrecPtr texBack   = OSG::TextureObjChunk::create();
    texBack->setImage(imgBack);

    OSG::ImageUnrecPtr           imgLeft   = 
OSG::ImageFileHandler::the()->read("skyLeft.jpg");
    OSG::TextureObjChunkUnrecPtr texLeft   = OSG::TextureObjChunk::create();
    texLeft->setImage(imgLeft);

    OSG::ImageUnrecPtr           imgRight  = 
OSG::ImageFileHandler::the()->read("skyRight.jpg");
    OSG::TextureObjChunkUnrecPtr texRight  = OSG::TextureObjChunk::create();
    texRight->setImage(imgRight);

    OSG::ImageUnrecPtr           imgTop    = 
OSG::ImageFileHandler::the()->read("skyTop.jpg");
    OSG::TextureObjChunkUnrecPtr texTop    = OSG::TextureObjChunk::create();
    texTop->setImage(imgTop);

    OSG::ImageUnrecPtr           imgBottom = 
OSG::ImageFileHandler::the()->read("skyBottom.jpg");
    OSG::TextureObjChunkUnrecPtr texBottom = OSG::TextureObjChunk::create();
    texBottom->setImage(imgBottom);

    // create box geometry
    //OSG::GroupUnrecPtr sky = OSG::makeCoredNode<OSG::Group>();
    OSG::GeometryUnrecPtr left =  OSG::makePlaneGeo(2.0f*skySize,
                                              2.0f*skySize,
                                              1, 1);
    OSG::GeometryUnrecPtr right =  OSG::makePlaneGeo(2.0f*skySize,
                                              2.0f*skySize,
                                              1, 1);
    OSG::GeometryUnrecPtr front =  OSG::makePlaneGeo(2.0f*skySize,
                                               2.0f*skySize,
                                               1, 1);
    OSG::GeometryUnrecPtr back =  OSG::makePlaneGeo(2.0f*skySize,
                                              2.0f*skySize,
                                              1, 1);
    OSG::GeometryUnrecPtr top =  OSG::makePlaneGeo(2.0f*skySize,
                                             2.0f*skySize,
                                             1, 1);
    OSG::GeometryUnrecPtr bottom =  OSG::makePlaneGeo(2.0f*skySize,
                                                2.0f*skySize,
                                                1, 1);
    changePlaneGeo(left, skySize, 
                   OSG::Pnt3f(+skySize, 0.0f, 0.0f),
                   OSG::Vec3f(0.0f, -1.0f, 0.0f), OSG::Vec3f(0.0f, 0.0f, 1.0f));
    changePlaneGeo(right, skySize, 
                   OSG::Pnt3f(-skySize, 0.0f, 0.0f),
                   OSG::Vec3f(0.0f, 1.0f, 0.0f), OSG::Vec3f(0.0f, 0.0f, 1.0f));
    changePlaneGeo(front, skySize, 
                   OSG::Pnt3f(0.0f, +skySize, 0.0f),
                   OSG::Vec3f(1.0f, 0.0f, 0.0f), OSG::Vec3f(0.0f, 0.0f, 1.0f));
    changePlaneGeo(back, skySize, 
                   OSG::Pnt3f(0.0f, -skySize, 0.0f),
                   OSG::Vec3f(-1.0f, 0.0f, 0.0f), OSG::Vec3f(0.0f, 0.0f, 1.0f));
    changePlaneGeo(top, skySize, 
                   OSG::Pnt3f(0.0f, 0.0f, +skySize),
                   OSG::Vec3f( 1.0f, 0.0f, 0.0f), OSG::Vec3f(0.0f, -1.0f, 
0.0f));
    changePlaneGeo(bottom, skySize, 
                   OSG::Pnt3f(0.0f, 0.0f, -skySize),
                   OSG::Vec3f(-1.0f, 0.0f, 0.0f), OSG::Vec3f(0.0f, -1.0f, 
0.0f));

    OSG::FieldContainerUnrecPtr mat = OSG::getDefaultMaterial()->shallowCopy();
    OSG::ChunkMaterial*   leftChunk = 
dynamic_cast<OSG::ChunkMaterial*>(mat.get());
    left->setMaterial(leftChunk);
    leftChunk->addChunk(texLeft);
    mat = OSG::getDefaultMaterial()->shallowCopy();
    OSG::ChunkMaterial* rightChunk  = 
dynamic_cast<OSG::ChunkMaterial*>(mat.get());
    right->setMaterial(rightChunk);
    rightChunk->addChunk(texRight);
    mat = OSG::getDefaultMaterial()->shallowCopy();
    OSG::ChunkMaterial* frontChunk  = 
dynamic_cast<OSG::ChunkMaterial*>(mat.get());
    front->setMaterial(frontChunk);
    frontChunk->addChunk(texFront);
    mat = OSG::getDefaultMaterial()->shallowCopy();
    OSG::ChunkMaterial* backChunk   = 
dynamic_cast<OSG::ChunkMaterial*>(mat.get());
    back->setMaterial(backChunk);
    backChunk->addChunk(texBack);
    mat = OSG::getDefaultMaterial()->shallowCopy();
    OSG::ChunkMaterial* topChunk    = 
dynamic_cast<OSG::ChunkMaterial*>(mat.get());
    top->setMaterial(topChunk);
    topChunk->addChunk(texTop);
    mat = OSG::getDefaultMaterial()->shallowCopy();
    OSG::ChunkMaterial* bottomChunk = 
dynamic_cast<OSG::ChunkMaterial*>(mat.get());
    bottom->setMaterial(bottomChunk);
    bottomChunk->addChunk(texBottom);

    OSG::NodeUnrecPtr sky = OSG::makeCoredNode<OSG::Group>();
    sky->addChild(makeNodeFor(left));
    sky->addChild(makeNodeFor(right));
    sky->addChild(makeNodeFor(front));
    sky->addChild(makeNodeFor(back));
    sky->addChild(makeNodeFor(top));
    sky->addChild(makeNodeFor(bottom));

    return sky;
}

void makeCurrent (int w)
{
   if (w < 0) {
      wglMakeCurrent(NULL, NULL);
      return;
   } 
   // make window w>=0 current
   if (!wglMakeCurrent(hDC[w], hRC[w])) {
      FWARNING(("TiledSupport::makeCurrent: Can't Activate GL Context for 
window!\n"));
   }
   //FWARNING(("current DC=%p, current RC=%p\n", wglGetCurrentDC(), 
wglGetCurrentContext()));
}
void swapBuffers (int w)
{
   if (w < 0) {
      return;
   }
   if (!SwapBuffers(hDC[w])) {
      FWARNING(("TiledSupport::swapBuffers: Can't swap buffers for window!\n"));
   }
}
void killGLWindow (int w)
{
   FWARNING(("TiledSupport::killGLWindow\n"));
   if (!wglMakeCurrent(NULL,NULL)) {                                    // Are 
We Able To Release The DC And RC Contexts?
     FWARNING(("TiledSupport::killGLWindow: Release Of DC And RC Failed!\n"));
   }
   if (hRC[w]) {                                                                
                        // Do We Have A Rendering Context?
      if (!wglDeleteContext(hRC[w])) {                                          
// Are We Able To Delete The RC?
        FWARNING(("TiledSupport::killGLWindow: Release Rendering Context 
Failed!\n"));
      }
      hRC[w] = NULL;                                                            
                // Set RC To NULL
   }

   if (hDC[w]) {
      if (!ReleaseDC(hWnd[w], hDC[w])) {                                        
// Are We Able To Release The DC
        FWARNING(("TiledSupport::killGLWindow: Release Device Context 
Failed!\n"));
      }
      hDC[w] = NULL;                                                            
// Set DC To NULL
   }

   if (hWnd[w]) { 
      if (!DestroyWindow(hWnd[w])) {                                    // Are 
We Able To Destroy The Window?
        FWARNING(("TiledSupport::killGLWindow: Could Not Release hWnd!"));
      }
      hWnd[w] = NULL;                                                   // Set 
hWnd To NULL
   }
}

// function executed within the thread
void ThreadProc (void* user)
{
   int id = (int)user; 

   pSyncBarrier->enter(numChannels+1);

   pAppThread->getChangeList()->applyNoClear();

   pSyncBarrier->enter(numChannels+1);

   OSG::commitChanges();

   OSG::PassiveWindow* pLocalWin = 
       OSG::convertToCurrentAspect<OSG::PassiveWindow *>(win[id].get());

   makeCurrent(id);

   while (true) {
       pSyncBarrier->enter(numChannels+1);

       pAppThread->getChangeList()->applyNoClear();

       pSyncBarrier->enter(numChannels+1);

       OSG::commitChanges();
       std::cout << "render " << id << std::endl;

       pLocalWin->render(ract);
       swapBuffers(id);
   }
}

// create OpenGL window
bool createWindows ()
{
   if (hInstance == NULL) { // register window class
     hInstance      = GetModuleHandle(NULL);                    // Grab An 
Instance For Our Window
     WNDCLASS  wc;                                              // Windows 
Class Structure
     wc.style       = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;       // Redraw On 
Size, And Own DC For Window.
     wc.lpfnWndProc   = (WNDPROC)DefWindowProc;                 // WndProc 
Handles Messages
     wc.cbClsExtra    = 0;                                      // No Extra 
Window Data
     wc.cbWndExtra    = 0;                                      // No Extra 
Window Data
     wc.hInstance   = hInstance;                                // Set The 
Instance
     wc.hIcon       = LoadIcon(NULL, IDI_WINLOGO);              // Load The 
Default Icon
     wc.hCursor     = LoadCursor(NULL, IDC_ARROW);              // Load The 
Arrow Pointer
     wc.hbrBackground = NULL;                                   // No 
Background Required For GL
     wc.lpszMenuName  = NULL;                                   // We Don't 
Want A Menu
     wc.lpszClassName = "OpenSG Tile";                          // Set The 
Class Name
     
     if (!RegisterClass(&wc)) { // Attempt To Register The Window Class
       FWARNING(("TiledSupport::createWindows: Failed To Register The Window 
Class!\n"));
       return false;  
     }
   }

   RECT mClientRect;
   mClientRect.left   = 10;
   mClientRect.top    = 10; 
   mClientRect.right  = mClientRect.left + win_width;
   mClientRect.bottom = mClientRect.top  + win_height;

   DWORD dwStyle   = WS_OVERLAPPEDWINDOW;                               // 
Windows Style
   DWORD dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;                // 
Window Extended Style
   //AdjustWindowRectEx(&mClientRect, dwStyle, FALSE, dwExStyle);       // 
Adjust WindowRect To True Size Including Decorations

   // create shared OSG elements
   OSG::SolidBackgroundRecPtr bg = OSG::SolidBackground::create();
   bg->setColor(OSG::Color3f(0.5f, 0.0f, 0.0f));


   // open one window
   for (unsigned i=0; i<numChannels; ++i) {
   FWARNING(("TiledSupport::createWindows: open window\n"));
   // Create The Window
   hWnd[i] = CreateWindowEx(dwExStyle,                  // Extended Style For 
The Window
                            "OpenSG Tile",              // Class Name
                            "Tiles",                    // Window Title
                            dwStyle |                   // Defined Window Style
                            WS_CLIPSIBLINGS |           // Required Window Style
                            WS_CLIPCHILDREN,            // Required Window Style
                            mClientRect.left,
                            mClientRect.top,    // Window Position
                            win_width,          // Calculate Window Width
                            win_height,         // Calculate Window Height
                            NULL,                       // No Parent Window
                            NULL,                       // No Menu
                            hInstance,                  // Instance
                            NULL);
   if (!hWnd[i]) {                      // Pass this-Pointer To WM_CREATE
       killGLWindow(i); // Reset The Display
       FWARNING(("TiledSupport::createWindows: Window Creation Error!\n"));
       return false;    
   }

   ShowWindow(hWnd[i], SW_SHOW); // Show The Window
   //SetForegroundWindow(hWnd); // Slightly Higher Priority
   //ResizeGLScene(width, height); // Set Up Our Perspective GL Screen

   hDC[i] = GetDC(hWnd[i]);
   if (hDC[i] == 0) {                                                   // Did 
We Get A Device Context?
       killGLWindow(i);                                                         
// Reset The Display
       FWARNING(("TiledSupport::createWindows: Can't Create A GL Device 
Context!\n"));
       return false;    
   }

   static PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR),  //  
size of this pfd  
                                        1,                     // version 
number  
                                        PFD_DRAW_TO_WINDOW |   // support 
window  
                                        PFD_SUPPORT_OPENGL |   // support 
OpenGL  
                                        PFD_DOUBLEBUFFER,      // double 
buffered  
                                        PFD_TYPE_RGBA,         // RGBA type  
                                        24,                    // 24-bit color 
depth  
                                        0, 0, 0, 0, 0, 0,      // color bits 
ignored  
                                        0,                     // no alpha 
buffer  
                                        0,                     // shift bit 
ignored  
                                        0,                     // no 
accumulation buffer  
                                        0, 0, 0, 0,            // accum bits 
ignored  
                                        32,                    // 32-bit 
z-buffer      
                                        0,                     // no stencil 
buffer  
                                        0,                     // no auxiliary 
buffer  
                                        PFD_MAIN_PLANE,        // main layer  
                                        0,                     // reserved  
                                        0, 0, 0                // layer masks 
ignored  
   }; 

   GLuint PixelFormat = ChoosePixelFormat(hDC[i], (const 
PIXELFORMATDESCRIPTOR*)&pfd);
   if (PixelFormat == 0) { 
      // Did Windows Find A Matching Pixel Format?
      killGLWindow(i); // Reset The Display
      FWARNING(("TiledSupport::createWindows: Can't Find A Suitable 
PixelFormat!\n"));
      return false;     
   }

   if (!SetPixelFormat(hDC[i], PixelFormat, (const 
PIXELFORMATDESCRIPTOR*)&pfd)) { 
      // Are We Able To Set The Pixel Format?   
      killGLWindow(i); // Reset The Display
      FWARNING(("TiledSupport::createWindows: Can't Set The PixelFormat!\n"));
      return false;     
   }   
   ShowWindow(hWnd[i], SW_SHOW); // Show The Window
   hRC[i] = wglCreateContext(hDC[i]);
   if (hRC[i] == 0) { 
      // Are We Able To Get A Rendering Context?
      killGLWindow(i); // Reset The Display
      FWARNING(("TiledSupport::createWindows: Can't Create A GL Rendering 
Context!\n"));
      return false;     
   }
   makeCurrent(i);

    // create OSG objects
    win[i] = OSG::PassiveWindow::create();
    win[i]->init();
    // very important for the size of viewports
    win[i]->resize(win_width, win_height);

    OSG::CameraUnrecPtr cam  = mgr->getCamera();
    OSG::NodeUnrecPtr   root = mgr->getInternalRoot(); 
    OSG::ViewportRecPtr np = OSG::Viewport::create();
    np->setCamera    (cam);
    np->setRoot      (root);
    np->setSize      (0, 0, 1, 1);
    np->setBackground(bg);
    //np->addForeground(fg);
    win[i]->addPort(np);
    
   }
   makeCurrent(-1);

   // instead start a new thread which runs the loop
   pSyncBarrier = OSG::Barrier::get("sync", 0);
   for (int i=0; i<numChannels; ++i) {
       char name[255]; sprintf(name, "OpenSG %d", i);
       pDrawThread[i] = OSG::Thread ::get(name, 0);
       pDrawThread[i]->runFunction(::ThreadProc, // thread function
                                   i+1,          // aspect id
                                   (LPVOID)i);   // thread argument
   }

}

int main(int argc, char **argv)
{
    OSG::ChangeList::setReadWriteDefault(true);
    OSG::osgInit(argc,argv);
    OSG::preloadSharedObject("OSGImageFileIO;OSGFileIO");
    // GLUT init
    glutInit           (&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);

    glutInitWindowSize (500, 500);
    winId = glutCreateWindow("OpenSG");

    glutReshapeFunc (NULL);
    glutDisplayFunc (display);
    glutIdleFunc    (display);
    glutMouseFunc   (mouse);
    glutMotionFunc  (motion);
    glutKeyboardFunc(keyboard);

    gwin = OSG::GLUTWindow::create();
    gwin->setGlutId(winId);
    gwin->init();
    gwin->resize(500, 500);

    // create the scene
    OSG::NodeUnrecPtr scene = OSG::makeCoredNode<OSG::Group>();

#if 1
    std::cout << "load background" << std::endl;
    OSG::NodeRecPtr box = loadBackground();
    scene->addChild(box);
    std::cout << "done." << std::endl;
#endif
    scene->addChild(OSG::makeTorus(1.0f, 2.0f, 5, 5));

    // create the SimpleSceneManager helper
    mgr = new OSG::SimpleSceneManager;
    // create the window and initial camera/viewport
    mgr->setWindow(gwin );
    // tell the manager what to manage
    mgr->setRoot  (scene);

    // show the whole scene
    mgr->showAll();

    pAppThread = static_cast<OSG::Thread *>(OSG::Thread::getCurrent());

        // create OSG objects
    createWindows();
    ract = OSG::RenderAction::create();
    ract->setVolumeDrawing(true);
    // very important: a context can only be current on one thread
    makeCurrent(-1);

    pSyncBarrier->enter(numChannels+1);
    pSyncBarrier->enter(numChannels+1);

    OSG::Thread::getCurrentChangeList()->clear();

    // GLUT main loop
    glutMainLoop ();

    return 0;
}

        msvcr90.dll!000000006936e376()  
        [Les frames ci-dessous sont peut-être incorrects et/ou manquants, aucun 
symbole chargé pour msvcr90.dll]        
        msvcr90.dll!0000000069368135()  
>       OSGBaseRN.dll!std::_Uninit_copy<OSG::FieldContainer * __ptr64 * 
> __ptr64,OSG::FieldContainer * __ptr64 * 
> __ptr64,std::allocator<OSG::FieldContainer * __ptr64> >(OSG::FieldContainer * 
> * _First=0x0000000003d61460, OSG::FieldContainer * * 
> _Last=0x0000000003c85d18, OSG::FieldContainer * * _Dest=0x0000000003c85d10, 
> std::allocator<OSG::FieldContainer *> & __formal={...}, 
> std::allocator<OSG::FieldContainer *> & __formal={...}, 
> std::allocator<OSG::FieldContainer *> & __formal={...})  Ligne 150       C++
        OSGBaseRN.dll!stdext::unchecked_uninitialized_copy<OSG::FieldContainer 
* __ptr64 * __ptr64,OSG::FieldContainer * __ptr64 * 
__ptr64,std::allocator<OSG::FieldContainer * __ptr64> >(OSG::FieldContainer * * 
_First=0x0000000003d61460, OSG::FieldContainer * * _Last=0x0000000003c85d18, 
OSG::FieldContainer * * _Dest=0x0000000003c85d10, 
std::allocator<OSG::FieldContainer *> & _Al={...})  Ligne 812 C++
        OSGBaseRN.dll!std::_Uninit_move<OSG::FieldContainer * __ptr64 * 
__ptr64,OSG::FieldContainer * __ptr64 * 
__ptr64,std::allocator<OSG::FieldContainer * 
__ptr64>,std::_Undefined_move_tag>(OSG::FieldContainer * * 
_First=0x0000000003d61460, OSG::FieldContainer * * _Last=0x0000000003c85d18, 
OSG::FieldContainer * * _Dest=0x0000000003c85d10, 
std::allocator<OSG::FieldContainer *> & _Al={...}, std::_Undefined_move_tag 
__formal={...}, std::_Undefined_move_tag __formal={...})  Ligne 206  C++
        OSGBaseRN.dll!stdext::_Unchecked_uninitialized_move<OSG::FieldContainer 
* __ptr64 * __ptr64,OSG::FieldContainer * __ptr64 * 
__ptr64,std::allocator<OSG::FieldContainer * __ptr64> >(OSG::FieldContainer * * 
_First=0x0000000003d61460, OSG::FieldContainer * * _Last=0x0000000003c85d18, 
OSG::FieldContainer * * _Dest=0x0000000003c85d10, 
std::allocator<OSG::FieldContainer *> & _Al={...})  Ligne 852        C++
        OSGBaseRN.dll!std::vector<OSG::FieldContainer * 
__ptr64,std::allocator<OSG::FieldContainer * __ptr64> 
>::_Umove<OSG::FieldContainer * __ptr64 * __ptr64>(OSG::FieldContainer * * 
_First=0x0000000003d61460, OSG::FieldContainer * * _Last=0x0000000003c85d18, 
OSG::FieldContainer * * _Ptr=0x0000000003c85d10)  Ligne 1154      C++
        OSGBaseRN.dll!std::vector<OSG::FieldContainer * 
__ptr64,std::allocator<OSG::FieldContainer * __ptr64> 
>::_Insert_n(std::_Vector_const_iterator<OSG::FieldContainer 
*,std::allocator<OSG::FieldContainer *> > _Where=..., unsigned __int64 
_Count=1, OSG::FieldContainer * const & _Val=0x0000000000000000)  Ligne 1183 + 
0x2a octets    C++
        OSGBaseRN.dll!std::vector<OSG::FieldContainer * 
__ptr64,std::allocator<OSG::FieldContainer * __ptr64> >::resize(unsigned 
__int64 _Newsize=2, OSG::FieldContainer * _Val=0x0000000000000000)  Ligne 719 + 
0x81 octets    C++
        OSGBaseRN.dll!OSG::AspectStore::setPtrForAspect(OSG::FieldContainer * 
pContainer=0x0000000003d60e30, const unsigned int uiAspect=1)  Ligne 89   C++
        OSGBaseRN.dll!OSG::FieldContainer::setupAspectStore(OSG::AspectStore * 
pStore=0x0000000003c85c60)  Ligne 359    C++
        OSGBaseRN.dll!OSG::ChangeList::doApply(bool bClear=false)  Ligne 878    
C++
        OSGBaseRN.dll!OSG::ChangeList::applyNoClear()  Ligne 96 C++
        testStatisticsRender.exe!ThreadProc(void * user=0x0000000000000000)  
Ligne 372  C++
        OSGBaseRN.dll!OSG::BaseWinThreadBase::threadFunc(void * 
pThreadArg=0x0000000003cfe048)  Ligne 519       C++
        kernel32.dll!000000007783f33d()         
        ntdll.dll!0000000077972cc1()    
------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to