-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (21 loc) · 694 Bytes
/
main.cpp
File metadata and controls
28 lines (21 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <osg/Geometry>
#include <osg/NodeVisitor>
#include <osg/Node>
#include <osgViewer/Viewer>
#include "FindNamedNode.hpp"
#include "Camera.hpp"
#include "GameController.hpp"
#include "PongGame.hpp"
#include <iostream>
using namespace std;
int main( int argc, char** argv )
{
PongGame* game = new PongGame();
osg::ref_ptr<HUDCamera> hudCamera = new HUDCamera(0, 160, 0, 90);
hudCamera->addChild( game->createGameScene() );
osgViewer::Viewer viewer;
viewer.getCamera()->setClearColor( osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f) );
viewer.addEventHandler( new GameController( hudCamera.get() ) );
viewer.setSceneData( hudCamera.get() );
return viewer.run();
}