Removed all the obsolete parts:
[fail.git] / lua-modules / editor / document.lua
blob7a0c968c0b71c02c890d359cbb70b8fc6731e94e
1 --[[
2 Fail game engine
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/>.
18 --]]
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 )
32 -- Test stuff
33 self.pScenegraph = fail.fbffile.Reader.Load( "lulz.fsg" )
35 camframe = sg.Frame()
36 camera = sg.Camera( camframe )
37 camframe.LocalToParent.position.y = -7
38 camframe:dirty()
40 proj = sg.PerspectiveProjection()
42 -- Create viewport
43 self.pViewPort = sg.ViewPort( proj, camera )
44 self.pViewPort.Rect = fail.math.Rectu32( 0, 0, 800, 600 )
45 end,
47 pScenegraph = 0,
48 pViewPort = 0
51 function SceneGraph:createViewWidget( pParent )
52 --print("createviewwidget")
53 --return gui.Button( pParent, "fgsfds" )
54 return gui.RenderView( pParent, self.pScenegraph, self.pViewPort )
55 end