Added GPLv3 headers all over the place.
[fail.git] / lua-modules / editor / document.lua
blob3326ff1c53e959b9fc038f4a0aa31789dc6d1dc4
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 f = fail.io.FileInputStream( "lulz.fsg" )
34 print(f)
35 self.pScenegraph = fail.fbf.Reader.Load( f )
36 print(self.pScenegraph)
38 camframe = sg.Frame()
39 camera = sg.Camera( camframe )
40 camframe.LocalToParent.position.y = -7
41 camframe:dirty()
43 proj = sg.PerspectiveProjection()
45 -- Create viewport
46 self.pViewPort = sg.ViewPort( proj, camera )
47 self.pViewPort.Rect = fail.math.Rectu32( 0, 0, 800, 600 )
48 end,
50 pScenegraph = 0,
51 pViewPort = 0
54 function SceneGraph:createViewWidget( pParent )
55 --print("createviewwidget")
56 --return gui.Button( pParent, "fgsfds" )
57 return gui.RenderView( pParent, self.pScenegraph, self.pViewPort )
58 end