3 Copyright 2007 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Fail.
7 Fail is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Fail is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 module( "document", package
.seeall
)
21 fail
= require( "fail" )
22 gui
= require( "fail.gui.tool" )
23 sg
= require( "fail.scenegraph" )
25 SceneGraph
= fail
.class
27 superclass
= gui
.Document
,
29 function( self
, Title
)
30 gui
.Document
.init( self
, Title
)
33 self
.pScenegraph
= fail
.fbffile
.Reader
.Load( "lulz.fsg" )
36 camera
= sg
.Camera( camframe
)
37 camframe
.LocalToParent
.position
.y
= -7
40 proj
= sg
.PerspectiveProjection()
43 self
.pViewPort
= sg
.ViewPort( proj
, camera
)
44 self
.pViewPort
.Rect
= fail
.math
.Rectu32( 0, 0, 800, 600 )
51 function SceneGraph
:createViewWidget( pParent
)
52 --print("createviewwidget")
53 --return gui.Button( pParent, "fgsfds" )
54 return gui
.RenderView( pParent
, self
.pScenegraph
, self
.pViewPort
)