1 #ifdef OSG_BUILD_ACTIVE
4 #include <OSGClusterServer.h>
5 #include <OSGGLUTWindow.h>
6 #include <OSGRenderAction.h>
8 #include <OpenSG/OSGGLUT.h>
9 #include <OpenSG/OSGConfig.h>
10 #include <OpenSG/OSGClusterServer.h>
11 #include <OpenSG/OSGGLUTWindow.h>
12 #include <OpenSG/OSGRenderAction.h>
15 OSG::GLUTWindowRecPtr window
;
16 OSG::RenderActionRefPtr ract
;
17 OSG::ClusterServer
*server
;
20 void reshape(int width
, int height
);
22 int main(int argc
,char **argv
)
27 glutInit(&argc
, argv
);
28 glutInitDisplayMode( GLUT_RGB
|GLUT_DEPTH
| GLUT_DOUBLE
);
32 std::cout
<< "No name was given!" << std::endl
;
37 OSG::osgInit(argc
, argv
);
39 winid
= glutCreateWindow(argv
[1]);
40 glutDisplayFunc(display
);
41 glutIdleFunc(display
);
42 glutReshapeFunc(reshape
);
43 glutSetCursor(GLUT_CURSOR_NONE
);
45 ract
= OSG::RenderAction::create();
47 window
= OSG::GLUTWindow::create();
48 window
->setGlutId(winid
);
51 window
->resize(512, 512);
53 //create a new server that will be connected via multicast
54 //argv[1] is the name of the server (at least it should be...)
55 server
= new OSG::ClusterServer(window
, argv
[1], "StreamSock", "");
65 //simply execute the render action
67 //and delete the change list
68 OSG::Thread::getCurrentChangeList()->clear();
71 void reshape(int width
, int height
)
73 window
->resize(width
, height
);