From be6c7a9c3f8189758f691da796531486f19b0acb Mon Sep 17 00:00:00 2001 From: uotbw Date: Sun, 25 May 2014 21:25:12 +0200 Subject: [PATCH 01/28] started with version 0.4, beautified data module, api, included scheme --- Bindings-HBind-Source/Ogre/Ogre.cfg | 2 +- Data/HGamer3D-Data.cabal | 4 +- Data/HGamer3D/Data.hs | 10 +- Data/HGamer3D/Data/Colour.hs | 47 +- .../Data/{ScreenGeometry.hs => Geometry2D.hs} | 37 +- Data/HGamer3D/Data/Operation3D.hs | 101 --- Data/HGamer3D/Data/Transform3D.hs | 102 +++ Data/HGamer3D/Data/Vector.hs | 33 +- Data/HGamer3D/Data/Window.hs | 32 + Examples/Graphics3D/BlueCube.hs | 15 +- Graphics3D/HGamer3D-Graphics3D.cabal | 6 +- Graphics3D/HGamer3D/Graphics3D.hs | 64 +- .../Graphics3D/{Engine.hs => Base.hs} | 197 +++++- Graphics3D/HGamer3D/Graphics3D/Basic3D.hs | 129 ---- Graphics3D/HGamer3D/Graphics3D/Light.hs | 22 +- .../{PlatonObjects.hs => PlatonShapes.hs} | 10 +- .../Graphics3D/{Object3D.hs => Shapes.hs} | 642 ++++++++---------- Graphics3D/HGamer3D/Graphics3D/Types.hs | 84 --- Graphics3D/SConstruct | 1 + Scheme/HGamer3D-Scheme.cabal | 33 + Scheme/HGamer3D/Scheme/Camera.hs | 45 ++ Scheme/HGamer3D/Scheme/Colour.hs | 34 + Scheme/HGamer3D/Scheme/Geometry.hs | 62 ++ Scheme/HGamer3D/Scheme/Light.hs | 47 ++ Scheme/HGamer3D/Scheme/Material.hs | 40 ++ Scheme/HGamer3D/Scheme/Node.hs | 67 ++ Scheme/HGamer3D/Scheme/Parser.hs | 447 ++++++++++++ Scheme/HGamer3D/Scheme/Scene.hs | 47 ++ Scheme/HGamer3D/Scheme/Texture.hs | 39 ++ Scheme/LICENSE | 34 + Scheme/SConstruct | 31 + Scheme/Setup.hs | 22 + 32 files changed, 1739 insertions(+), 747 deletions(-) rename Data/HGamer3D/Data/{ScreenGeometry.hs => Geometry2D.hs} (71%) delete mode 100644 Data/HGamer3D/Data/Operation3D.hs create mode 100644 Data/HGamer3D/Data/Transform3D.hs create mode 100644 Data/HGamer3D/Data/Window.hs rename Graphics3D/HGamer3D/Graphics3D/{Engine.hs => Base.hs} (55%) delete mode 100644 Graphics3D/HGamer3D/Graphics3D/Basic3D.hs rename Graphics3D/HGamer3D/Graphics3D/{PlatonObjects.hs => PlatonShapes.hs} (96%) rename Graphics3D/HGamer3D/Graphics3D/{Object3D.hs => Shapes.hs} (88%) delete mode 100644 Graphics3D/HGamer3D/Graphics3D/Types.hs create mode 100644 Scheme/HGamer3D-Scheme.cabal create mode 100644 Scheme/HGamer3D/Scheme/Camera.hs create mode 100644 Scheme/HGamer3D/Scheme/Colour.hs create mode 100644 Scheme/HGamer3D/Scheme/Geometry.hs create mode 100644 Scheme/HGamer3D/Scheme/Light.hs create mode 100644 Scheme/HGamer3D/Scheme/Material.hs create mode 100644 Scheme/HGamer3D/Scheme/Node.hs create mode 100644 Scheme/HGamer3D/Scheme/Parser.hs create mode 100644 Scheme/HGamer3D/Scheme/Scene.hs create mode 100644 Scheme/HGamer3D/Scheme/Texture.hs create mode 100644 Scheme/LICENSE create mode 100644 Scheme/SConstruct create mode 100644 Scheme/Setup.hs diff --git a/Bindings-HBind-Source/Ogre/Ogre.cfg b/Bindings-HBind-Source/Ogre/Ogre.cfg index 20b4c18..f8aa111 100644 --- a/Bindings-HBind-Source/Ogre/Ogre.cfg +++ b/Bindings-HBind-Source/Ogre/Ogre.cfg @@ -1468,7 +1468,7 @@ items: \ of Ogre \nfunctionality, but only to support what is needed for the\nHGamer3D-Graphics3D\ \ package.", !!python/unicode 'base >= 3 && < 5, transformers>=0.3.0,mtl, HGamer3D-Data >= 0.3.0', !!python/unicode 'http://www.hgamer3d.org', !!python/unicode 'Game - Engine, Graphics', !!python/unicode '0.3.2'] + Engine, Graphics', !!python/unicode '0.4.0'] /config/namespaces: - class: Namespace values: [!!python/unicode 'namespace Ogre'] diff --git a/Data/HGamer3D-Data.cabal b/Data/HGamer3D-Data.cabal index 851c419..cef4e34 100644 --- a/Data/HGamer3D-Data.cabal +++ b/Data/HGamer3D-Data.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-Data -Version: 0.3.1 +Version: 0.4.0 Synopsis: Game Engine for the Haskell Programmer - Data Definitions and Utilities Description: HGamer3D is a game engine for developing 3D games in the programming @@ -19,7 +19,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, FindBin, directory, filepath, vect - Exposed-modules: HGamer3D.Data.Vector,HGamer3D.Data.Vector.Instances,HGamer3D.Data.Colour,HGamer3D.Data.HG3DClass,HGamer3D.Data.Angle,HGamer3D.Data.TimeMS,HGamer3D.Data.Operation3D,HGamer3D.Data.ScreenGeometry,HGamer3D.Util.FileLocation, HGamer3D.Util.UniqueName, HGamer3D.Data, HGamer3D.Util + Exposed-modules: HGamer3D.Data.Vector,HGamer3D.Data.Vector.Instances,HGamer3D.Data.Colour,HGamer3D.Data.HG3DClass,HGamer3D.Data.Angle,HGamer3D.Data.TimeMS,HGamer3D.Data.Transform3D,HGamer3D.Data.Geometry2D,HGamer3D.Data.Window,HGamer3D.Util.FileLocation, HGamer3D.Util.UniqueName, HGamer3D.Data, HGamer3D.Util Other-modules: c-sources: diff --git a/Data/HGamer3D/Data.hs b/Data/HGamer3D/Data.hs index 75ea5aa..c31c891 100644 --- a/Data/HGamer3D/Data.hs +++ b/Data/HGamer3D/Data.hs @@ -26,10 +26,11 @@ module HGamer3D.Data module HGamer3D.Data.HG3DClass, module HGamer3D.Data.Angle, module HGamer3D.Data.Colour, - module HGamer3D.Data.Operation3D, + module HGamer3D.Data.Transform3D, module HGamer3D.Data.TimeMS, module HGamer3D.Data.Vector, - module HGamer3D.Data.ScreenGeometry + module HGamer3D.Data.Geometry2D, + module HGamer3D.Data.Window ) where @@ -37,8 +38,9 @@ where import HGamer3D.Data.HG3DClass import HGamer3D.Data.Angle import HGamer3D.Data.Colour -import HGamer3D.Data.Operation3D +import HGamer3D.Data.Transform3D import HGamer3D.Data.TimeMS import HGamer3D.Data.Vector -import HGamer3D.Data.ScreenGeometry +import HGamer3D.Data.Geometry2D +import HGamer3D.Data.Window diff --git a/Data/HGamer3D/Data/Colour.hs b/Data/HGamer3D/Data/Colour.hs index 3f56855..61ce52d 100644 --- a/Data/HGamer3D/Data/Colour.hs +++ b/Data/HGamer3D/Data/Colour.hs @@ -18,18 +18,55 @@ -- ColourValue.hs --- | HGamer3D colour type +-- | Module providing the Colour type and some standard colours module HGamer3D.Data.Colour ( Colour (Colour, cRed, cGreen, cBlue, cAlpha), + white, + silver, + grey, + black, + red, + maroon, + yellow, + olive, + lime, + green, + aqua, + teal, + blue, + navy, + fuchsia, + purple ) where + +-- | HGamer3D colour type data Colour = Colour { - cRed :: Float, - cGreen :: Float, - cBlue :: Float, - cAlpha :: Float + cRed :: Float, -- ^ red component ranging from 0.0 to 1.0 + cGreen :: Float, -- ^ green component ranging from 0.0 to 1.0 + cBlue :: Float, -- ^ blue component ranging from 0.0 to 1.0 + cAlpha :: Float -- ^ alpha component ranging from 0.0 to 1.0 with 1.0 being fully opaque } deriving (Eq, Show) +white = Colour 1.0 1.0 1.0 1.0 +silver = Colour 0.75 0.75 0.75 1.0 +grey = Colour 0.5 0.5 0.5 1.0 +black = Colour 0.0 0.0 0.0 1.0 +red = Colour 1.0 0.0 0.0 1.0 +maroon = Colour 0.5 0.0 0.0 1.0 +yellow = Colour 1.0 1.0 0.0 1.0 +olive = Colour 0.5 0.5 0.0 1.0 +lime = Colour 0.0 1.0 0.0 1.0 +green = Colour 0.0 0.5 0.0 1.0 +aqua = Colour 0.0 1.0 1.0 1.0 +teal = Colour 0.0 0.5 0.5 1.0 +blue = Colour 0.0 0.0 1.0 1.0 +navy = Colour 0.0 0.0 0.5 1.0 +fuchsia = Colour 1.0 0.0 1.0 1.0 +purple = Colour 0.5 0.0 0.5 1.0 + + + diff --git a/Data/HGamer3D/Data/ScreenGeometry.hs b/Data/HGamer3D/Data/Geometry2D.hs similarity index 71% rename from Data/HGamer3D/Data/ScreenGeometry.hs rename to Data/HGamer3D/Data/Geometry2D.hs index ec5fb3c..a017387 100644 --- a/Data/HGamer3D/Data/ScreenGeometry.hs +++ b/Data/HGamer3D/Data/Geometry2D.hs @@ -18,12 +18,9 @@ -- Rectangle.hs --- | Type definitions for 2D geometry and windows -module HGamer3D.Data.ScreenGeometry +-- | Type definitions for 2D geometry +module HGamer3D.Data.Geometry2D ( - -- * Windowing - Window (..), - -- * Geometry Point (..), Rectangle (..), @@ -32,13 +29,13 @@ module HGamer3D.Data.ScreenGeometry ) where --- | A window is simply represented by it's window id, an unsigned C int -data Window = Window Int +import HGamer3D.Data.Vector -- | A point has two coordinates an x and y one data Point = Point { - ptX::Int, - ptY::Int } deriving (Eq, Show) + ptX :: Int, + ptY :: Int + } -- | A rectangle has an a position as x and y and widht and height data Rectangle = Rectangle { @@ -49,19 +46,19 @@ data Rectangle = Rectangle { -- | derive a rectangle from upper left and lower right points rectFromPoints :: Point -> Point -> Rectangle -rectFromPoints upperLeft lowerRight = Rectangle x y w h where - x = ptX upperLeft - y = ptY upperLeft - w = (ptX lowerRight) - x - h = (ptY lowerRight) - y +rectFromPoints upperLeft lowerRight = Rectangle rx ry rw rh where + rx = ptX upperLeft + ry = ptY upperLeft + rw = (ptY lowerRight) - rx + rh = (ptY lowerRight) - ry -- | get upper left and lower right point from a rect pointsFromRect :: Rectangle -> (Point, Point) pointsFromRect rect = (ul, lr) where - x = rectX rect - y = rectY rect - x' = x + (rectWidth rect) - y' = y + (rectHeight rect) - ul = Point x y - lr = Point x' y' + rx = rectX rect + ry = rectY rect + rx' = rx + (rectWidth rect) + ry' = ry + (rectHeight rect) + ul = Point rx ry + lr = Point rx' ry' diff --git a/Data/HGamer3D/Data/Operation3D.hs b/Data/HGamer3D/Data/Operation3D.hs deleted file mode 100644 index ae58927..0000000 --- a/Data/HGamer3D/Data/Operation3D.hs +++ /dev/null @@ -1,101 +0,0 @@ --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Operation3D.hs - --- | Typeclasses for basic 3D operations -module HGamer3D.Data.Operation3D -( - -- * Types - Position3D (..), - Scale3D (..), - Direction3D (..), - Orientation3D (..), - - -- * Functions - translate3D, - yaw3D, - pitch3D, - roll3D -) - -where - -import HGamer3D.Data.Vector -import HGamer3D.Data.Angle - --- | a type with a Position3D instance can be positioned -class Position3D t where - - -- | get position function - position3D :: t -> IO Vec3 - -- | set position function - positionTo3D :: t -> Vec3 -> IO () - --- | move position function -translate3D :: Position3D t => t -> Vec3 -> IO () -translate3D t v = do - p <- position3D t - positionTo3D t ( v &+ p ) - return () - --- | a type with a Scale3D instance can be scaled -class Scale3D t where - - -- | get scale function - scale3D :: t -> IO Vec3 - -- | set scale function - scaleTo3D :: t -> Vec3 -> IO () - --- | a type with a Direction3D instance can be oriented towards a point (Camera for example) -class Direction3D t where - -- | get direction function - direction3D :: t -> IO Vec3 - -- | set direction function - directionTo3D :: t -> Vec3 -> IO () - --- | a type with an Orientation3D instance can be oriented in space -class Orientation3D t where - -- | get orientation function - orientation3D :: t -> IO UnitQuaternion - -- | set orientation function - orientationTo3D :: t -> UnitQuaternion -> IO () - --- yaw, roll, pitch functions --- functions, to rotate on axis, relative to object -rotRelativeToObjectAxis :: Orientation3D t => t -> Vec3 -> Float -> IO () -rotRelativeToObjectAxis object axis val = do - qob <- orientation3D object - let odir = actU qob axis - let qrot = rotU odir val - let nrot = qrot .*. qob - orientationTo3D object nrot - return () - --- | rotate object on own axis (yaw) by angle -yaw3D :: Orientation3D t => t -> Angle -> IO () -yaw3D object val = rotRelativeToObjectAxis object (Vec3 0.0 1.0 0.0) (fromAngle val) - --- | rotate object on own axis (roll) by angle -roll3D :: Orientation3D t => t -> Angle -> IO () -roll3D object val = rotRelativeToObjectAxis object (Vec3 0.0 0.0 1.0) (fromAngle val) - --- | rotate object on own axis (pitch) by angle -pitch3D :: Orientation3D t => t -> Angle -> IO () -pitch3D object val = rotRelativeToObjectAxis object (Vec3 1.0 0.0 0.0) (fromAngle val) - diff --git a/Data/HGamer3D/Data/Transform3D.hs b/Data/HGamer3D/Data/Transform3D.hs new file mode 100644 index 0000000..24442d5 --- /dev/null +++ b/Data/HGamer3D/Data/Transform3D.hs @@ -0,0 +1,102 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Transform3D.hs + +-- | Typeclasses for basic 3D transformations + +module HGamer3D.Data.Transform3D +( + -- * Types + Position (..), + Size (..), + Orientation (..), + + -- * Functions + translate, + scale, + yaw, + pitch, + roll +) + +where + +import HGamer3D.Data.Vector +import HGamer3D.Data.Angle + +-- | a type with a Position instance has a position +class Position t where + + -- | get position function + position :: t -> IO Vec3 + -- | set position function + positionTo :: t -> Vec3 -> IO () + +-- | move the position +translate :: Position t => t -> Vec3 -> IO () +translate t v = do + p <- position t + positionTo t ( v &+ p ) + return () + +-- | a type with a Size instance has a size +class Size t where + + -- | get scale function + size :: t -> IO Vec3 + -- | set scale function + sizeTo :: t -> Vec3 -> IO () + +-- | scale the size +scale :: Size t => t -> Vec3 -> IO () +scale t v = do + s <- size t + sizeTo t ( v &! s ) + return () + +-- | a type with an Orientation instance has an oriented in space +class Orientation t where + -- | get orientation function + orientation :: t -> IO UnitQuaternion + -- | set orientation function + orientationTo :: t -> UnitQuaternion -> IO () + +-- yaw, roll, pitch functions +-- functions, to rotate on axis, relative to object +rotRelativeToObjectAxis :: Orientation t => t -> Vec3 -> Float -> IO () +rotRelativeToObjectAxis object axis val = do + qob <- orientation object + let odir = actU qob axis + let qrot = rotU odir val + let nrot = qrot .*. qob + orientationTo object nrot + return () + +-- | rotate object on own axis (yaw) by angle +yaw :: Orientation t => t -> Angle -> IO () +yaw object val = rotRelativeToObjectAxis object vec3Y (fromAngle val) + +-- | rotate object on own axis (roll) by angle +roll :: Orientation t => t -> Angle -> IO () +roll object val = rotRelativeToObjectAxis object vec3Z (fromAngle val) + +-- | rotate object on own axis (pitch) by angle +pitch :: Orientation t => t -> Angle -> IO () +pitch object val = rotRelativeToObjectAxis object vec3X (fromAngle val) + diff --git a/Data/HGamer3D/Data/Vector.hs b/Data/HGamer3D/Data/Vector.hs index 8745ff8..a5eec14 100644 --- a/Data/HGamer3D/Data/Vector.hs +++ b/Data/HGamer3D/Data/Vector.hs @@ -20,17 +20,38 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} --- book: math3d vector lib --- |Includes the right pieces of the Vect libray of Balazs Komuves. --- see: +-- | Vector library for HGamer3D module HGamer3D.Data.Vector ( - module Data.Vect.Float, - module Data.Vect.Float.Util.Quaternion + + -- * the Vect libray of Balazs Komuves, see: + + module Data.Vect.Float, + module Data.Vect.Float.Util.Quaternion, + + -- * some constants + + vec2Zero, + vec2U, + + vec3Zero, + vec3U ) where import Data.Vect.Float import Data.Vect.Float.Util.Quaternion --- book: end + +-- | the 2d zero vector +vec2Zero = Vec2 0.0 0.0 + +-- | the 2d unity vector +vec2U = Vec2 1.0 1.0 + +-- | the 3d Zero vector +vec3Zero = Vec3 0.0 0.0 0.0 + +-- | the 3d Unity vector +vec3U = Vec3 1.0 1.0 1.0 + diff --git a/Data/HGamer3D/Data/Window.hs b/Data/HGamer3D/Data/Window.hs new file mode 100644 index 0000000..62ed1fa --- /dev/null +++ b/Data/HGamer3D/Data/Window.hs @@ -0,0 +1,32 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Rectangle.hs + +-- | Type definitions for 2D window +module HGamer3D.Data.Window +( + -- * Windowing + Window (..), + + +) where + +-- | A window is simply represented by it's window id, an unsigned C int +data Window = Window Int + diff --git a/Examples/Graphics3D/BlueCube.hs b/Examples/Graphics3D/BlueCube.hs index d39fee2..f244809 100644 --- a/Examples/Graphics3D/BlueCube.hs +++ b/Examples/Graphics3D/BlueCube.hs @@ -45,12 +45,19 @@ main = do pointLight g3ds white (Vec3 10.0 10.0 20.0) -- create a shiny blue cube - cube <- object3DFromMesh g3ds cubeMesh (Just (ResourceMaterial "Colours/Blue") ) False - positionTo3D cube (Vec3 0.0 0.0 0.0) - scaleTo3D cube (Vec3 0.2 0.2 0.2) + --cube <- object3DFromMesh g3ds cubeMesh (Just (ResourceMaterial "Colours/Blue") ) False + --positionTo3D cube (Vec3 0.0 0.0 0.0) + --scaleTo3D cube (Vec3 0.2 0.2 0.2) + + pinky <- colouredCubeMesh g3ds (Colour 0.5 0.5 0.0 1.0) + cube2 <- object3DFromMesh g3ds pinky Nothing False + positionTo3D cube2 (Vec3 0.0 0.0 0.0) +-- scaleTo3D cube (Vec3 0.2 0.2 0.2) + cube <- object3DFromMesh g3ds pinky Nothing False + positionTo3D cube (Vec3 5.0 0.0 0.0) -- start render loop - renderLoop cube g3ds + renderLoop cube2 g3ds exitHGamer3D g3ds return () diff --git a/Graphics3D/HGamer3D-Graphics3D.cabal b/Graphics3D/HGamer3D-Graphics3D.cabal index ee6f2e5..5a2d235 100644 --- a/Graphics3D/HGamer3D-Graphics3D.cabal +++ b/Graphics3D/HGamer3D-Graphics3D.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-Graphics3D -Version: 0.3.2 +Version: 0.4.0 Synopsis: 3D Graphics Functionality for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,10 +18,10 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, mtl, transformers, filepath, directory, HGamer3D-Data >= 0.3.0 && < 0.4.0, HGamer3D-Ogre-Binding >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, containers, mtl, transformers, filepath, directory, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Ogre-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Graphics3D.Types, HGamer3D.Graphics3D.Basic3D, HGamer3D.Graphics3D.Object3D, HGamer3D.Graphics3D.Light, HGamer3D.Graphics3D.PlatonObjects, HGamer3D.Graphics3D.Engine, HGamer3D.Graphics3D + Exposed-modules: HGamer3D.Graphics3D.Base, HGamer3D.Graphics3D.Shapes, HGamer3D.Graphics3D.PlatonShapes, HGamer3D.Graphics3D.Light, HGamer3D.Graphics3D Other-modules: c-sources: diff --git a/Graphics3D/HGamer3D/Graphics3D.hs b/Graphics3D/HGamer3D/Graphics3D.hs index 303a2d8..b7a07d2 100644 --- a/Graphics3D/HGamer3D/Graphics3D.hs +++ b/Graphics3D/HGamer3D/Graphics3D.hs @@ -24,28 +24,66 @@ module HGamer3D.Graphics3D ( module HGamer3D.Data, module HGamer3D.Util, - module HGamer3D.Graphics3D.Types, - module HGamer3D.Graphics3D.Basic3D, - module HGamer3D.Graphics3D.Object3D, - module HGamer3D.Graphics3D.Light, - module HGamer3D.Graphics3D.PlatonObjects, - module HGamer3D.Graphics3D.Engine, + + -- * Fundamental Types + + Object3D, + Material, + Mesh, + Camera, + + -- * Initialization + + Graphics3DSystem, initHGamer3D, exitHGamer3D, - loopHGamer3D + loopHGamer3D, + + -- * Misc Functions + + cameraLookAt, + HGamer3D.Graphics3D.Base.setBackgroundColour, + addResourceLocationMedia, + addResourceZipfileMedia, + addResourceLocationGUI, + + -- * Light + Light, + HGamer3D.Graphics3D.Light.setAmbientLight, + pointLight, + spotLight, + spotLightSetDirection, + setSpotLightAngle, + directionalLight, + + -- * Shapes + sphereMesh, + cubeMesh, + planeMesh, + resourceMesh, + + colouredCubeMesh, + colouredLineMesh, + rainbowCubeMesh, + + createIkosaederMesh, + createDodekaederMesh, + + object3DFromMesh, + object3DFromObjects + ) where import HGamer3D.Data import HGamer3D.Util - import HGamer3D.Graphics3D.Types - import HGamer3D.Graphics3D.Basic3D - import HGamer3D.Graphics3D.Object3D + + import HGamer3D.Graphics3D.Base import HGamer3D.Graphics3D.Light - import HGamer3D.Graphics3D.PlatonObjects - import HGamer3D.Graphics3D.Engine - + import HGamer3D.Graphics3D.Shapes + import HGamer3D.Graphics3D.PlatonShapes + initHGamer3D windowName sceneManagerType fConfig fLog = do (g3ds, camera, viewport, window) <- initGraphics3D windowName sceneManagerType fConfig fLog return (g3ds, camera, viewport) diff --git a/Graphics3D/HGamer3D/Graphics3D/Engine.hs b/Graphics3D/HGamer3D/Graphics3D/Base.hs similarity index 55% rename from Graphics3D/HGamer3D/Graphics3D/Engine.hs rename to Graphics3D/HGamer3D/Graphics3D/Base.hs index b8ed634..022b64a 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Engine.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Base.hs @@ -18,17 +18,48 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- EngineHelper.hs +-- Base.hs --- | Initialization functions for the Graphics3D module -module HGamer3D.Graphics3D.Engine ( +-- | Basic Types, Initialization and some global functions for the Graphics3D module +module HGamer3D.Graphics3D.Base ( - initGraphics3D, - graphics3DPumpWindowMessages, - exitGraphics3D, - loopGraphics3D, - renderOneFrame, - checkQuitReceived + -- * Fundamental Types + + Object3D (..), + Material (..), + Mesh (..), + Camera (..), + + -- * Internal Types, handling of Ogre Engine + SceneManager (..), + ResourceGroupManager (..), + RootObject (..), + Viewport (..), + LogManager (..), + TextureManager (..), + RenderTarget (..), + + -- * The Graphics System + Graphics3DSystem (..), + + + -- * Initialization of Graphics3D and Game Loop + initGraphics3D, + exitGraphics3D, + loopGraphics3D, + + -- * global functions + cameraLookAt, + HGamer3D.Graphics3D.Base.setBackgroundColour, + addResourceLocationMedia, + addResourceZipfileMedia, + addResourceLocationGUI, + + -- * Internal Functionality + graphics3DPumpWindowMessages, + renderOneFrame, + checkQuitReceived, + _getNode ) where @@ -37,6 +68,8 @@ import HGamer3D.Data import HGamer3D.Util import qualified HGamer3D.Bindings.Ogre.ClassRoot as Root +import HGamer3D.Bindings.Ogre.ClassCamera as Camera +import HGamer3D.Bindings.Ogre.ClassNode as Node import HGamer3D.Bindings.Ogre.ClassSceneManager as SceneManager import HGamer3D.Bindings.Ogre.ClassResourceGroupManager as ResourceGroupManager import HGamer3D.Bindings.Ogre.ClassTextureManager as TextureManager @@ -56,9 +89,6 @@ import HGamer3D.Bindings.Ogre.StructHG3DClass import HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType import HGamer3D.Bindings.Ogre.ClassWindowEventUtilities as WindowEventUtilities -import HGamer3D.Graphics3D.Types -import HGamer3D.Graphics3D.Basic3D - import Control.Monad import Control.Monad.Trans import Control.Monad.IO.Class @@ -67,6 +97,98 @@ import Control.Monad.State.Class import Control.Concurrent import Data.Maybe +import HGamer3D.Data +import HGamer3D.Util + +-- | The material. Define how an object is looking. Currently we have materials from resources +data Material = ResourceMaterial String -- ^ a named material, already installed as a resource + +-- | The mesh. A mesh in HGamer3D is just that, a mesh loaded from a template, a manual mesh, or loaded from file. It comes with default +-- material, but 3D objects based on this can get other materials individually. +data Mesh = CubeMesh | -- ^ Cube Mesh-Type + PlaneMesh | -- ^ Plane Mesh-Type + SphereMesh | -- ^ Sphere Mesh-Type + ResourceMesh String | -- ^ Mesh resource loaded from file + ManualMesh String -- ^ Manual Mesh-Type, identified by name + +-- | The basic 3D object. Each object is a single instance, which can be displayed, moved, scaled, rotated, ... +-- Objects are created cloned from meshes (templates for ojbects) or manually, by manual object creation methods. +data Object3D = SingleObject3D Mesh HG3DClass | -- ^ a single object, consisting of a Mesh and a Node (Ogre) + CombinedObject3D [Object3D] HG3DClass -- ^ a combined object,consisting of many objects and a node for the combined one + +instance Position Object3D where + + position obj = do + pos <- Node.getPosition (_getNode obj) + return (pos) + + positionTo obj pos = do + Node.setPosition (_getNode obj) pos + return () + +instance Size Object3D where + + size obj = do + pos <- Node.getScale (_getNode obj) + return (pos) + + sizeTo obj pos = do + Node.setScale (_getNode obj) pos + return () + +instance Orientation Object3D where + + orientation obj = do + q <- Node.getOrientation (_getNode obj) + let uq = mkNormal q + return uq + + orientationTo obj uq = do + Node.setOrientation (_getNode obj) (fromNormal uq) + return () + +instance Position Camera where + + position (Camera c) = do + pos <- Camera.getPosition c + return (pos) + + positionTo (Camera c) pos = do + Camera.setPosition2 c pos + return () + +instance Orientation Camera where + + orientation (Camera c) = do + q <- Camera.getOrientation c + let uq = mkNormal q + return uq + + orientationTo (Camera c) uq = do + Camera.setOrientation c (fromNormal uq) + return () + + + +data SceneManager = SceneManager HG3DClass +data ResourceGroupManager = ResourceGroupManager HG3DClass +data RootObject = RootObject HG3DClass +data Viewport = Viewport HG3DClass +data TextureManager = TextureManager HG3DClass +data LogManager = LogManager HG3DClass +data Camera = Camera HG3DClass +data RenderTarget = RenderTarget HG3DClass + +data Graphics3DSystem = Graphics3DSystem { + g3dsRoot :: RootObject, + g3dsSceneManager :: SceneManager, + g3dsResourceGroupManager :: ResourceGroupManager, + g3dsLogManager :: LogManager, + g3dsTextureManager :: TextureManager, + g3dsRenderTarget :: RenderTarget, + g3dsUniqueName :: UniqueName +} + -- | pump window messages for graphics -- Not to be used, if WinEvent pollWinEvent or pumpWinEvents is used! graphics3DPumpWindowMessages :: IO () @@ -199,3 +321,54 @@ initGraphics3D windowName sceneManagerType fConfig fLog = do return $ (Graphics3DSystem (RootObject root) (SceneManager sceneManager) (ResourceGroupManager rgm) (LogManager lmgr) (TextureManager tm) (RenderTarget renderWindow) uniqueName, (Camera camera), (Viewport viewport), (Window windowHandle)) +-- | set the direction in a way, that the camera looks toward a specified point + +cameraLookAt :: Camera -> Vec3 -> IO () +cameraLookAt (Camera c) v = do + Camera.lookAt c v + return () + + +-- specific single function +-- + +-- | sets the background colour of the 3d drawing window +setBackgroundColour :: Viewport -> Colour -> IO () +setBackgroundColour (Viewport viewport) bgColour = do + Viewport.setBackgroundColour viewport bgColour + +-- locations of media in same folder as program resides +-- + +-- | adds a resource location for 3D media (Ogre) +addResourceLocationMedia :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + -> String -- ^ path to new resource location, the path should identify a directory + -> IO () +addResourceLocationMedia g3ds path = do + let (ResourceGroupManager rgm) = (g3dsResourceGroupManager g3ds) + ResourceGroupManager.addResourceLocation rgm path "FileSystem" "General" False + ResourceGroupManager.initialiseResourceGroup rgm "General" + +-- | adds a resource location for 3D media (Ogre) which is a zip file +addResourceZipfileMedia :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + -> String -- ^ path to new resource location, the path should identify a zip file + -> IO () +addResourceZipfileMedia g3ds path = do + let (ResourceGroupManager rgm) = (g3dsResourceGroupManager g3ds) + ResourceGroupManager.addResourceLocation rgm path "Zip" "General" False + ResourceGroupManager.initialiseResourceGroup rgm "General" + +-- | adds a resource location for GUI media (CEGUI) which is a directory +addResourceLocationGUI :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + -> String -- ^ path to the directory with the GUI media in it + -> String -- ^ category of GUI media, for example: Layout, Images, ... + -> IO () +addResourceLocationGUI g3ds path category = do + let (ResourceGroupManager rgm) = (g3dsResourceGroupManager g3ds) + ResourceGroupManager.addResourceLocation rgm path "FileSystem" category False + ResourceGroupManager.initialiseResourceGroup rgm category + +_getNode :: Object3D -> HG3DClass +_getNode (SingleObject3D entity node) = node +_getNode (CombinedObject3D objects node) = node + diff --git a/Graphics3D/HGamer3D/Graphics3D/Basic3D.hs b/Graphics3D/HGamer3D/Graphics3D/Basic3D.hs deleted file mode 100644 index c0f3d7b..0000000 --- a/Graphics3D/HGamer3D/Graphics3D/Basic3D.hs +++ /dev/null @@ -1,129 +0,0 @@ -{-# LANGUAGE FlexibleContexts #-} - --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Basic3D.hs - --- | Basic functions for the Graphics3D module -module HGamer3D.Graphics3D.Basic3D ( - - - cameraLookAt, - - -- * Background Colour - HGamer3D.Graphics3D.Basic3D.setBackgroundColour, - - -- * Resource locations - -- $audioresource - - addResourceLocationMedia, - addResourceZipfileMedia, - addResourceLocationGUI -) - -where - -import HGamer3D.Data - -import HGamer3D.Bindings.Ogre.ClassCamera as Camera -import HGamer3D.Bindings.Ogre.ClassViewport as Viewport -import HGamer3D.Bindings.Ogre.ClassResourceGroupManager as ResourceGroupManager - -import HGamer3D.Graphics3D.Types - --- Camera functions --- - - -instance Position3D Camera where - - position3D (Camera c) = do - pos <- Camera.getPosition c - return (pos) - - positionTo3D (Camera c) pos = do - Camera.setPosition2 c pos - return () - -instance Direction3D Camera where - - direction3D (Camera c) = do - d <- Camera.getDirection c - return d - - directionTo3D (Camera c) v = do - Camera.setDirection2 c v - -instance Orientation3D Camera where - - orientation3D (Camera c) = do - q <- Camera.getOrientation c - let uq = mkNormal q - return uq - - orientationTo3D (Camera c) uq = do - Camera.setOrientation c (fromNormal uq) - return () - --- | set the direction in a way, that the camera looks toward a specified point -cameraLookAt :: Camera -> Vec3 -> IO () -cameraLookAt (Camera c) v = do - Camera.lookAt c v - return () - - --- specific single function --- - --- | sets the background colour of the 3d drawing window -setBackgroundColour :: Viewport -> Colour -> IO () -setBackgroundColour (Viewport viewport) bgColour = do - Viewport.setBackgroundColour viewport bgColour - --- locations of media in same folder as program resides --- - --- | adds a resource location for 3D media (Ogre) -addResourceLocationMedia :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> String -- ^ path to new resource location, the path should identify a directory - -> IO () -addResourceLocationMedia g3ds path = do - let (ResourceGroupManager rgm) = (g3dsResourceGroupManager g3ds) - ResourceGroupManager.addResourceLocation rgm path "FileSystem" "General" False - ResourceGroupManager.initialiseResourceGroup rgm "General" - --- | adds a resource location for 3D media (Ogre) which is a zip file -addResourceZipfileMedia :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> String -- ^ path to new resource location, the path should identify a zip file - -> IO () -addResourceZipfileMedia g3ds path = do - let (ResourceGroupManager rgm) = (g3dsResourceGroupManager g3ds) - ResourceGroupManager.addResourceLocation rgm path "Zip" "General" False - ResourceGroupManager.initialiseResourceGroup rgm "General" - --- | adds a resource location for GUI media (CEGUI) which is a directory -addResourceLocationGUI :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> String -- ^ path to the directory with the GUI media in it - -> String -- ^ category of GUI media, for example: Layout, Images, ... - -> IO () -addResourceLocationGUI g3ds path category = do - let (ResourceGroupManager rgm) = (g3dsResourceGroupManager g3ds) - ResourceGroupManager.addResourceLocation rgm path "FileSystem" category False - ResourceGroupManager.initialiseResourceGroup rgm category - diff --git a/Graphics3D/HGamer3D/Graphics3D/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Light.hs index 308ab5f..1fa8bcd 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Light.hs @@ -32,6 +32,7 @@ module HGamer3D.Graphics3D.Light ( HGamer3D.Graphics3D.Light.setAmbientLight, pointLight, spotLight, + spotLightSetDirection, setSpotLightAngle, directionalLight ) @@ -78,9 +79,8 @@ import HGamer3D.Bindings.Ogre.StructHG3DClass import HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType import HGamer3D.Data.HG3DClass -import HGamer3D.Data.Operation3D -import HGamer3D.Graphics3D.Types -import HGamer3D.Graphics3D.Engine +import HGamer3D.Data.Transform3D +import HGamer3D.Graphics3D.Base import Control.Monad import Control.Monad.Trans @@ -92,26 +92,18 @@ import Control.Monad.State.Class -- | The light. data Light = Light HG3DClass deriving (Show) -instance Position3D Light where +instance Position Light where - position3D (Light l) = do + position (Light l) = do pos <- Light.getPosition l return (pos) - positionTo3D (Light l) pos = do + positionTo (Light l) pos = do let (Vec3 x y z) = pos Light.setPosition l x y z return () -instance Direction3D Light where - - direction3D (Light l) = do - d <- Light.getDirection l - return d - - directionTo3D (Light l) v = do - Light.setDirection2 l v - return () +spotLightSetDirection l v = Light.setDirection2 l v -- | Ambient light is present everywhere, this function creates it and sets the colour of it. diff --git a/Graphics3D/HGamer3D/Graphics3D/PlatonObjects.hs b/Graphics3D/HGamer3D/Graphics3D/PlatonShapes.hs similarity index 96% rename from Graphics3D/HGamer3D/Graphics3D/PlatonObjects.hs rename to Graphics3D/HGamer3D/Graphics3D/PlatonShapes.hs index 0b83cf1..dd7dc9f 100644 --- a/Graphics3D/HGamer3D/Graphics3D/PlatonObjects.hs +++ b/Graphics3D/HGamer3D/Graphics3D/PlatonShapes.hs @@ -18,10 +18,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- PlatonObjects.hs +-- PlatonShapes.hs --- | Create platonic objects, ikosaeder and dodekaeder -module HGamer3D.Graphics3D.PlatonObjects ( +-- | Create platonic shapes, ikosaeder and dodekaeder +module HGamer3D.Graphics3D.PlatonShapes ( createIkosaederMesh, createDodekaederMesh @@ -67,9 +67,7 @@ import HGamer3D.Bindings.Ogre.ClassControllerManager as ControllerManager import HGamer3D.Bindings.Ogre.ClassWindowEventUtilities as WindowEventUtilities import HGamer3D.Bindings.Ogre.ClassManualObject as ManualObject -import HGamer3D.Graphics3D.Types -import HGamer3D.Graphics3D.Object3D -import HGamer3D.Graphics3D.Engine +import HGamer3D.Graphics3D.Base import Control.Monad import Control.Monad.Trans diff --git a/Graphics3D/HGamer3D/Graphics3D/Object3D.hs b/Graphics3D/HGamer3D/Graphics3D/Shapes.hs similarity index 88% rename from Graphics3D/HGamer3D/Graphics3D/Object3D.hs rename to Graphics3D/HGamer3D/Graphics3D/Shapes.hs index 016e333..3984e32 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Object3D.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Shapes.hs @@ -1,342 +1,300 @@ -{-# LANGUAGE FlexibleContexts #-} - --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Object3D.hs - --- | Creating and managing 3D objects functionality for Graphics3D module -module HGamer3D.Graphics3D.Object3D ( - - -- * Mesh creation functions, standard meshes - sphereMesh, - cubeMesh, - planeMesh, - resourceMesh, - - -- * Mesh creation functions, special meshes - colouredCubeMesh, - colouredLineMesh, - rainbowCubeMesh, - - -- * clone objects from meshes - object3DFromMesh, - object3DFromObjects, - - -- * Special movements - yaw3D, - roll3D, - pitch3D -) - -where - -import HGamer3D.Data -import HGamer3D.Util - -import GHC.Ptr - -import HGamer3D.Bindings.Ogre.ClassPtr -import HGamer3D.Bindings.Ogre.Utils - -import HGamer3D.Bindings.Ogre.StructColour -import HGamer3D.Bindings.Ogre.StructSharedPtr - -import HGamer3D.Bindings.Ogre.EnumSceneType -import HGamer3D.Bindings.Ogre.EnumNodeTransformSpace -import HGamer3D.Bindings.Ogre.EnumLightType - ---import HGamer3D.Bindings.Ogre.ClassCamera as Camera ---import HGamer3D.Bindings.Ogre.ClassRoot as Root -import HGamer3D.Bindings.Ogre.ClassLight as Light -import HGamer3D.Bindings.Ogre.ClassNode as Node -import HGamer3D.Bindings.Ogre.ClassSceneManager as SceneManager -import HGamer3D.Bindings.Ogre.ClassSceneNode as SceneNode -import HGamer3D.Bindings.Ogre.ClassRenderTarget as RenderTarget -import HGamer3D.Bindings.Ogre.ClassRenderWindow as RenderWindow -import HGamer3D.Bindings.Ogre.ClassResourceGroupManager as ResourceGroupManager -import HGamer3D.Bindings.Ogre.ClassTextureManager as TextureManager -import HGamer3D.Bindings.Ogre.ClassControllerManager as ControllerManager -import HGamer3D.Bindings.Ogre.ClassViewport as Viewport -import HGamer3D.Bindings.Ogre.ClassFrustum as Frustum -import HGamer3D.Bindings.Ogre.ClassAnimationState as AnimationState -import HGamer3D.Bindings.Ogre.ClassEntity as Entity -import HGamer3D.Bindings.Ogre.ClassControllerManager as ControllerManager -import HGamer3D.Bindings.Ogre.ClassWindowEventUtilities as WindowEventUtilities -import HGamer3D.Bindings.Ogre.ClassHG3DUtilities as HG3DUtils - -import HGamer3D.Bindings.Ogre.ClassManualObject as ManualObject -import HGamer3D.Bindings.Ogre.EnumRenderOperationOperationType -import HGamer3D.Bindings.Ogre.StructHG3DClass -import HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType - -import HGamer3D.Data.HG3DClass -import HGamer3D.Data.Operation3D -import HGamer3D.Graphics3D.Types -import HGamer3D.Graphics3D.Engine - -import Control.Monad -import Control.Monad.Trans -import Control.Monad.State.Class - - - --- set the material of an Ogre entity, used during mesh creation -_setMaterial :: HG3DClass -- ^ 3d object - -> Material -- ^ material - -> IO () -_setMaterial entity material = do - case material of - (ResourceMaterial name) -> do - Entity.setMaterialName entity name "General" - return () - - --- | creates a Sphere Mesh, from which Spheres can be cloned -sphereMesh :: Mesh -- ^ the mesh created -sphereMesh = SphereMesh - --- | creates a Cube Mesh, from which Cubes can be cloned -cubeMesh :: Mesh -- ^ the mesh created -cubeMesh = CubeMesh - --- | creates a Plane Mesh, from which Planes can be cloned -planeMesh :: Mesh -- ^ the mesh created -planeMesh = PlaneMesh - --- | creates a Plane Mesh, from which Planes can be cloned -resourceMesh :: String -- ^ the name of the resource - -> Mesh -- ^ the mesh created -resourceMesh resourceName = ResourceMesh resourceName - --- | clones a 3D object from a mesh -object3DFromMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Mesh -- ^ mesh used for creation - -> Maybe Material -- ^ a material to be applied, if needed - -> Bool -- ^ flag, build tangent vectors, if set - -> IO Object3D -- ^ created 3d object -object3DFromMesh g3ds mesh mbMaterial buildTV = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - -- create the entity from the mesh - entity <- case mesh of - CubeMesh -> SceneManager.createEntity6 scm PT_CUBE - SphereMesh -> SceneManager.createEntity6 scm PT_SPHERE - PlaneMesh -> SceneManager.createEntity6 scm PT_PLANE - ResourceMesh resourceName -> SceneManager.createEntity3 scm resourceName - ManualMesh meshName -> SceneManager.createEntity3 scm meshName - -- create tangent vectors - if buildTV then - HG3DUtils.buildTangentVectors entity - else - return () - -- apply material, if needed, wanted - case mbMaterial of - Just material -> _setMaterial entity material - Nothing -> return () - -- now create node and attach entity to it - rootNode <- SceneManager.getRootSceneNode scm - let vzero = Vec3 0.0 0.0 0.0 - let qident = Q (Vec4 1.0 0.0 0.0 0.0) - node <- SceneNode.createChildSceneNode rootNode vzero qident - SceneNode.attachObject node entity - -- return object - return (SingleObject3D mesh node) - -_getNode :: Object3D -> HG3DClass -_getNode (SingleObject3D entity node) = node -_getNode (CombinedObject3D objects node) = node - --- | combine 3D objects to a new object -object3DFromObjects :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - ->[Object3D] -- ^ A list of objects, to be grouped - -> IO Object3D -- ^ The return value is a new 3d object. -object3DFromObjects g3ds listObjects = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - rootNode <- SceneManager.getRootSceneNode scm - let vzero = Vec3 0.0 0.0 0.0 - let qident = Q (Vec4 1.0 0.0 0.0 0.0) - node <- SceneNode.createChildSceneNode rootNode vzero qident - sequence_ (map ( \object -> do - let objectnode = _getNode object - parent <- Node.getParent objectnode - Node.removeChild2 parent objectnode - Node.addChild node objectnode - return () ) listObjects) - return ( CombinedObject3D listObjects node) - --- | Creates a line with a colour from start and end point (mesh as object template) -colouredLineMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Vec3 -- ^ start point - -> Vec3 -- ^ end point - -> Colour -- ^ colour - -> IO Mesh -- ^ line mesh -colouredLineMesh g3ds vStart vEnd colour = do - uid <- nextUniqueName (g3dsUniqueName g3ds) - let (SceneManager scm) = (g3dsSceneManager g3ds) - let lineName = "L" ++ uid - let meshName = "M" ++ uid - - mo <- SceneManager.createManualObject scm lineName - ManualObject.begin mo "BaseWhiteNoLighting" OT_LINE_LIST "General" - ManualObject.position mo vStart - ManualObject.colour mo colour - ManualObject.position mo vEnd - ManualObject.colour mo colour - ManualObject.end mo - ManualObject.convertToMesh mo meshName "General" - return $ ManualMesh meshName - --- |Creates a coloured cube mesh -colouredCubeMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Colour -- ^ colour - -> IO Mesh -- ^ cube mesh -colouredCubeMesh g3ds colour = do - uid <- nextUniqueName (g3dsUniqueName g3ds) - let (SceneManager scm) = (g3dsSceneManager g3ds) - let cubeName = "C" ++ uid - let meshName = "M" ++ uid - - mo <- SceneManager.createManualObject scm cubeName - - -- basic parameters - let lsize = 1.0 - let cp = 1.0 * lsize - let cm = -1.0 * lsize - - ManualObject.begin mo "BaseWhiteNoLighting" OT_TRIANGLE_LIST "General" - - ManualObject.position2 mo cm cp cm -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cp cp cm -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cp cm cm -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cm cm cm -- a vertex - ManualObject.colour mo colour - - ManualObject.position2 mo cm cp cp -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cp cp cp -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cp cm cp -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cm cm cp -- a vertex - ManualObject.colour mo colour - - ManualObject.triangle mo 0 1 2 - ManualObject.triangle mo 2 3 0 - ManualObject.triangle mo 4 6 5 - ManualObject.triangle mo 6 4 7 - - ManualObject.triangle mo 0 4 5 - ManualObject.triangle mo 5 1 0 - ManualObject.triangle mo 2 6 7 - ManualObject.triangle mo 7 3 2 - - ManualObject.triangle mo 0 7 4 - ManualObject.triangle mo 7 0 3 - ManualObject.triangle mo 1 5 6 - ManualObject.triangle mo 6 2 1 - - ManualObject.end mo - - ManualObject.convertToMesh mo meshName "General" - return $ ManualMesh meshName - - --- | Creates a rainbow coloured cube mesh -rainbowCubeMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> IO Mesh -rainbowCubeMesh g3ds = do - uid <- nextUniqueName (g3dsUniqueName g3ds) - let (SceneManager scm) = (g3dsSceneManager g3ds) - let cubeName = "C" ++ uid - let meshName = "M" ++ uid - let materialName = "BaseWhiteNoLighting" - - mo <- SceneManager.createManualObject scm cubeName - - -- basic parameters - let lsize = 1.0 - let cp = 1.0 * lsize - let cm = -1.0 * lsize - - ManualObject.begin mo "BaseWhiteNoLighting" OT_TRIANGLE_LIST "General" - - sequence $ map (\(x, y, z, c) -> liftIO (ManualObject.position2 mo x y z) >> liftIO (ManualObject.colour mo c) ) [ - (cm, cp, cm, (Colour 0.0 1.0 0.0 1.0) ), - (cp, cp, cm, (Colour 1.0 1.0 0.0 1.0) ), - (cp, cm, cm, (Colour 1.0 0.0 0.0 1.0) ), - (cm, cm, cm, (Colour 0.0 0.0 0.0 1.0) ), - - (cm, cp, cp, (Colour 0.0 1.0 1.0 1.0) ), - (cp, cp, cp, (Colour 1.0 1.0 1.0 1.0) ), - (cp, cm, cp, (Colour 1.0 0.0 1.0 1.0) ), - (cm, cm, cp, (Colour 0.0 0.0 1.0 1.0) ) ] - - sequence $ map (\(x,y,z) -> ManualObject.triangle mo x y z) [ - (0, 1, 2), - (2, 3, 0), - (4, 6, 5), - (6, 4, 7), - - (0, 4, 5), - (5, 1, 0), - (2, 6, 7), - (7, 3, 2), - - (0, 7, 4), - (7, 0, 3), - (1, 5, 6), - (6, 2, 1) ] - - ManualObject.end mo - ManualObject.convertToMesh mo meshName "General" - return $ ManualMesh meshName - -instance Position3D Object3D where - - position3D obj = do - pos <- Node.getPosition (_getNode obj) - return (pos) - - positionTo3D obj pos = do - Node.setPosition (_getNode obj) pos - return () - -instance Scale3D Object3D where - - scale3D obj = do - pos <- Node.getScale (_getNode obj) - return (pos) - - scaleTo3D obj pos = do - Node.setScale (_getNode obj) pos - return () - -instance Orientation3D Object3D where - - orientation3D obj = do - q <- Node.getOrientation (_getNode obj) - let uq = mkNormal q - return uq - - orientationTo3D obj uq = do - Node.setOrientation (_getNode obj) (fromNormal uq) - return () - +{-# LANGUAGE FlexibleContexts #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Object3D.hs + +-- | Creating and managing 3D objects functionality for Graphics3D module +module HGamer3D.Graphics3D.Shapes ( + + -- * Mesh creation functions, standard meshes + sphereMesh, + cubeMesh, + planeMesh, + resourceMesh, + + -- * Mesh creation functions, special meshes + colouredCubeMesh, + colouredLineMesh, + rainbowCubeMesh, + + -- * clone objects from meshes + object3DFromMesh, + object3DFromObjects, + +) + +where + +import HGamer3D.Data +import HGamer3D.Util + +import GHC.Ptr + +import HGamer3D.Bindings.Ogre.ClassPtr +import HGamer3D.Bindings.Ogre.Utils + +import HGamer3D.Bindings.Ogre.StructColour +import HGamer3D.Bindings.Ogre.StructSharedPtr + +import HGamer3D.Bindings.Ogre.EnumSceneType +import HGamer3D.Bindings.Ogre.EnumNodeTransformSpace +import HGamer3D.Bindings.Ogre.EnumLightType + +import HGamer3D.Bindings.Ogre.ClassLight as Light +import HGamer3D.Bindings.Ogre.ClassNode as Node +import HGamer3D.Bindings.Ogre.ClassSceneManager as SceneManager +import HGamer3D.Bindings.Ogre.ClassSceneNode as SceneNode +import HGamer3D.Bindings.Ogre.ClassRenderTarget as RenderTarget +import HGamer3D.Bindings.Ogre.ClassRenderWindow as RenderWindow +import HGamer3D.Bindings.Ogre.ClassResourceGroupManager as ResourceGroupManager +import HGamer3D.Bindings.Ogre.ClassTextureManager as TextureManager +import HGamer3D.Bindings.Ogre.ClassControllerManager as ControllerManager +import HGamer3D.Bindings.Ogre.ClassViewport as Viewport +import HGamer3D.Bindings.Ogre.ClassFrustum as Frustum +import HGamer3D.Bindings.Ogre.ClassAnimationState as AnimationState +import HGamer3D.Bindings.Ogre.ClassEntity as Entity +import HGamer3D.Bindings.Ogre.ClassControllerManager as ControllerManager +import HGamer3D.Bindings.Ogre.ClassWindowEventUtilities as WindowEventUtilities +import HGamer3D.Bindings.Ogre.ClassHG3DUtilities as HG3DUtils + +import HGamer3D.Bindings.Ogre.ClassManualObject as ManualObject +import HGamer3D.Bindings.Ogre.EnumRenderOperationOperationType +import HGamer3D.Bindings.Ogre.StructHG3DClass +import HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType + +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Transform3D +import HGamer3D.Graphics3D.Base + +import Control.Monad +import Control.Monad.Trans +import Control.Monad.State.Class + + + +-- set the material of an Ogre entity, used during mesh creation +_setMaterial :: HG3DClass -- ^ 3d object + -> Material -- ^ material + -> IO () +_setMaterial entity material = do + case material of + (ResourceMaterial name) -> do + Entity.setMaterialName entity name "General" + return () + + +-- | creates a Sphere Mesh, from which Spheres can be cloned +sphereMesh :: Mesh -- ^ the mesh created +sphereMesh = SphereMesh + +-- | creates a Cube Mesh, from which Cubes can be cloned +cubeMesh :: Mesh -- ^ the mesh created +cubeMesh = CubeMesh + +-- | creates a Plane Mesh, from which Planes can be cloned +planeMesh :: Mesh -- ^ the mesh created +planeMesh = PlaneMesh + +-- | creates a Plane Mesh, from which Planes can be cloned +resourceMesh :: String -- ^ the name of the resource + -> Mesh -- ^ the mesh created +resourceMesh resourceName = ResourceMesh resourceName + +-- | clones a 3D object from a mesh +object3DFromMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + -> Mesh -- ^ mesh used for creation + -> Maybe Material -- ^ a material to be applied, if needed + -> Bool -- ^ flag, build tangent vectors, if set + -> IO Object3D -- ^ created 3d object +object3DFromMesh g3ds mesh mbMaterial buildTV = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + -- create the entity from the mesh + entity <- case mesh of + CubeMesh -> SceneManager.createEntity6 scm PT_CUBE + SphereMesh -> SceneManager.createEntity6 scm PT_SPHERE + PlaneMesh -> SceneManager.createEntity6 scm PT_PLANE + ResourceMesh resourceName -> SceneManager.createEntity3 scm resourceName + ManualMesh meshName -> SceneManager.createEntity3 scm meshName + -- create tangent vectors + if buildTV then + HG3DUtils.buildTangentVectors entity + else + return () + -- apply material, if needed, wanted + case mbMaterial of + Just material -> _setMaterial entity material + Nothing -> return () + -- now create node and attach entity to it + rootNode <- SceneManager.getRootSceneNode scm + let vzero = Vec3 0.0 0.0 0.0 + let qident = Q (Vec4 1.0 0.0 0.0 0.0) + node <- SceneNode.createChildSceneNode rootNode vzero qident + SceneNode.attachObject node entity + -- return object + return (SingleObject3D mesh node) + +-- | combine 3D objects to a new object +object3DFromObjects :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + ->[Object3D] -- ^ A list of objects, to be grouped + -> IO Object3D -- ^ The return value is a new 3d object. +object3DFromObjects g3ds listObjects = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + rootNode <- SceneManager.getRootSceneNode scm + let vzero = Vec3 0.0 0.0 0.0 + let qident = Q (Vec4 1.0 0.0 0.0 0.0) + node <- SceneNode.createChildSceneNode rootNode vzero qident + sequence_ (map ( \object -> do + let objectnode = _getNode object + parent <- Node.getParent objectnode + Node.removeChild2 parent objectnode + Node.addChild node objectnode + return () ) listObjects) + return ( CombinedObject3D listObjects node) + +-- | Creates a line with a colour from start and end point (mesh as object template) +colouredLineMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + -> Vec3 -- ^ start point + -> Vec3 -- ^ end point + -> Colour -- ^ colour + -> IO Mesh -- ^ line mesh +colouredLineMesh g3ds vStart vEnd colour = do + uid <- nextUniqueName (g3dsUniqueName g3ds) + let (SceneManager scm) = (g3dsSceneManager g3ds) + let lineName = "L" ++ uid + let meshName = "M" ++ uid + + mo <- SceneManager.createManualObject scm lineName + ManualObject.begin mo "BaseWhiteNoLighting" OT_LINE_LIST "General" + ManualObject.position mo vStart + ManualObject.colour mo colour + ManualObject.position mo vEnd + ManualObject.colour mo colour + ManualObject.end mo + ManualObject.convertToMesh mo meshName "General" + return $ ManualMesh meshName + +-- |Creates a coloured cube mesh +colouredCubeMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + -> Colour -- ^ colour + -> IO Mesh -- ^ cube mesh +colouredCubeMesh g3ds colour = do + uid <- nextUniqueName (g3dsUniqueName g3ds) + let (SceneManager scm) = (g3dsSceneManager g3ds) + let cubeName = "C" ++ uid + let meshName = "M" ++ uid + + mo <- SceneManager.createManualObject scm cubeName + + -- basic parameters + let lsize = 1.0 + let cp = 1.0 * lsize + let cm = -1.0 * lsize + + ManualObject.begin mo "BaseWhiteNoLighting" OT_TRIANGLE_LIST "General" + + ManualObject.position2 mo cm cp cm -- a vertex + ManualObject.colour mo colour + ManualObject.position2 mo cp cp cm -- a vertex + ManualObject.colour mo colour + ManualObject.position2 mo cp cm cm -- a vertex + ManualObject.colour mo colour + ManualObject.position2 mo cm cm cm -- a vertex + ManualObject.colour mo colour + + ManualObject.position2 mo cm cp cp -- a vertex + ManualObject.colour mo colour + ManualObject.position2 mo cp cp cp -- a vertex + ManualObject.colour mo colour + ManualObject.position2 mo cp cm cp -- a vertex + ManualObject.colour mo colour + ManualObject.position2 mo cm cm cp -- a vertex + ManualObject.colour mo colour + + ManualObject.triangle mo 0 1 2 + ManualObject.triangle mo 2 3 0 + ManualObject.triangle mo 4 6 5 + ManualObject.triangle mo 6 4 7 + + ManualObject.triangle mo 0 4 5 + ManualObject.triangle mo 5 1 0 + ManualObject.triangle mo 2 6 7 + ManualObject.triangle mo 7 3 2 + + ManualObject.triangle mo 0 7 4 + ManualObject.triangle mo 7 0 3 + ManualObject.triangle mo 1 5 6 + ManualObject.triangle mo 6 2 1 + + ManualObject.end mo + + ManualObject.convertToMesh mo meshName "General" + return $ ManualMesh meshName + + +-- | Creates a rainbow coloured cube mesh +rainbowCubeMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + -> IO Mesh +rainbowCubeMesh g3ds = do + uid <- nextUniqueName (g3dsUniqueName g3ds) + let (SceneManager scm) = (g3dsSceneManager g3ds) + let cubeName = "C" ++ uid + let meshName = "M" ++ uid + let materialName = "BaseWhiteNoLighting" + + mo <- SceneManager.createManualObject scm cubeName + + -- basic parameters + let lsize = 1.0 + let cp = 1.0 * lsize + let cm = -1.0 * lsize + + ManualObject.begin mo "BaseWhiteNoLighting" OT_TRIANGLE_LIST "General" + + sequence $ map (\(x, y, z, c) -> liftIO (ManualObject.position2 mo x y z) >> liftIO (ManualObject.colour mo c) ) [ + (cm, cp, cm, (Colour 0.0 1.0 0.0 1.0) ), + (cp, cp, cm, (Colour 1.0 1.0 0.0 1.0) ), + (cp, cm, cm, (Colour 1.0 0.0 0.0 1.0) ), + (cm, cm, cm, (Colour 0.0 0.0 0.0 1.0) ), + + (cm, cp, cp, (Colour 0.0 1.0 1.0 1.0) ), + (cp, cp, cp, (Colour 1.0 1.0 1.0 1.0) ), + (cp, cm, cp, (Colour 1.0 0.0 1.0 1.0) ), + (cm, cm, cp, (Colour 0.0 0.0 1.0 1.0) ) ] + + sequence $ map (\(x,y,z) -> ManualObject.triangle mo x y z) [ + (0, 1, 2), + (2, 3, 0), + (4, 6, 5), + (6, 4, 7), + + (0, 4, 5), + (5, 1, 0), + (2, 6, 7), + (7, 3, 2), + + (0, 7, 4), + (7, 0, 3), + (1, 5, 6), + (6, 2, 1) ] + + ManualObject.end mo + ManualObject.convertToMesh mo meshName "General" + return $ ManualMesh meshName + diff --git a/Graphics3D/HGamer3D/Graphics3D/Types.hs b/Graphics3D/HGamer3D/Graphics3D/Types.hs deleted file mode 100644 index 104ae0b..0000000 --- a/Graphics3D/HGamer3D/Graphics3D/Types.hs +++ /dev/null @@ -1,84 +0,0 @@ -{-# LANGUAGE FlexibleContexts #-} - --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Types.hs - --- | Basic types for the Graphics3D module -module HGamer3D.Graphics3D.Types ( - - -- * Basic Engine Entities - SceneManager (..), - ResourceGroupManager (..), - RootObject (..), - Viewport (..), - LogManager (..), - TextureManager (..), - Camera (..), - RenderTarget (..), - - Graphics3DSystem (..), - - -- * Type Definitions - Object3D (..), - Material (..), - Mesh (..), - -) - -where - -import HGamer3D.Data -import HGamer3D.Util - --- | The material. Define how an object is looking. Currently we have materials from resources -data Material = ResourceMaterial String -- ^ a named material, already installed as a resource - --- | The mesh. A mesh in HGamer3D is just that, a mesh loaded from a template, a manual mesh, or loaded from file. It comes with default --- material, but 3D objects based on this can get other materials individually. -data Mesh = CubeMesh | -- ^ Cube Mesh-Type - PlaneMesh | -- ^ Plane Mesh-Type - SphereMesh | -- ^ Sphere Mesh-Type - ResourceMesh String | -- ^ Mesh resource loaded from file - ManualMesh String -- ^ Manual Mesh-Type, identified by name - --- | The basic 3D object. Each object is a single instance, which can be displayed, moved, scaled, rotated, ... --- Objects are created cloned from meshes (templates for ojbects) or manually, by manual object creation methods. -data Object3D = SingleObject3D Mesh HG3DClass | -- ^ a single object, consisting of a Mesh and a Node (Ogre) - CombinedObject3D [Object3D] HG3DClass -- ^ a combined object,consisting of many objects and a node for the combined one - -data SceneManager = SceneManager HG3DClass -data ResourceGroupManager = ResourceGroupManager HG3DClass -data RootObject = RootObject HG3DClass -data Viewport = Viewport HG3DClass -data TextureManager = TextureManager HG3DClass -data LogManager = LogManager HG3DClass -data Camera = Camera HG3DClass -data RenderTarget = RenderTarget HG3DClass - -data Graphics3DSystem = Graphics3DSystem { - g3dsRoot :: RootObject, - g3dsSceneManager :: SceneManager, - g3dsResourceGroupManager :: ResourceGroupManager, - g3dsLogManager :: LogManager, - g3dsTextureManager :: TextureManager, - g3dsRenderTarget :: RenderTarget, - g3dsUniqueName :: UniqueName -} - diff --git a/Graphics3D/SConstruct b/Graphics3D/SConstruct index 7fa139f..451f73d 100644 --- a/Graphics3D/SConstruct +++ b/Graphics3D/SConstruct @@ -16,6 +16,7 @@ env["ENV"]["HOME"] = os.environ.get("HOME") dependsOn = [ Glob("HGamer3D/*"), Glob("HGamer3D/Graphics3D/*"), + Glob("HGamer3D/Graphics3D/Data/*"), Glob("*.cabal"), "LICENSE" ] diff --git a/Scheme/HGamer3D-Scheme.cabal b/Scheme/HGamer3D-Scheme.cabal new file mode 100644 index 0000000..5ce570d --- /dev/null +++ b/Scheme/HGamer3D-Scheme.cabal @@ -0,0 +1,33 @@ +Name: HGamer3D-Scheme +Version: 0.4.0 +Synopsis: Game Engine for the Haskell Programmer - Data Scheme Definitions +Description: + HGamer3D is a game engine for developing 3D games in the programming + language Haskell. HGamer3D is available on Windows and Linux. This + package provides functional data schemes for HGamer3D. + +License: OtherLicense +License-file: LICENSE +Author: Peter Althainz +Maintainer: althainz@gmail.com +Build-Type: Simple +Cabal-Version: >=1.4 +Homepage: http://www.hgamer3d.org +Category: Game Engine +Extra-source-files: Setup.hs + +Library + Build-Depends: base >= 3 && < 5, containers, mtl, template-haskell, indents, parsec, lens, HGamer3D-Data >= 0.4.0 && < 0.5.0 + + Exposed-modules: HGamer3D.Scheme.Scene, HGamer3D.Scheme.Geometry, HGamer3D.Scheme.Material, HGamer3D.Scheme.Colour, HGamer3D.Scheme.Texture, HGamer3D.Scheme.Node, HGamer3D.Scheme.Camera, HGamer3D.Scheme.Light, HGamer3D.Scheme.Parser + + Other-modules: + + c-sources: + + ghc-options: + cc-options: -Wno-attributes + hs-source-dirs: . + Include-dirs: . + build-depends: + extra-libraries: diff --git a/Scheme/HGamer3D/Scheme/Camera.hs b/Scheme/HGamer3D/Scheme/Camera.hs new file mode 100644 index 0000000..bfe126a --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Camera.hs @@ -0,0 +1,45 @@ +{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Camera.hs + +-- | Types which describe the Scene, the high level of a Scene Tree +module HGamer3D.Scheme.Camera + +where + +import HGamer3D.Data as Dat +import HGamer3D.Util +import Control.Lens + +-- | The camera type +data Camera = Camera { + _frustum :: Frustum -- ^ Frustum of the camera + } deriving (Eq, Show) + +data Frustum = Frustum { + _nearDistance :: Float, + _farDistance :: Float, + _fieldOfViewHorizontal :: Dat.Angle } deriving (Eq, Show) + +$(makeLenses ''Camera) +$(makeLenses ''Frustum) + + diff --git a/Scheme/HGamer3D/Scheme/Colour.hs b/Scheme/HGamer3D/Scheme/Colour.hs new file mode 100644 index 0000000..9dec1da --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Colour.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Colour.hs + +-- | Types which describe Colourss, Colour is defined in HGamer3D.Data but we need the ColourSlot +module HGamer3D.Scheme.Colour + +where + +import qualified HGamer3D.Data as D +import Control.Lens + +-- | Slot, a name for a colour, to cross-reference materials in Nodes, ... +type ColourSlot = String + + diff --git a/Scheme/HGamer3D/Scheme/Geometry.hs b/Scheme/HGamer3D/Scheme/Geometry.hs new file mode 100644 index 0000000..bdfeb6f --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Geometry.hs @@ -0,0 +1,62 @@ +{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Scene.hs + +-- | Types which describe the Geometry +module HGamer3D.Scheme.Geometry + +where + +import qualified HGamer3D.Data as D + +import Control.Lens + +import HGamer3D.Data.Vector.Instances + +-- | Geometry Type +data Geometry = MeshGeometry Mesh -- ^ a Mesh as Geometry + | LineGeometry Line -- ^ a Line as Geometry + | PrimitiveGeometry Primitive -- ^ a Geometry Primitive, like Cube or Sphere + deriving (Eq, Show) + +-- | Primitive Geometries, Solids +data Primitive = Cuboid Float + | Cube D.Vec3 + | Sphere Float + | Cylinder D.Vec2 + | Cone D.Vec2 + | SquarePyramid D.Vec2 + | TriangularPyramid D.Vec2 + deriving (Eq, Show) + +-- | A Mesh +data Mesh = ResourceMesh String + deriving (Eq, Show) + +-- | A Line +data Line = Line D.Vec3 D.Vec3 deriving (Eq, Show) + +$(makePrisms ''Geometry) +$(makePrisms ''Primitive) +$(makePrisms ''Mesh) +$(makePrisms ''Line) + + diff --git a/Scheme/HGamer3D/Scheme/Light.hs b/Scheme/HGamer3D/Scheme/Light.hs new file mode 100644 index 0000000..7a7843c --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Light.hs @@ -0,0 +1,47 @@ +{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Scene.hs + +-- | Types which describe the Scene, the high level of a Scene Tree +module HGamer3D.Scheme.Light + +where + +import HGamer3D.Data as Dat +import HGamer3D.Util +import Control.Lens + +-- | The Light data type +data Light = PLight PointLight -- ^ a point light + | SLight SpotLight -- ^ a spot light + deriving (Eq, Show) + +data PointLight = PointLight { + } deriving (Eq, Show) + +data SpotLight = SpotLight { + } deriving (Eq, Show) + +$(makePrisms ''Light) +$(makeLenses ''PointLight) +$(makeLenses ''SpotLight) + + diff --git a/Scheme/HGamer3D/Scheme/Material.hs b/Scheme/HGamer3D/Scheme/Material.hs new file mode 100644 index 0000000..41a7f1f --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Material.hs @@ -0,0 +1,40 @@ +{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Material.hs + +-- | Types which describe Materials +module HGamer3D.Scheme.Material + +where + +import qualified HGamer3D.Data as D +import Control.Lens + +-- | Slot, a name for a material, to cross-reference materials in Nodes, ... +type MaterialSlot = String + +-- | The material itself +data Material = ResourceMaterial String -- ^ the name given the material resource in the reource system + deriving (Eq, Show) + +$(makePrisms ''Material) + + diff --git a/Scheme/HGamer3D/Scheme/Node.hs b/Scheme/HGamer3D/Scheme/Node.hs new file mode 100644 index 0000000..22d96a3 --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Node.hs @@ -0,0 +1,67 @@ +{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Node.hs + +-- | Types which describe Materials +module HGamer3D.Scheme.Node + +where + +import qualified HGamer3D.Data as Dat +import HGamer3D.Data.Vector.Instances +import qualified Data.Map as Map +import Control.Lens + +import qualified HGamer3D.Scheme.Material as Mat +import qualified HGamer3D.Scheme.Texture as Tex +import qualified HGamer3D.Scheme.Colour as Col +import qualified HGamer3D.Scheme.Light as Li +import qualified HGamer3D.Scheme.Camera as Cam +import qualified HGamer3D.Scheme.Scene as Sc +import qualified HGamer3D.Scheme.Geometry as Geo + +deriving instance Eq Dat.UnitQuaternion + + +-- | a SceneNode, making up the scene hierarchy and their spacial layout +data Node = Node { + _position :: Dat.Vec3, + _size :: Dat.Vec3, + _orientation :: Dat.UnitQuaternion, + + _materials :: Map.Map Mat.MaterialSlot Mat.Material, -- ^ slots for Materials, referenced by Geometries + _textures :: Map.Map Tex.TextureSlot Tex.Texture, -- ^ slots for Textures, referenced by Materials and Geometries directly + _colours :: Map.Map Col.ColourSlot Dat.Colour, -- ^ slots for Colours, referenced by Materials and Geometries directly + + _attributes :: [NodeAttribute], -- ^ attributes are the "content" of the node + _children :: [Node] -- ^ child nodes, make up the hierarchy + } deriving (Eq, Show) + +data NodeAttribute = SceneAttribute Sc.Scene -- ^ A node, which contains all scene info, like coordinate system + | CameraAttribute Cam.Camera -- ^ Camera + | LightAttribute Li.Light -- ^ Light + | GeometryAttribute Geo.Geometry -- ^ All types of Geometry: Meshes, Lines, ... + deriving (Eq, Show) + +$(makeLenses ''Node) +$(makePrisms ''NodeAttribute) + + diff --git a/Scheme/HGamer3D/Scheme/Parser.hs b/Scheme/HGamer3D/Scheme/Parser.hs new file mode 100644 index 0000000..3226d90 --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Parser.hs @@ -0,0 +1,447 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Parser.hs + +-- | The Parser to implement a DSL for describing the Scene inclusive all nodes in text +module HGamer3D.Scheme.Parser ( +parseScene +) + +where + +import qualified HGamer3D.Data as Dat +import qualified Data.Map as Map + +import qualified HGamer3D.Scheme.Material as Mat +import qualified HGamer3D.Scheme.Texture as Tex +import qualified HGamer3D.Scheme.Colour as Col +import qualified HGamer3D.Scheme.Light as Li +import qualified HGamer3D.Scheme.Camera as Cam +import qualified HGamer3D.Scheme.Scene as Sc +import qualified HGamer3D.Scheme.Geometry as Geo +import qualified HGamer3D.Scheme.Node as No + + +import Text.Parsec hiding (State) +import Control.Applicative hiding ((<|>), many, optional) +import Text.Parsec.Combinator +import Text.Parsec.Indent + +import Control.Monad.State +import Control.Lens + +-- import HGamer3D.Graphics3D.Base +-- import HGamer3D.Graphics3D.Light +-- import HGamer3D.Graphics3D.Shapes +-- import HGamer3D.Graphics3D.PlatonShapes + +{-- + +The parser for generating a Node in the code, the syntax resembles the following example: + +Scene + + coordinate YUpRight + AmbientLight + colour + ... + + position 0.0 3.0 2.0 + orientation 0.2 0.1 0.2 + size 1.0 1.0 1.0 + + Material + resource "material resource" + + Colour + rgb 0.0 2.3 3.0 | pink ... + alpha 0.3 + + Texture + resource "Texture resource" + + Children + + Camera + position 0.0 3.0 2.0 + orientation 0.2 0.1 0.2 30.0 + Frustum + nearclip 0.3 + farclip 10.0 + fov 0.3 + + PointLight + colour + + ResourceMesh + material + colour + resource "resource x" + texture + + Line + colour + start 0.0 1.0 0.0 + end 10.0 10.0 10.0 + + Cuboid + + + Cube + + +--} + +-- we need separate types for this tree to parse them correctly +--------------------------------------------------------------- + +data ParseContent = PCPosition Dat.Vec3 + | PCSize Dat.Vec3 + | PCOrientation Dat.UnitQuaternion + | PCCoordinate Sc.CoordinateSystem + | PCNear Float + | PCFar Float + | PCFoV Dat.Angle + | PCAlpha Float + | PCRGB Float Float Float + | PCResource String + + | PCMaterial Mat.MaterialSlot Mat.Material + | PCTexture Tex.TextureSlot Tex.Texture + | PCColour Col.ColourSlot Dat.Colour + + | PCFrustumBlock Cam.Frustum + + | PCNode No.Node + | PCChildren [No.Node] + +type IParser a = ParsecT String () (State SourcePos) a + +-- float parsing +---------------- + +(<++>) a b = (++) <$> a <*> b +(<:>) a b = (:) <$> a <*> b + +number = many1 digit + +plus = char '+' *> number + +minus = char '-' <:> number + +integer = plus <|> minus <|> number + +float = fmap rd $ integer <++> decimal <++> exponent + where rd = read :: String -> Float + decimal = option "" $ char '.' <:> number + exponent = option "" $ oneOf "eE" <:> integer + +-- parsing all Node specific elements (there is no "Node" blok or line, to be parsed) +------------------------------------------------------------------------------------- + +aNodeLine :: IParser ParseContent +aNodeLine = aPosition + <|> aOrientation + <|> aSize + <|> aNodeBlock + +aSize :: IParser ParseContent +aSize = do + string "size" >> spaces + vec3 <- aVec3 + return $ PCSize vec3 + +aOrientation :: IParser ParseContent +aOrientation = do + string "orientation" + spaces + vec3 <- aVec3 + spaces + rotation <- float + return $ PCOrientation (Dat.rotU vec3 rotation) + +aPosition :: IParser ParseContent +aPosition = do + string "position" + spaces + vec3 <- aVec3 + return $ PCPosition vec3 + +aVec3 :: IParser Dat.Vec3 +aVec3 = do + x <- float + spaces + y <- float + spaces + z <- float + return $ Dat.Vec3 x y z + +aNodeBlock :: IParser ParseContent +aNodeBlock = aChildrenBlock + <|> aTextureBlock + <|> aColourBlock + <|> aMaterialBlock + +aChildrenBlock :: IParser ParseContent +aChildrenBlock = spaces *> (withBlock makeChildren (string "Children") aChildrenLine) + +aChildrenLine :: IParser ParseContent +aChildrenLine = aCameraBlock +-- <|> aPointLightBlock +-- <|> aSpotLighBlock +-- <|> aResourceMeshBlock +-- <|> aCubeLine +-- <|> aSphereLine +-- <|> aPlaneLine +-- <|> aLineLine + +makeChildren :: String -> [ParseContent] -> ParseContent +makeChildren _ lines = let + nodes = [] + nodes' = foldl mfun nodes lines where + mfun n line = case line of + PCNode no -> (no : n) + in PCChildren nodes' + +defaultNode :: No.Node +defaultNode = No.Node Dat.vec3Zero Dat.vec3U Dat.unitU (Map.fromList []) (Map.fromList []) (Map.fromList []) [] [] + +makeNode :: [ParseContent] -> No.Node +makeNode lines = let + node = defaultNode + node' = foldl mfun node lines where + mfun n line = case line of + PCPosition p -> (No.position .~ p) n + PCSize s -> (No.size .~ s) n + PCOrientation o -> (No.orientation .~ o) n + + PCMaterial name mat -> (No.materials . at name ?~ mat) n + PCTexture name tex -> (No.textures . at name ?~ tex) n + PCColour name col -> (No.colours . at name ?~ col) n + + PCChildren nodes -> (No.children .~ nodes) n + _ -> n -- this function is used with lines, which contain more than Node lines ! + in node' + +-- Node specific, parse the material type + +aMaterialBlock = aResourceMaterialBlock + +aResourceMaterialBlock :: IParser ParseContent +aResourceMaterialBlock = do + spaces + mat <- withBlock makeResourceMaterial (aSpecificSlot "Material") aResourceLine + return mat + +makeResourceMaterial :: String -> [ParseContent] -> ParseContent +makeResourceMaterial slotname lines = let + PCResource res = lines !! 0 + in PCMaterial slotname (Mat.ResourceMaterial res) + +-- Node specific, parse the colour type + +aColourBlock :: IParser ParseContent +aColourBlock = do + spaces + col <- withBlock makeColour (aSpecificSlot "Colour") aColourLine + return col + +aColourLine = aAlpha + <|> aRGB +-- <|> aNamedColour + +aAlpha :: IParser ParseContent +aAlpha = do + string "alpha" + spaces + alpha <- float + return $ PCAlpha alpha + +aRGB :: IParser ParseContent +aRGB = do + string "rgb" + spaces + r <- float + spaces + g <- float + spaces + b <- float + return $ PCRGB r g b + +defaultColour = Dat.Colour 1.0 1.0 1.0 1.0 + +makeColour :: String -> [ParseContent] -> ParseContent +makeColour slotname lines = let + colour = defaultColour + colour' = foldl mfun colour lines where + mfun c line = let + Dat.Colour r g b a = c + in case line of + PCAlpha a' -> Dat.Colour r g b a' + PCRGB r' g' b' -> Dat.Colour r' g' b' a + _ -> c + in PCColour slotname colour' + + + +-- Node specific, parse the texture type + +aTextureBlock = aResourceTextureBlock + +aResourceTextureBlock :: IParser ParseContent +aResourceTextureBlock = do + spaces + tex <- withBlock makeResourceTexture (aSpecificSlot "Texture") aResourceLine + return $ tex + +aSpecificSlot :: String -> IParser String +aSpecificSlot slotname = do + string slotname + spaces + name <- many1 (oneOf (['a'..'z']++['A'..'Z'])) + return name + +aResourceLine :: IParser ParseContent +aResourceLine = do + spaces + string "resource" + spaces + char '"' + name <- many1 (Text.Parsec.noneOf "\"") + char '"' + return $ PCResource name + +makeResourceTexture :: String -> [ParseContent] -> ParseContent +makeResourceTexture slotname lines = let + PCResource res = lines !! 0 + in PCTexture slotname (Tex.ResourceTexture res) + +-- parse the scene type +----------------------- + +parseScene input = runIndent "" $ runParserT aScene () "" input + +defaultScene :: Sc.Scene +defaultScene = Sc.Scene Sc.YUpRight + +aScene :: IParser No.Node +aScene = spaces *> (withBlock makeSceneNode (string "Scene" <* spaces) aSceneLine ) + +makeSceneNode :: String -> [ParseContent] -> No.Node +makeSceneNode _ lines = let + scene = defaultScene + scene' = foldl mfun scene lines where + mfun s line = case line of + PCCoordinate c -> (Sc.coordinate .~ c) s + _ -> s + node = makeNode lines + node' = (No.attributes .~ [No.SceneAttribute scene']) node + in node' + +-- be careful, lines in "withBlock"s need spaces at the end, not at the beginning +-- since block function checks each line position before (!) parsing the line! + +aSceneLine :: IParser ParseContent +aSceneLine = (aCoordinate + <|> aNodeLine) <* spaces + +aCoordinate :: IParser ParseContent +aCoordinate = do + string "coordinate" + spaces + typStr <- string "YUpRight" <|> string "YUpLeft" <|> string "ZUpRight" + let coord = case typStr of + "YUpRight" -> Sc.YUpRight + "YUpLeft" -> Sc.YUpLeft + "ZUpRight" -> Sc.ZUpRight + return $ PCCoordinate coord + + + +-- parse the camera type +------------------------ + +defaultCamera :: Cam.Camera +defaultCamera = Cam.Camera defaultFrustum + +aCameraBlock :: IParser ParseContent +aCameraBlock = spaces *> (withBlock makeCameraNode (string "Camera") aCameraLine) + +aCameraLine :: IParser ParseContent +aCameraLine = aFrustumBlock + <|> aPosition -- similar to aNodeLine, but without size, makes no sense for Camera + <|> aOrientation + <|> aNodeBlock + +makeCameraNode :: String -> [ParseContent] -> ParseContent +makeCameraNode _ lines = let + camera = defaultCamera + camera' = foldl mfun camera lines where + mfun cam line = case line of + PCFrustumBlock fr -> (Cam.frustum .~ fr) cam + node = makeNode lines + node' = (No.attributes .~ [No.CameraAttribute camera']) node + in PCNode node' + +-- parse the frustum type +------------------------- + +defaultFrustum :: Cam.Frustum +defaultFrustum = Cam.Frustum 0.0 10000.0 (Dat.Deg 30.0) + +aFrustumBlock :: IParser ParseContent +aFrustumBlock = spaces *> (withBlock makeFrustum (string "Frustum") aFrustumLine) + +aFrustumLine :: IParser ParseContent +aFrustumLine = aNearLine + <|> aFarLine + <|> aFoVLine + +aNearLine :: IParser ParseContent +aNearLine = do + string "nearclip" + spaces + clip <- float + return $ PCNear clip + +aFarLine :: IParser ParseContent +aFarLine = do + string "farclip" + spaces + clip <- float + return $ PCFar clip + +aFoVLine :: IParser ParseContent +aFoVLine = do + string "fov" + spaces + fov <- float + return $ PCFoV (Dat.Rad fov) + +makeFrustum :: String -> [ParseContent] -> ParseContent +makeFrustum _ lines = let + frustum = defaultFrustum + frustum' = foldl mfun frustum lines where + mfun f line = case line of + PCNear n -> (Cam.nearDistance .~ n) f + PCFar fa -> (Cam.farDistance .~ fa) f + PCFoV fov -> (Cam.fieldOfViewHorizontal .~ fov) f + in PCFrustumBlock frustum' + + diff --git a/Scheme/HGamer3D/Scheme/Scene.hs b/Scheme/HGamer3D/Scheme/Scene.hs new file mode 100644 index 0000000..6e92c20 --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Scene.hs @@ -0,0 +1,47 @@ +{-# LANGUAGE FlexibleContexts, StandaloneDeriving, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, TemplateHaskell #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Scene.hs + +-- | Types which describe the Scene, the high level of a Scene Tree +module HGamer3D.Scheme.Scene + +where + +import HGamer3D.Data +import HGamer3D.Util + +import Control.Lens + +-- | The type of coordinate system +data CoordinateSystem = YUpRight -- ^ Y achsis up, right handed, like many 3D modelling programs and game engines (Ogre) + | ZUpRight -- ^ Z achsis up, right handed, like Blender and typical CAD programs + | YUpLeft -- ^ Y achsis up, z into the screen, this is a left handed coordinate system (exotic) + deriving (Eq, Show) + +-- | The Scene, high level construct of scene tree +data Scene = Scene { + _sceneCoordinate :: CoordinateSystem -- ^ the coordinate system, used in this scene +} deriving (Eq, Show) + +$(makePrisms ''CoordinateSystem) +$(makeFields ''Scene) + + diff --git a/Scheme/HGamer3D/Scheme/Texture.hs b/Scheme/HGamer3D/Scheme/Texture.hs new file mode 100644 index 0000000..9e49cee --- /dev/null +++ b/Scheme/HGamer3D/Scheme/Texture.hs @@ -0,0 +1,39 @@ +{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Texture.hs + +-- | Types which describe Textures +module HGamer3D.Scheme.Texture + +where + +import qualified HGamer3D.Data as D +import Control.Lens + +-- | Slot, a name for a texture, to cross-reference materials in Nodes, ... +type TextureSlot = String + +-- | The Texture itself +data Texture = ResourceTexture String -- ^ the name given the material resource in the resource system + deriving (Eq, Show) + +$(makePrisms ''Texture) + diff --git a/Scheme/LICENSE b/Scheme/LICENSE new file mode 100644 index 0000000..ab17386 --- /dev/null +++ b/Scheme/LICENSE @@ -0,0 +1,34 @@ +LICENSE +------- + +(c) 2011-2014 Peter Althainz + + +HGamer3D (http://www.hgamer3d.org) +---------------------------------- + +HGamer3D is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + +Source Code +----------- +You can obtain the latest version of the source code under http://www.bitbucket.org/althainz/HGamer3D + + +Open Source Software Used - Module HGamer3D.Data +------------------------------------------------ + +HGamer3D uses a number of open source software libraries. You are responsible to comply to the licenses of those packages and the licenses of software used by those packages if you use HGamer3D. + +The HGamer3D.Data module uses the following Haskell libraries from Hackage: + +base, license: BSD3 +FindBin, license: BSD3 +directory, license: BSD3 +filepath, license: BSD3 +vect, license: license: BSD3 + diff --git a/Scheme/SConstruct b/Scheme/SConstruct new file mode 100644 index 0000000..ce505f3 --- /dev/null +++ b/Scheme/SConstruct @@ -0,0 +1,31 @@ +# SConstruct file to build Haskell packages +# ######################################### + +# set environment +################# +from os.path import expanduser +import os +home = expanduser("~") +env = Environment() +env["ENV"]["PATH"] = os.environ.get("PATH") +env["ENV"]["HOME"] = os.environ.get("HOME") + +# Gather main dependencies +########################## + +dependsOn = [ + Glob("HGamer3D/*"), + Glob("HGamer3D/Scheme/*"), + Glob("*.cabal"), + "LICENSE" +] + +target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] + +env.Command(target, dependsOn, [ +"cabal configure --user", +"cabal build", +"cabal haddock", +"cabal install --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", +"cabal sdist" +]) diff --git a/Scheme/Setup.hs b/Scheme/Setup.hs new file mode 100644 index 0000000..5c383dc --- /dev/null +++ b/Scheme/Setup.hs @@ -0,0 +1,22 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Setup.hs + +import Distribution.Simple +main = defaultMain From 2436955708ba57cf2792d729c06c36116f3dd7ce Mon Sep 17 00:00:00 2001 From: urs-of-the-backwoods Date: Thu, 29 May 2014 13:04:51 +0200 Subject: [PATCH 02/28] Merge master 64 bit changes, SConstruct updates, API changes, GUI --- Audio/HGamer3D-Audio.cabal | 6 +- Audio/HGamer3D/Audio.hs | 245 +--------- Audio/HGamer3D/Audio/Internal/Base.hs | 303 ++++++++++++ Audio/SConstruct | 16 +- Bindings-HBind-Source/CEGUI/CEGUI.cfg | 4 +- .../CEGUI/Templates/sconssource.tmpl | 9 +- Bindings-HBind-Source/Enet/Enet.cfg | 4 +- .../Enet/Templates/sconssource.tmpl | 9 +- .../Ogre/Deps/FindFreetype.patch | 14 + Bindings-HBind-Source/Ogre/Deps/SConstruct | 8 +- Bindings-HBind-Source/Ogre/Ogre.cfg | 8 +- .../Ogre/Source/HG3DUtilities.cpp | 4 +- .../Ogre/Source/HG3DUtilities.h | 2 +- .../Ogre/Templates/sconssource.tmpl | 10 +- Bindings-HBind-Source/SDL2/SDL2.cfg | 43 +- .../SDL2/Templates/sconssource.tmpl | 10 +- Bindings-HBind-Source/SFML/SFML.cfg | 4 +- .../SFML/Templates/sconssource.tmpl | 10 +- Bindings/CEGUI/cBuild/ClassCheckbox.cpp | 2 +- Bindings/CEGUI/cBuild/ClassComboDropList.cpp | 2 +- Bindings/CEGUI/cBuild/ClassCombobox.cpp | 2 +- Bindings/CEGUI/cBuild/ClassDefaultLogger.cpp | 2 +- .../cBuild/ClassDefaultResourceProvider.cpp | 2 +- Bindings/CEGUI/cBuild/ClassDragContainer.cpp | 2 +- Bindings/CEGUI/cBuild/ClassEditbox.cpp | 2 +- Bindings/CEGUI/cBuild/ClassEventArgs.cpp | 2 +- Bindings/CEGUI/cBuild/ClassEventSet.cpp | 2 +- Bindings/CEGUI/cBuild/ClassFont.cpp | 2 +- Bindings/CEGUI/cBuild/ClassFontManager.cpp | 2 +- Bindings/CEGUI/cBuild/ClassFrameWindow.cpp | 2 +- .../CEGUI/cBuild/ClassHG3DEventController.cpp | 2 +- .../cBuild/ClassHG3DEventStaticFunctions.cpp | 2 +- .../ClassHG3DListboxStaticFunctions.cpp | 2 +- .../cBuild/ClassHG3DWindowStaticFunctions.cpp | 2 +- Bindings/CEGUI/cBuild/ClassImageCodec.cpp | 2 +- Bindings/CEGUI/cBuild/ClassImageset.cpp | 2 +- Bindings/CEGUI/cBuild/ClassItemEntry.cpp | 2 +- Bindings/CEGUI/cBuild/ClassItemListbox.cpp | 2 +- Bindings/CEGUI/cBuild/ClassListHeader.cpp | 2 +- .../CEGUI/cBuild/ClassListHeaderSegment.cpp | 2 +- Bindings/CEGUI/cBuild/ClassListbox.cpp | 5 +- Bindings/CEGUI/cBuild/ClassListboxItem.cpp | 2 +- .../CEGUI/cBuild/ClassListboxTextItem.cpp | 2 +- Bindings/CEGUI/cBuild/ClassLogger.cpp | 2 +- Bindings/CEGUI/cBuild/ClassMenuBase.cpp | 2 +- Bindings/CEGUI/cBuild/ClassMenuItem.cpp | 2 +- .../CEGUI/cBuild/ClassMultiColumnList.cpp | 2 +- .../CEGUI/cBuild/ClassMultiLineEditbox.cpp | 2 +- Bindings/CEGUI/cBuild/ClassOgreRenderer.cpp | 2 +- .../cBuild/ClassOgreResourceProvider.cpp | 2 +- Bindings/CEGUI/cBuild/ClassProgressBar.cpp | 2 +- Bindings/CEGUI/cBuild/ClassPropertySet.cpp | 2 +- Bindings/CEGUI/cBuild/ClassPtr.cpp | 2 +- Bindings/CEGUI/cBuild/ClassPushButton.cpp | 2 +- Bindings/CEGUI/cBuild/ClassRadioButton.cpp | 2 +- Bindings/CEGUI/cBuild/ClassRenderer.cpp | 2 +- .../CEGUI/cBuild/ClassResourceProvider.cpp | 2 +- Bindings/CEGUI/cBuild/ClassScheme.cpp | 2 +- Bindings/CEGUI/cBuild/ClassSchemeManager.cpp | 2 +- Bindings/CEGUI/cBuild/ClassScriptFunctor.cpp | 2 +- Bindings/CEGUI/cBuild/ClassScriptModule.cpp | 2 +- Bindings/CEGUI/cBuild/ClassScrollablePane.cpp | 2 +- Bindings/CEGUI/cBuild/ClassScrollbar.cpp | 2 +- .../CEGUI/cBuild/ClassScrolledContainer.cpp | 2 +- .../cBuild/ClassScrolledItemListBase.cpp | 2 +- Bindings/CEGUI/cBuild/ClassSlider.cpp | 2 +- Bindings/CEGUI/cBuild/ClassSpinner.cpp | 2 +- Bindings/CEGUI/cBuild/ClassSystem.cpp | 2 +- Bindings/CEGUI/cBuild/ClassSystemHG3D.cpp | 2 +- Bindings/CEGUI/cBuild/ClassTabButton.cpp | 2 +- Bindings/CEGUI/cBuild/ClassThumb.cpp | 2 +- Bindings/CEGUI/cBuild/ClassTooltip.cpp | 2 +- Bindings/CEGUI/cBuild/ClassTree.cpp | 2 +- .../CEGUI/cBuild/ClassWidgetLookManager.cpp | 2 +- Bindings/CEGUI/cBuild/ClassWindow.cpp | 2 +- Bindings/CEGUI/cBuild/ClassWindowManager.cpp | 2 +- .../CEGUI/cBuild/ClassWindowManagerHG3D.cpp | 2 +- Bindings/CEGUI/cBuild/ClassXMLParser.cpp | 2 +- Bindings/CEGUI/cBuild/SConstruct | 12 +- .../CEGUI/cBuild/include/CEGUIDllDefines.h | 12 +- Bindings/CEGUI/cBuild/include/ClassListbox.h | 3 +- .../CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal | 12 +- Bindings/CEGUI/hBuild/SConstruct | 9 +- .../CEGUI/hBuild/include/CEGUIDllDefines.h | 12 +- Bindings/CEGUI/hBuild/include/ClassListbox.h | 3 +- Bindings/Enet/cBuild/SConstruct | 12 +- Bindings/Enet/cBuild/include/EnetDllDefines.h | 12 +- .../Enet/hBuild/HGamer3D-Enet-Binding.cabal | 12 +- Bindings/Enet/hBuild/SConstruct | 9 +- Bindings/Enet/hBuild/include/EnetDllDefines.h | 12 +- Bindings/Ogre/Deps/FindFreetype.patch | 14 + Bindings/Ogre/Deps/SConstruct | 8 +- Bindings/Ogre/cBuild/ClassAnimation.cpp | 22 +- Bindings/Ogre/cBuild/ClassAnimationState.cpp | 28 +- .../Ogre/cBuild/ClassAnimationStateSet.cpp | 19 +- Bindings/Ogre/cBuild/ClassAnimationTrack.cpp | 4 +- Bindings/Ogre/cBuild/ClassArchive.cpp | 12 +- Bindings/Ogre/cBuild/ClassBillboard.cpp | 8 +- Bindings/Ogre/cBuild/ClassBillboardChain.cpp | 44 +- Bindings/Ogre/cBuild/ClassBillboardSet.cpp | 60 +-- Bindings/Ogre/cBuild/ClassBone.cpp | 8 +- Bindings/Ogre/cBuild/ClassCamera.cpp | 28 +- Bindings/Ogre/cBuild/ClassConfigFile.cpp | 8 +- Bindings/Ogre/cBuild/ClassEntity.cpp | 72 +-- Bindings/Ogre/cBuild/ClassException.cpp | 10 +- Bindings/Ogre/cBuild/ClassFrustum.cpp | 24 +- Bindings/Ogre/cBuild/ClassHG3DUtilities.cpp | 10 +- Bindings/Ogre/cBuild/ClassLight.cpp | 8 +- Bindings/Ogre/cBuild/ClassLog.cpp | 18 +- Bindings/Ogre/cBuild/ClassLogManager.cpp | 6 +- Bindings/Ogre/cBuild/ClassManualObject.cpp | 60 +-- .../Ogre/cBuild/ClassManualObjectSection.cpp | 10 +- Bindings/Ogre/cBuild/ClassMaterial.cpp | 34 +- Bindings/Ogre/cBuild/ClassMaterialManager.cpp | 6 +- Bindings/Ogre/cBuild/ClassMesh.cpp | 46 +- Bindings/Ogre/cBuild/ClassMeshManager.cpp | 6 +- Bindings/Ogre/cBuild/ClassMovableObject.cpp | 84 ++-- .../Ogre/cBuild/ClassMovableObjectFactory.cpp | 8 +- .../Ogre/cBuild/ClassMultiRenderTarget.cpp | 6 +- Bindings/Ogre/cBuild/ClassNode.cpp | 16 +- .../Ogre/cBuild/ClassNodeAnimationTrack.cpp | 10 +- Bindings/Ogre/cBuild/ClassRenderSystem.cpp | 56 +-- Bindings/Ogre/cBuild/ClassRenderTarget.cpp | 70 +-- Bindings/Ogre/cBuild/ClassRenderWindow.cpp | 64 +-- Bindings/Ogre/cBuild/ClassRenderable.cpp | 32 +- Bindings/Ogre/cBuild/ClassResource.cpp | 38 +- .../Ogre/cBuild/ClassResourceGroupManager.cpp | 40 +- Bindings/Ogre/cBuild/ClassResourceManager.cpp | 30 +- Bindings/Ogre/cBuild/ClassRoot.cpp | 71 +-- Bindings/Ogre/cBuild/ClassSceneManager.cpp | 208 ++++---- Bindings/Ogre/cBuild/ClassSceneNode.cpp | 20 +- Bindings/Ogre/cBuild/ClassSkeleton.cpp | 20 +- Bindings/Ogre/cBuild/ClassTextureManager.cpp | 6 +- Bindings/Ogre/cBuild/ClassTimeIndex.cpp | 8 +- .../Ogre/cBuild/ClassVertexAnimationTrack.cpp | 8 +- Bindings/Ogre/cBuild/ClassViewport.cpp | 80 +-- Bindings/Ogre/cBuild/HG3DUtilities.cpp | 4 +- Bindings/Ogre/cBuild/SConstruct | 12 +- Bindings/Ogre/cBuild/include/ClassAnimation.h | 14 +- .../Ogre/cBuild/include/ClassAnimationState.h | 20 +- .../cBuild/include/ClassAnimationStateSet.h | 9 +- .../Ogre/cBuild/include/ClassAnimationTrack.h | 2 +- Bindings/Ogre/cBuild/include/ClassArchive.h | 6 +- Bindings/Ogre/cBuild/include/ClassBillboard.h | 4 +- .../Ogre/cBuild/include/ClassBillboardChain.h | 30 +- .../Ogre/cBuild/include/ClassBillboardSet.h | 42 +- Bindings/Ogre/cBuild/include/ClassBone.h | 6 +- Bindings/Ogre/cBuild/include/ClassCamera.h | 18 +- .../Ogre/cBuild/include/ClassConfigFile.h | 8 +- Bindings/Ogre/cBuild/include/ClassEntity.h | 44 +- Bindings/Ogre/cBuild/include/ClassException.h | 6 +- Bindings/Ogre/cBuild/include/ClassFrustum.h | 12 +- .../Ogre/cBuild/include/ClassHG3DUtilities.h | 4 +- Bindings/Ogre/cBuild/include/ClassLight.h | 6 +- Bindings/Ogre/cBuild/include/ClassLog.h | 12 +- .../Ogre/cBuild/include/ClassLogManager.h | 6 +- .../Ogre/cBuild/include/ClassManualObject.h | 44 +- .../cBuild/include/ClassManualObjectSection.h | 8 +- Bindings/Ogre/cBuild/include/ClassMaterial.h | 26 +- .../cBuild/include/ClassMaterialManager.h | 4 +- Bindings/Ogre/cBuild/include/ClassMesh.h | 24 +- .../Ogre/cBuild/include/ClassMeshManager.h | 4 +- .../Ogre/cBuild/include/ClassMovableObject.h | 54 +-- .../include/ClassMovableObjectFactory.h | 4 +- .../cBuild/include/ClassMultiRenderTarget.h | 6 +- Bindings/Ogre/cBuild/include/ClassNode.h | 12 +- .../cBuild/include/ClassNodeAnimationTrack.h | 6 +- .../Ogre/cBuild/include/ClassRenderSystem.h | 40 +- .../Ogre/cBuild/include/ClassRenderTarget.h | 40 +- .../Ogre/cBuild/include/ClassRenderWindow.h | 36 +- .../Ogre/cBuild/include/ClassRenderable.h | 20 +- Bindings/Ogre/cBuild/include/ClassResource.h | 22 +- .../include/ClassResourceGroupManager.h | 26 +- .../cBuild/include/ClassResourceManager.h | 22 +- Bindings/Ogre/cBuild/include/ClassRoot.h | 41 +- .../Ogre/cBuild/include/ClassSceneManager.h | 128 ++--- Bindings/Ogre/cBuild/include/ClassSceneNode.h | 16 +- Bindings/Ogre/cBuild/include/ClassSkeleton.h | 12 +- .../Ogre/cBuild/include/ClassTextureManager.h | 4 +- Bindings/Ogre/cBuild/include/ClassTimeIndex.h | 4 +- .../include/ClassVertexAnimationTrack.h | 4 +- Bindings/Ogre/cBuild/include/ClassViewport.h | 48 +- Bindings/Ogre/cBuild/include/HG3DUtilities.h | 2 +- Bindings/Ogre/cBuild/include/OgreDllDefines.h | 12 +- .../Ogre/hBuild/HGamer3D-Ogre-Binding.cabal | 10 +- .../Bindings/Ogre/ClassAnimationStateSet.chs | 5 + .../HGamer3D/Bindings/Ogre/ClassRoot.chs | 5 + Bindings/Ogre/hBuild/SConstruct | 10 +- Bindings/Ogre/hBuild/include/ClassAnimation.h | 14 +- .../Ogre/hBuild/include/ClassAnimationState.h | 20 +- .../hBuild/include/ClassAnimationStateSet.h | 9 +- .../Ogre/hBuild/include/ClassAnimationTrack.h | 2 +- Bindings/Ogre/hBuild/include/ClassArchive.h | 6 +- Bindings/Ogre/hBuild/include/ClassBillboard.h | 4 +- .../Ogre/hBuild/include/ClassBillboardChain.h | 30 +- .../Ogre/hBuild/include/ClassBillboardSet.h | 42 +- Bindings/Ogre/hBuild/include/ClassBone.h | 6 +- Bindings/Ogre/hBuild/include/ClassCamera.h | 18 +- .../Ogre/hBuild/include/ClassConfigFile.h | 8 +- Bindings/Ogre/hBuild/include/ClassEntity.h | 44 +- Bindings/Ogre/hBuild/include/ClassException.h | 6 +- Bindings/Ogre/hBuild/include/ClassFrustum.h | 12 +- .../Ogre/hBuild/include/ClassHG3DUtilities.h | 4 +- Bindings/Ogre/hBuild/include/ClassLight.h | 6 +- Bindings/Ogre/hBuild/include/ClassLog.h | 12 +- .../Ogre/hBuild/include/ClassLogManager.h | 6 +- .../Ogre/hBuild/include/ClassManualObject.h | 44 +- .../hBuild/include/ClassManualObjectSection.h | 8 +- Bindings/Ogre/hBuild/include/ClassMaterial.h | 26 +- .../hBuild/include/ClassMaterialManager.h | 4 +- Bindings/Ogre/hBuild/include/ClassMesh.h | 24 +- .../Ogre/hBuild/include/ClassMeshManager.h | 4 +- .../Ogre/hBuild/include/ClassMovableObject.h | 54 +-- .../include/ClassMovableObjectFactory.h | 4 +- .../hBuild/include/ClassMultiRenderTarget.h | 6 +- Bindings/Ogre/hBuild/include/ClassNode.h | 12 +- .../hBuild/include/ClassNodeAnimationTrack.h | 6 +- .../Ogre/hBuild/include/ClassRenderSystem.h | 40 +- .../Ogre/hBuild/include/ClassRenderTarget.h | 40 +- .../Ogre/hBuild/include/ClassRenderWindow.h | 36 +- .../Ogre/hBuild/include/ClassRenderable.h | 20 +- Bindings/Ogre/hBuild/include/ClassResource.h | 22 +- .../include/ClassResourceGroupManager.h | 26 +- .../hBuild/include/ClassResourceManager.h | 22 +- Bindings/Ogre/hBuild/include/ClassRoot.h | 41 +- .../Ogre/hBuild/include/ClassSceneManager.h | 128 ++--- Bindings/Ogre/hBuild/include/ClassSceneNode.h | 16 +- Bindings/Ogre/hBuild/include/ClassSkeleton.h | 12 +- .../Ogre/hBuild/include/ClassTextureManager.h | 4 +- Bindings/Ogre/hBuild/include/ClassTimeIndex.h | 4 +- .../include/ClassVertexAnimationTrack.h | 4 +- Bindings/Ogre/hBuild/include/ClassViewport.h | 48 +- Bindings/Ogre/hBuild/include/HG3DUtilities.h | 2 +- Bindings/Ogre/hBuild/include/OgreDllDefines.h | 12 +- Bindings/SDL2/cBuild/SConstruct | 12 +- .../SDL2/cBuild/include/EnumSDLLogCategory.h | 51 ++ .../SDL2/cBuild/include/EnumSDLPacketLayout.h | 38 ++ .../SDL2/cBuild/include/EnumSDLPixelFormat.h | 40 ++ Bindings/SDL2/cBuild/include/SDL2DllDefines.h | 12 +- .../SDL2/hBuild/HGamer3D-SDL2-Binding.cabal | 12 +- .../Bindings/SDL2/EnumSDLLogCategory.chs | 41 ++ .../Bindings/SDL2/EnumSDLPacketLayout.chs | 41 ++ .../Bindings/SDL2/EnumSDLPixelFormat.chs | 41 ++ .../HGamer3D/Bindings/SDL2/StructSDLEvent.chs | 1 + Bindings/SDL2/hBuild/SConstruct | 10 +- .../SDL2/hBuild/include/EnumSDLLogCategory.h | 51 ++ .../SDL2/hBuild/include/EnumSDLPacketLayout.h | 38 ++ .../SDL2/hBuild/include/EnumSDLPixelFormat.h | 40 ++ Bindings/SDL2/hBuild/include/SDL2DllDefines.h | 12 +- Bindings/SFML/cBuild/SConstruct | 12 +- Bindings/SFML/cBuild/include/SFMLDllDefines.h | 12 +- .../SFML/hBuild/HGamer3D-SFML-Binding.cabal | 12 +- Bindings/SFML/hBuild/SConstruct | 10 +- Bindings/SFML/hBuild/include/SFMLDllDefines.h | 12 +- Data/HGamer3D-Data.cabal | 1 + Data/HGamer3D/Data.hs | 4 +- Data/HGamer3D/Data/HG3DClass.hs | 7 +- Data/SConstruct | 19 + Examples/Audio/Audio.hs | 6 +- Examples/GUI/GUI-Widgets.hs | 36 +- Examples/Graphics3D/BlueCube.hs | 26 +- Examples/Graphics3D/BumpMappingCube.hs | 12 +- Examples/InputSystem/Joystick.hs | 12 +- Examples/Network/Network-Chat.hs | 4 +- Examples/SConstruct | 4 +- Examples/WinEvent/WinEvent.hs | 10 +- GUI/HGamer3D-GUI.cabal | 6 +- GUI/HGamer3D/GUI.hs | 458 +++--------------- GUI/HGamer3D/GUI/Internal/Base.hs | 431 ++++++++++++++++ GUI/HGamer3D/GUI/Internal/Properties.hs | 135 ++++++ GUI/HGamer3D/GUI/Internal/Widgets.hs | 296 +++++++++++ GUI/SConstruct | 17 +- Graphics3D/HGamer3D-Graphics3D.cabal | 2 +- Graphics3D/HGamer3D/Graphics3D.hs | 61 ++- .../Graphics3D/{ => Internal}/Base.hs | 35 +- .../Graphics3D/{ => Internal}/Light.hs | 11 +- .../Graphics3D/{ => Internal}/PlatonShapes.hs | 21 +- .../Graphics3D/{ => Internal}/Shapes.hs | 9 +- Graphics3D/SConstruct | 18 +- InputSystem/HGamer3D-InputSystem.cabal | 6 +- InputSystem/HGamer3D/InputSystem.hs | 106 +--- .../HGamer3D/InputSystem/Internal/Base.hs | 180 +++++++ InputSystem/SConstruct | 17 +- Main/HGamer3D.cabal | 39 +- Main/HGamer3D/BaseAPI.hs | 48 ++ Main/HGamer3D/Extensions/Schema.hs | 28 ++ Main/HGamer3D/Extensions/Wire.hs | 28 ++ .../Internal/GameLoop.hs} | 37 +- Main/HGamer3D/Modules/Audio.hs | 28 ++ Main/HGamer3D/Modules/InputSystem.hs | 28 ++ Main/HGamer3D/Modules/Network.hs | 28 ++ Main/SConstruct | 21 +- Network/HGamer3D-Network.cabal | 6 +- Network/HGamer3D/Network.hs | 151 +----- Network/HGamer3D/Network/Internal/Base.hs | 191 ++++++++ Network/SConstruct | 18 +- README.md | 1 + .../HGamer3D-Schema.cabal | 9 +- .../HGamer3D/Schema}/Camera.hs | 2 +- .../HGamer3D/Schema}/Colour.hs | 2 +- .../HGamer3D/Schema}/Geometry.hs | 2 +- .../HGamer3D/Schema}/Light.hs | 2 +- .../HGamer3D/Schema}/Material.hs | 2 +- .../Scheme => Schema/HGamer3D/Schema}/Node.hs | 16 +- .../HGamer3D/Schema}/Parser.hs | 18 +- .../HGamer3D/Schema}/Scene.hs | 2 +- .../HGamer3D/Schema}/Texture.hs | 2 +- {Scheme => Schema}/LICENSE | 0 {Scheme => Schema}/SConstruct | 12 +- {Scheme => Schema}/Setup.hs | 0 WinEvent/HGamer3D-WinEvent.cabal | 6 +- WinEvent/HGamer3D/WinEvent.hs | 103 +--- WinEvent/HGamer3D/WinEvent/Internal/Base.hs | 145 ++++++ WinEvent/SConstruct | 13 +- Wire/HGamer3D-Wire.cabal | 4 +- Wire/HGamer3D/Wire.hs | 2 +- Wire/HGamer3D/Wire/ECSWire.hs | 2 +- Wire/HGamer3D/Wire/EntityComponentSystem.hs | 2 +- Wire/HGamer3D/Wire/GUI.hs | 2 +- Wire/HGamer3D/Wire/Types.hs | 2 +- Wire/SConstruct | 18 +- 321 files changed, 4723 insertions(+), 3027 deletions(-) create mode 100644 Audio/HGamer3D/Audio/Internal/Base.hs create mode 100644 Bindings-HBind-Source/Ogre/Deps/FindFreetype.patch create mode 100644 Bindings/Ogre/Deps/FindFreetype.patch create mode 100644 Bindings/SDL2/cBuild/include/EnumSDLLogCategory.h create mode 100644 Bindings/SDL2/cBuild/include/EnumSDLPacketLayout.h create mode 100644 Bindings/SDL2/cBuild/include/EnumSDLPixelFormat.h create mode 100644 Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLLogCategory.chs create mode 100644 Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLPacketLayout.chs create mode 100644 Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLPixelFormat.chs create mode 100644 Bindings/SDL2/hBuild/include/EnumSDLLogCategory.h create mode 100644 Bindings/SDL2/hBuild/include/EnumSDLPacketLayout.h create mode 100644 Bindings/SDL2/hBuild/include/EnumSDLPixelFormat.h create mode 100644 GUI/HGamer3D/GUI/Internal/Base.hs create mode 100644 GUI/HGamer3D/GUI/Internal/Properties.hs create mode 100644 GUI/HGamer3D/GUI/Internal/Widgets.hs rename Graphics3D/HGamer3D/Graphics3D/{ => Internal}/Base.hs (93%) rename Graphics3D/HGamer3D/Graphics3D/{ => Internal}/Light.hs (92%) rename Graphics3D/HGamer3D/Graphics3D/{ => Internal}/PlatonShapes.hs (92%) rename Graphics3D/HGamer3D/Graphics3D/{ => Internal}/Shapes.hs (97%) create mode 100644 InputSystem/HGamer3D/InputSystem/Internal/Base.hs create mode 100644 Main/HGamer3D/BaseAPI.hs create mode 100644 Main/HGamer3D/Extensions/Schema.hs create mode 100644 Main/HGamer3D/Extensions/Wire.hs rename Main/{HGamer3D.hs => HGamer3D/Internal/GameLoop.hs} (72%) create mode 100644 Main/HGamer3D/Modules/Audio.hs create mode 100644 Main/HGamer3D/Modules/InputSystem.hs create mode 100644 Main/HGamer3D/Modules/Network.hs create mode 100644 Network/HGamer3D/Network/Internal/Base.hs rename Scheme/HGamer3D-Scheme.cabal => Schema/HGamer3D-Schema.cabal (64%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Camera.hs (97%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Colour.hs (97%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Geometry.hs (98%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Light.hs (97%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Material.hs (97%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Node.hs (86%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Parser.hs (96%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Scene.hs (98%) rename {Scheme/HGamer3D/Scheme => Schema/HGamer3D/Schema}/Texture.hs (97%) rename {Scheme => Schema}/LICENSE (100%) rename {Scheme => Schema}/SConstruct (69%) rename {Scheme => Schema}/Setup.hs (100%) create mode 100644 WinEvent/HGamer3D/WinEvent/Internal/Base.hs diff --git a/Audio/HGamer3D-Audio.cabal b/Audio/HGamer3D-Audio.cabal index 269eaa4..d9de1d5 100644 --- a/Audio/HGamer3D-Audio.cabal +++ b/Audio/HGamer3D-Audio.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-Audio -Version: 0.3.0 +Version: 0.4.0 Synopsis: Audio Functionality for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,9 +18,9 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.3.0 && < 0.4.0, HGamer3D-SFML-Binding >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-SFML-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Audio + Exposed-modules: HGamer3D.Audio.Internal.Base, HGamer3D.Audio Other-modules: c-sources: diff --git a/Audio/HGamer3D/Audio.hs b/Audio/HGamer3D/Audio.hs index 0014ac4..bb8b248 100644 --- a/Audio/HGamer3D/Audio.hs +++ b/Audio/HGamer3D/Audio.hs @@ -19,14 +19,13 @@ -- Audio.hs --- | Audio functionality for HGamer3D +-- | Audio functionality for HGamer3D, public API. module HGamer3D.Audio ( - -- * Types + -- * Audio Data Types module HGamer3D.Bindings.SFML.EnumSoundSourceStatus, - - AudioSource (..), + AudioSource, -- * Audio Listener Functions setAudioMainVolume, @@ -34,17 +33,17 @@ module HGamer3D.Audio setAudioListenerPosition, setAudioListenerDirection, - -- * Audio Source creation and delete Functions - createMusic, - createSound, - deleteAudioSource, + -- * Audio Source Creation Functions + musicAudioSource, + soundAudioSource, + freeAudioSource, - -- * Audio Source play function + -- * Audio Source Play Functions playAudioSource, pauseAudioSource, stopAudioSource, - -- * Audio Source property functions + -- * Audio Source Property Functions setAudioSourceLoop, getAudioSourceLoop, @@ -70,229 +69,5 @@ module HGamer3D.Audio where -import GHC.Ptr - -import HGamer3D.Data -import HGamer3D.Util - -import HGamer3D.Bindings.SFML.ClassPtr -import HGamer3D.Bindings.SFML.Utils - -import qualified HGamer3D.Bindings.SFML.ClassListener as Listener -import qualified HGamer3D.Bindings.SFML.ClassMusic as Music -import qualified HGamer3D.Bindings.SFML.ClassSound as Sound -import qualified HGamer3D.Bindings.SFML.ClassSoundBuffer as SoundBuffer -import qualified HGamer3D.Bindings.SFML.ClassSoundSource as SoundSource -import qualified HGamer3D.Bindings.SFML.ClassSoundStream as SoundStream - - +import HGamer3D.Audio.Internal.Base import HGamer3D.Bindings.SFML.EnumSoundSourceStatus - -import Control.Monad - - --- Source types - -data AudioSource = Music HG3DClass | Sound HG3DClass HG3DClass - - --- Listener Functions - --- | set overall main audio volume -setAudioMainVolume :: Float -- ^ volume in a scale between 0 and 100.0 - -> IO () -setAudioMainVolume vol = Listener.setGlobalVolume vol - --- | get overall main audio volume -getAudioMainVolume :: IO Float -- ^ volume in a scale between 0 and 100.0 -getAudioMainVolume = Listener.getGlobalVolume - --- | set position of the listener, this is where the \"micro\" is located -setAudioListenerPosition :: Vec3 -- ^ position of listener - -> IO () -setAudioListenerPosition (Vec3 x y z) = Listener.setPosition x y z - --- | set direction of the listener -setAudioListenerDirection :: Vec3 -- ^ direction, in which listener hears - -> IO () -setAudioListenerDirection (Vec3 x y z) = Listener.setDirection x y z - - --- Music Functions, deletion and cretion of Audio types --- - -_findMusicFile filename = do - dirs <- liftM (fmap (++ osSep ++ "sound")) (sequence [getAppMediaDirectory, getExeMediaDirectory]) - filepath <- findFileInDirs filename dirs - return filepath - - - --- | create music (stream source, reading from file) -createMusic :: String -- ^ filename of music - -> IO (Maybe AudioSource) -- ^ audio source, which can be played -createMusic filename = do - music <- Music.new - -- try to find file in hg3d directories - filepath <-_findMusicFile filename - -- try to open - case filepath of - Just f -> do - fOk <- Music.openFromFile music (f) - if fOk then - return (Just (Music music)) - else do - Music.delete music - return Nothing - Nothing -> return Nothing - --- | create sound (stream source, loaded into memory) -createSound :: String -- ^ filename of sound without path - -> IO (Maybe AudioSource) -- ^ audio source, which can be played -createSound filename = do - sound <- Sound.new - buffer <- SoundBuffer.new - filepath <-_findMusicFile filename - -- try to open - case filepath of - Just f -> do - fOk <- SoundBuffer.loadFromFile buffer (f) - if fOk then do - Sound.setBuffer sound buffer - return (Just (Sound sound buffer)) - else do - Sound.delete sound - SoundBuffer.delete buffer - return Nothing - Nothing -> return Nothing - --- | delete audio source -deleteAudioSource :: AudioSource -> IO () -deleteAudioSource (Music music) = do - Music.delete music -deleteAudioSource (Sound sound buffer) = do - Sound.delete sound - SoundBuffer.delete buffer - - --- Source play, pause, stop --- - --- | starts playing audio source -playAudioSource :: AudioSource -- ^the audio source - -> IO () -playAudioSource (Music music) = do - SoundStream.play music -playAudioSource (Sound sound buffer) = do - Sound.play sound - --- | pause playing audio source, remembers location -pauseAudioSource :: AudioSource -> IO () -pauseAudioSource (Music music) = do - SoundStream.pause music -pauseAudioSource (Sound sound buffer) = do - Sound.pause sound - --- | completely stops audio playing -stopAudioSource :: AudioSource -> IO () -stopAudioSource (Music music) = do - SoundStream.stop music -stopAudioSource (Sound sound buffer) = do - Sound.stop sound - --- | is audio play looping -getAudioSourceLoop :: AudioSource -- ^audio source - -> IO Bool -- ^true, loop is enabled, false loop is disabled -getAudioSourceLoop (Music music) = do - fLoop <- SoundStream.getLoop music - return fLoop -getAudioSourceLoop (Sound sound buffer) = do - fLoop <- Sound.getLoop sound - return fLoop - --- | set audio play is looping -setAudioSourceLoop :: AudioSource -- ^audio source - -> Bool -- ^loop enabled - -> IO () -setAudioSourceLoop (Music music) fLoop = do - SoundStream.setLoop music fLoop -setAudioSourceLoop (Sound sound buffer) fLoop = do - Sound.setLoop sound fLoop - - --- Sound Source Functions --- - --- | get volume of a single audio source -getAudioSourceVolume :: AudioSource -- ^audio source - -> IO Float -- ^volume of audio source in scale of 0 to 100.0 - -getAudioSourceVolume (Music s) = SoundSource.getVolume s -getAudioSourceVolume (Sound s b) = SoundSource.getVolume s - --- | set volume of a single audio source -setAudioSourceVolume :: AudioSource -- ^audio source - -> Float -> IO () -- ^volume of this audio source in scale of 0 to 100.0 - -setAudioSourceVolume (Music s) v = SoundSource.setVolume s v -setAudioSourceVolume (Sound s b) v = SoundSource.setVolume s v - --- | get audio source pitch --- the pitch is the frequency of the sound which also influences playing speed. The default value is 1.0. -getAudioSourcePitch :: AudioSource -- ^audio source - -> IO Float -- ^pitch, a 1.0 is no change to original sound - -getAudioSourcePitch (Music s) = SoundSource.getPitch s -getAudioSourcePitch (Sound s b) = SoundSource.getPitch s - --- | sets the pitch of an audio source -setAudioSourcePitch :: AudioSource -> Float -> IO () -setAudioSourcePitch (Music s) p = SoundSource.setPitch s p -setAudioSourcePitch (Sound s b) p = SoundSource.setPitch s p - --- | sets the position of an audio source -setAudioSourcePosition :: AudioSource -- ^audio source - -> Vec3 -> IO () -- ^new position of this source - -setAudioSourcePosition (Music s) (Vec3 x y z) = SoundSource.setPosition s x y z -setAudioSourcePosition (Sound s b) (Vec3 x y z) = SoundSource.setPosition s x y z - --- | gets the position of an audio source -getAudioSourcePosition :: AudioSource -- ^audio source - -> IO Vec3 -- ^position of the audio source - -getAudioSourcePosition (Music s) = SoundSource.getPosition s -getAudioSourcePosition (Sound s b) = SoundSource.getPosition s - --- | gets the attenuation factor of an audio source -getAudioSourceAttenuation :: AudioSource -- ^audio source - -> IO Float -- ^attenuation is the damping factor by distance, default value is 1.0, 0.0 means no damping -getAudioSourceAttenuation (Music s) = SoundSource.getAttenuation s -getAudioSourceAttenuation (Sound s b) = SoundSource.getAttenuation s - --- | sets the attenuation factor of an audio source -setAudioSourceAttenuation :: AudioSource -- ^audio source - -> Float -> IO () -- ^attenuation factor -setAudioSourceAttenuation (Music s) a = SoundSource.setAttenuation s a -setAudioSourceAttenuation (Sound s b) a = SoundSource.setAttenuation s a - --- | gets audio source min distance, distance at which sound is played a volume 100.0 -getAudioSourceMinDistance :: AudioSource -> IO Float -getAudioSourceMinDistance (Music s) = SoundSource.getMinDistance s -getAudioSourceMinDistance (Sound s b) = SoundSource.getMinDistance s - --- | sets audio source min distance, distance at which sound is played a volume 100.0 -setAudioSourceMinDistance :: AudioSource -> Float -> IO () -setAudioSourceMinDistance (Music s) d = SoundSource.setMinDistance s d -setAudioSourceMinDistance (Sound s b) d = SoundSource.setMinDistance s d - --- | set flag if audio source depends on position, default is FALSE (not dependent on position) -setAudioSourcePositionDependent :: AudioSource -> Bool -> IO () -setAudioSourcePositionDependent (Music s) isR = SoundSource.setRelativeToListener s isR -setAudioSourcePositionDependent (Sound s b) isR = SoundSource.setRelativeToListener s isR - --- | get flag if audio source depends on position, default is FALSE (not dependent on position) -isAudioSourcePositionDependent :: AudioSource -> IO Bool -isAudioSourcePositionDependent (Music s) = SoundSource.isRelativeToListener s -isAudioSourcePositionDependent (Sound s b) = SoundSource.isRelativeToListener s - diff --git a/Audio/HGamer3D/Audio/Internal/Base.hs b/Audio/HGamer3D/Audio/Internal/Base.hs new file mode 100644 index 0000000..b5e3995 --- /dev/null +++ b/Audio/HGamer3D/Audio/Internal/Base.hs @@ -0,0 +1,303 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org + +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Audio/Internal/Base.hs + + +-- | Audio functionality for HGamer3D, internal implementation. This module also exports internal data declarations, in case they are needed. Normally you should only use HGamer3D.Audio and import that, which exhibits the public API. + +module HGamer3D.Audio.Internal.Base + +( + -- * Types + module HGamer3D.Bindings.SFML.EnumSoundSourceStatus, + + AudioSource (..), + + -- * Audio Listener Functions + setAudioMainVolume, + getAudioMainVolume, + setAudioListenerPosition, + setAudioListenerDirection, + + -- * Audio Source creation and delete Functions + musicAudioSource, + soundAudioSource, + freeAudioSource, + + -- * Audio Source play function + playAudioSource, + pauseAudioSource, + stopAudioSource, + + -- * Audio Source property functions + setAudioSourceLoop, + getAudioSourceLoop, + + getAudioSourceVolume, + setAudioSourceVolume, + + getAudioSourcePitch, + setAudioSourcePitch, + + getAudioSourcePosition, + setAudioSourcePosition, + + getAudioSourceAttenuation, + setAudioSourceAttenuation, + + getAudioSourceMinDistance, + setAudioSourceMinDistance, + + setAudioSourcePositionDependent, + isAudioSourcePositionDependent + +) + +where + +import GHC.Ptr + +import HGamer3D.Data +import HGamer3D.Data.HG3DClass + +import HGamer3D.Util + +import HGamer3D.Bindings.SFML.ClassPtr +import HGamer3D.Bindings.SFML.Utils + +import qualified HGamer3D.Bindings.SFML.ClassListener as Listener +import qualified HGamer3D.Bindings.SFML.ClassMusic as Music +import qualified HGamer3D.Bindings.SFML.ClassSound as Sound +import qualified HGamer3D.Bindings.SFML.ClassSoundBuffer as SoundBuffer +import qualified HGamer3D.Bindings.SFML.ClassSoundSource as SoundSource +import qualified HGamer3D.Bindings.SFML.ClassSoundStream as SoundStream + + +import HGamer3D.Bindings.SFML.EnumSoundSourceStatus +import HGamer3D.Bindings.SFML.EnumSoundSourceStatus + +import Control.Monad + + +-- Source types + +data AudioSource = Music HG3DClass | Sound HG3DClass HG3DClass + + +-- Listener Functions + +-- | set overall main audio volume +setAudioMainVolume :: Float -- ^ volume in a scale between 0 and 100.0 + -> IO () +setAudioMainVolume vol = Listener.setGlobalVolume vol + +-- | get overall main audio volume +getAudioMainVolume :: IO Float -- ^ volume in a scale between 0 and 100.0 +getAudioMainVolume = Listener.getGlobalVolume + +-- | set position of the listener, this is where the \"micro\" is located +setAudioListenerPosition :: Vec3 -- ^ position of listener + -> IO () +setAudioListenerPosition (Vec3 x y z) = Listener.setPosition x y z + +-- | set direction of the listener +setAudioListenerDirection :: Vec3 -- ^ direction, in which listener hears + -> IO () +setAudioListenerDirection (Vec3 x y z) = Listener.setDirection x y z + + +-- Music Functions, deletion and cretion of Audio types +-- + +_findMusicFile filename = do + dirs <- liftM (fmap (++ osSep ++ "sound")) (sequence [getAppMediaDirectory, getExeMediaDirectory]) + filepath <- findFileInDirs filename dirs + return filepath + + + +-- | create music (stream source, reading from file) +musicAudioSource :: String -- ^ filename of music + -> IO (Maybe AudioSource) -- ^ audio source, which can be played +musicAudioSource filename = do + music <- Music.new + -- try to find file in hg3d directories + filepath <-_findMusicFile filename + -- try to open + case filepath of + Just f -> do + fOk <- Music.openFromFile music (f) + if fOk then + return (Just (Music music)) + else do + Music.delete music + return Nothing + Nothing -> return Nothing + +-- | create sound (stream source, loaded into memory) +soundAudioSource :: String -- ^ filename of sound without path + -> IO (Maybe AudioSource) -- ^ audio source, which can be played +soundAudioSource filename = do + sound <- Sound.new + buffer <- SoundBuffer.new + filepath <-_findMusicFile filename + -- try to open + case filepath of + Just f -> do + fOk <- SoundBuffer.loadFromFile buffer (f) + if fOk then do + Sound.setBuffer sound buffer + return (Just (Sound sound buffer)) + else do + Sound.delete sound + SoundBuffer.delete buffer + return Nothing + Nothing -> return Nothing + +-- | delete audio source +freeAudioSource :: AudioSource -> IO () +freeAudioSource (Music music) = do + Music.delete music +deleteAudioSource (Sound sound buffer) = do + Sound.delete sound + SoundBuffer.delete buffer + + +-- Source play, pause, stop +-- + +-- | starts playing audio source +playAudioSource :: AudioSource -- ^the audio source + -> IO () +playAudioSource (Music music) = do + SoundStream.play music +playAudioSource (Sound sound buffer) = do + Sound.play sound + +-- | pause playing audio source, remembers location +pauseAudioSource :: AudioSource -> IO () +pauseAudioSource (Music music) = do + SoundStream.pause music +pauseAudioSource (Sound sound buffer) = do + Sound.pause sound + +-- | completely stops audio playing +stopAudioSource :: AudioSource -> IO () +stopAudioSource (Music music) = do + SoundStream.stop music +stopAudioSource (Sound sound buffer) = do + Sound.stop sound + +-- | is audio play looping +getAudioSourceLoop :: AudioSource -- ^audio source + -> IO Bool -- ^true, loop is enabled, false loop is disabled +getAudioSourceLoop (Music music) = do + fLoop <- SoundStream.getLoop music + return fLoop +getAudioSourceLoop (Sound sound buffer) = do + fLoop <- Sound.getLoop sound + return fLoop + +-- | set audio play is looping +setAudioSourceLoop :: AudioSource -- ^audio source + -> Bool -- ^loop enabled + -> IO () +setAudioSourceLoop (Music music) fLoop = do + SoundStream.setLoop music fLoop +setAudioSourceLoop (Sound sound buffer) fLoop = do + Sound.setLoop sound fLoop + + +-- Sound Source Functions +-- + +-- | get volume of a single audio source +getAudioSourceVolume :: AudioSource -- ^audio source + -> IO Float -- ^volume of audio source in scale of 0 to 100.0 + +getAudioSourceVolume (Music s) = SoundSource.getVolume s +getAudioSourceVolume (Sound s b) = SoundSource.getVolume s + +-- | set volume of a single audio source +setAudioSourceVolume :: AudioSource -- ^audio source + -> Float -> IO () -- ^volume of this audio source in scale of 0 to 100.0 + +setAudioSourceVolume (Music s) v = SoundSource.setVolume s v +setAudioSourceVolume (Sound s b) v = SoundSource.setVolume s v + +-- | get audio source pitch +-- the pitch is the frequency of the sound which also influences playing speed. The default value is 1.0. +getAudioSourcePitch :: AudioSource -- ^audio source + -> IO Float -- ^pitch, a 1.0 is no change to original sound + +getAudioSourcePitch (Music s) = SoundSource.getPitch s +getAudioSourcePitch (Sound s b) = SoundSource.getPitch s + +-- | sets the pitch of an audio source +setAudioSourcePitch :: AudioSource -> Float -> IO () +setAudioSourcePitch (Music s) p = SoundSource.setPitch s p +setAudioSourcePitch (Sound s b) p = SoundSource.setPitch s p + +-- | sets the position of an audio source +setAudioSourcePosition :: AudioSource -- ^audio source + -> Vec3 -> IO () -- ^new position of this source + +setAudioSourcePosition (Music s) (Vec3 x y z) = SoundSource.setPosition s x y z +setAudioSourcePosition (Sound s b) (Vec3 x y z) = SoundSource.setPosition s x y z + +-- | gets the position of an audio source +getAudioSourcePosition :: AudioSource -- ^audio source + -> IO Vec3 -- ^position of the audio source + +getAudioSourcePosition (Music s) = SoundSource.getPosition s +getAudioSourcePosition (Sound s b) = SoundSource.getPosition s + +-- | gets the attenuation factor of an audio source +getAudioSourceAttenuation :: AudioSource -- ^audio source + -> IO Float -- ^attenuation is the damping factor by distance, default value is 1.0, 0.0 means no damping +getAudioSourceAttenuation (Music s) = SoundSource.getAttenuation s +getAudioSourceAttenuation (Sound s b) = SoundSource.getAttenuation s + +-- | sets the attenuation factor of an audio source +setAudioSourceAttenuation :: AudioSource -- ^audio source + -> Float -> IO () -- ^attenuation factor +setAudioSourceAttenuation (Music s) a = SoundSource.setAttenuation s a +setAudioSourceAttenuation (Sound s b) a = SoundSource.setAttenuation s a + +-- | gets audio source min distance, distance at which sound is played a volume 100.0 +getAudioSourceMinDistance :: AudioSource -> IO Float +getAudioSourceMinDistance (Music s) = SoundSource.getMinDistance s +getAudioSourceMinDistance (Sound s b) = SoundSource.getMinDistance s + +-- | sets audio source min distance, distance at which sound is played a volume 100.0 +setAudioSourceMinDistance :: AudioSource -> Float -> IO () +setAudioSourceMinDistance (Music s) d = SoundSource.setMinDistance s d +setAudioSourceMinDistance (Sound s b) d = SoundSource.setMinDistance s d + +-- | set flag if audio source depends on position, default is FALSE (not dependent on position) +setAudioSourcePositionDependent :: AudioSource -> Bool -> IO () +setAudioSourcePositionDependent (Music s) isR = SoundSource.setRelativeToListener s isR +setAudioSourcePositionDependent (Sound s b) isR = SoundSource.setRelativeToListener s isR + +-- | get flag if audio source depends on position, default is FALSE (not dependent on position) +isAudioSourcePositionDependent :: AudioSource -> IO Bool +isAudioSourcePositionDependent (Music s) = SoundSource.isRelativeToListener s +isAudioSourcePositionDependent (Sound s b) = SoundSource.isRelativeToListener s + diff --git a/Audio/SConstruct b/Audio/SConstruct index b51ca7e..c1755fc 100644 --- a/Audio/SConstruct +++ b/Audio/SConstruct @@ -1,5 +1,5 @@ -# SConstruct file to build Haskell packages -# ######################################### +# SConstruct file to build Haskell packages for Audio module +# ########################################################## # set environment ################# @@ -15,14 +15,22 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - Glob("HGamer3D/*"), + "HGamer3D/Audio.hs", + Glob("HGamer3D/Audio/Internal/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), + Glob("../Bindings/SFML/hBuild/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", + "cabal configure --user", "cabal build", "cabal haddock", diff --git a/Bindings-HBind-Source/CEGUI/CEGUI.cfg b/Bindings-HBind-Source/CEGUI/CEGUI.cfg index b4884cd..d857b66 100644 --- a/Bindings-HBind-Source/CEGUI/CEGUI.cfg +++ b/Bindings-HBind-Source/CEGUI/CEGUI.cfg @@ -546,8 +546,8 @@ items: !!python/unicode "HGamer3D is a game engine for developing 3D games in the programming\ \ \nlanguage Haskell. This module provides the CEGUI Bindings.\nHGamer3D-CEGUI-Binding\ \ is available on Windows and Linux.\n", !!python/unicode 'base >= 3 && < - 5, HGamer3D-Data >= 0.3.0 && < 0.4.0', !!python/unicode 'http://www.hgamer3d.org', - !!python/unicode 'Game Engine, GUI', !!python/unicode '0.3.1'] + 5, HGamer3D-Data >= 0.4.0 && < 0.5.0', !!python/unicode 'http://www.hgamer3d.org', + !!python/unicode 'Game Engine, GUI', !!python/unicode '0.4.0'] /config/namespaces: - class: Namespace values: [!!python/unicode 'namespace CEGUI'] diff --git a/Bindings-HBind-Source/CEGUI/Templates/sconssource.tmpl b/Bindings-HBind-Source/CEGUI/Templates/sconssource.tmpl index 8950d00..3afe8d6 100644 --- a/Bindings-HBind-Source/CEGUI/Templates/sconssource.tmpl +++ b/Bindings-HBind-Source/CEGUI/Templates/sconssource.tmpl @@ -19,12 +19,19 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/CEGUI/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-GUI || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings-HBind-Source/Enet/Enet.cfg b/Bindings-HBind-Source/Enet/Enet.cfg index 39abcee..20c841e 100644 --- a/Bindings-HBind-Source/Enet/Enet.cfg +++ b/Bindings-HBind-Source/Enet/Enet.cfg @@ -120,9 +120,9 @@ items: \ This package provides the Enet binding. \nHGamer3D-Enet-Binding is available\ \ on Windows and Linux. \nThis binding does not claim to have full coverage\ \ of Enet \nfunctionality, but only to support what is needed for the\nHGamer3D-Network\ - \ package.\n", !!python/unicode 'base >= 3 && < 5, HGamer3D-Data >= 0.3.0', + \ package.\n", !!python/unicode 'base >= 3 && < 5, HGamer3D-Data >= 0.4.0', !!python/unicode 'http://www.hgamer3d.org', !!python/unicode 'Game Engine, Network', - !!python/unicode '0.3.2'] + !!python/unicode '0.4.0'] /config/namespaces: [] /config/sourcedirs: - class: Directory diff --git a/Bindings-HBind-Source/Enet/Templates/sconssource.tmpl b/Bindings-HBind-Source/Enet/Templates/sconssource.tmpl index 21804ca..f38eac4 100644 --- a/Bindings-HBind-Source/Enet/Templates/sconssource.tmpl +++ b/Bindings-HBind-Source/Enet/Templates/sconssource.tmpl @@ -19,12 +19,19 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/Enet/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-Network || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings-HBind-Source/Ogre/Deps/FindFreetype.patch b/Bindings-HBind-Source/Ogre/Deps/FindFreetype.patch new file mode 100644 index 0000000..db8f3fe --- /dev/null +++ b/Bindings-HBind-Source/Ogre/Deps/FindFreetype.patch @@ -0,0 +1,14 @@ +34c34 +< set(FREETYPE_LIBRARY_NAMES freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype) +--- +> set(FREETYPE_LIBRARY_NAMES freetype253 freetype252 freetype251 freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype) +46c46 +< find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2) +--- +> find_path(FREETYPE_INCLUDE_DIR NAMES freetype.h freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2) +49,50c49,50 +< find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel) +< find_library(FREETYPE_LIBRARY_DBG NAMES ${FREETYPE_LIBRARY_NAMES_DBG} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug) +--- +> find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel) +> find_library(FREETYPE_LIBRARY_DBG NAMES ${FREETYPE_LIBRARY_NAMES_DBG} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug) diff --git a/Bindings-HBind-Source/Ogre/Deps/SConstruct b/Bindings-HBind-Source/Ogre/Deps/SConstruct index 864ad31..21306f5 100644 --- a/Bindings-HBind-Source/Ogre/Deps/SConstruct +++ b/Bindings-HBind-Source/Ogre/Deps/SConstruct @@ -38,6 +38,10 @@ def linkSO(target, source, env): os.system(cmd) +def patch_findfreetype(target, source, env): + os.system("patch -N -r- ogre_src_v1-8-1/CMake/Packages/FindFreetype.cmake FindFreetype.patch") + return 0 + # download pre-build binaries or source and extract if env["PLATFORM"] == "win32": # download and extract pre-build binaries @@ -63,7 +67,9 @@ else: "md5sum -c md5-ogre || (rm -f ogre-1.8.1.tar.bz2 && exit 1)" ]) # extract all files - env.Command("ogre_src_v1-8-1/OgreMain/src", "ogre-1.8.1.tar.bz2", "tar xjf ogre-1.8.1.tar.bz2") + env.Command("ogre_src_v1-8-1/OgreMain/src", "ogre-1.8.1.tar.bz2", [ + "tar xjf ogre-1.8.1.tar.bz2", + patch_findfreetype ]) # configure and create Makefile env.Command("ogre_src_v1-8-1/Makefile", "ogre_src_v1-8-1/OgreMain/src", [ diff --git a/Bindings-HBind-Source/Ogre/Ogre.cfg b/Bindings-HBind-Source/Ogre/Ogre.cfg index f8aa111..22d69a2 100644 --- a/Bindings-HBind-Source/Ogre/Ogre.cfg +++ b/Bindings-HBind-Source/Ogre/Ogre.cfg @@ -11804,12 +11804,12 @@ items: values: [true] /types/basic: - class: BasicType - values: [!!python/unicode 'TypeInt', !!python/unicode 'int', !!python/unicode 'Int', + values: [!!python/unicode 'TypeInt', !!python/unicode 'long', !!python/unicode 'Int', !!python/unicode 'fromIntegral', !!python/unicode 'peekIntConv', !!python/unicode 'a7d25474-4698-4289-840d-730eaf065439', false, !!python/unicode 'std:string', !!python/unicode 'c_str()', !!python/unicode 'normal integer (two word)', false] - class: BasicType - values: [!!python/unicode 'TypeUnsignedInt', !!python/unicode 'unsigned int', + values: [!!python/unicode 'TypeUnsignedInt', !!python/unicode 'unsigned long', !!python/unicode 'Int', !!python/unicode 'fromIntegral', !!python/unicode 'peekIntConv', !!python/unicode 'd86cfaa7-7cb8-499b-8d1c-a2d6736d135d', false, !!python/unicode 'std:string', !!python/unicode 'c_str()', !!python/unicode 'unsigned integer', false] @@ -11830,7 +11830,7 @@ items: false, !!python/unicode 'std:string', !!python/unicode 'c_str()', !!python/unicode 'normal double (four word)', false] - class: BasicType - values: [!!python/unicode 'TypeBool', !!python/unicode 'int', !!python/unicode 'Bool', + values: [!!python/unicode 'TypeBool', !!python/unicode 'long', !!python/unicode 'Bool', !!python/unicode 'fromBool', !!python/unicode 'peekBoolUtil', !!python/unicode '6a5ee197-4727-4a69-9776-d97edcfd556b', false, !!python/unicode 'std:string', !!python/unicode 'c_str()', !!python/unicode 'bool', false] @@ -11889,6 +11889,8 @@ items: values: [!!python/unicode 'u32'] - class: MappedCType values: [!!python/unicode 'uint32'] + - class: MappedCType + values: [!!python/unicode 'unsigned long'] !!python/unicode '/types/basic/mappedctypes/dc5f4919-e9ce-4122-b35c-f87a198f3337': - class: MappedCType values: [!!python/unicode 'double'] diff --git a/Bindings-HBind-Source/Ogre/Source/HG3DUtilities.cpp b/Bindings-HBind-Source/Ogre/Source/HG3DUtilities.cpp index 4d64aa4..03cde5f 100644 --- a/Bindings-HBind-Source/Ogre/Source/HG3DUtilities.cpp +++ b/Bindings-HBind-Source/Ogre/Source/HG3DUtilities.cpp @@ -25,9 +25,9 @@ limitations under the License. static int quitReceived = 0; -unsigned int HG3DUtilities::getWindowHandle(Ogre::RenderWindow *window) +unsigned long HG3DUtilities::getWindowHandle(Ogre::RenderWindow *window) { - unsigned int handle; + unsigned long handle; window->getCustomAttribute("WINDOW", &handle); return handle; diff --git a/Bindings-HBind-Source/Ogre/Source/HG3DUtilities.h b/Bindings-HBind-Source/Ogre/Source/HG3DUtilities.h index 4374dcc..273cd61 100644 --- a/Bindings-HBind-Source/Ogre/Source/HG3DUtilities.h +++ b/Bindings-HBind-Source/Ogre/Source/HG3DUtilities.h @@ -23,7 +23,7 @@ limitations under the License. class HG3DUtilities { public: - static unsigned int getWindowHandle(Ogre::RenderWindow *window); + static unsigned long getWindowHandle(Ogre::RenderWindow *window); static void setupCloseEventHandler(Ogre::RenderWindow *window); static int checkQuitReceived(); static void buildTangentVectors(Ogre::Entity *entity); diff --git a/Bindings-HBind-Source/Ogre/Templates/sconssource.tmpl b/Bindings-HBind-Source/Ogre/Templates/sconssource.tmpl index e122da5..694168b 100644 --- a/Bindings-HBind-Source/Ogre/Templates/sconssource.tmpl +++ b/Bindings-HBind-Source/Ogre/Templates/sconssource.tmpl @@ -19,12 +19,20 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/Ogre/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-GUI || true", +"ghc-pkg unregister HGamer3D-Graphics3D || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings-HBind-Source/SDL2/SDL2.cfg b/Bindings-HBind-Source/SDL2/SDL2.cfg index b44af24..7c18e99 100644 --- a/Bindings-HBind-Source/SDL2/SDL2.cfg +++ b/Bindings-HBind-Source/SDL2/SDL2.cfg @@ -824,25 +824,26 @@ items: !!python/unicode '', !!python/unicode 'sdlevent_struct', !!python/unicode "#ifndef\ \ _INC_STRUCT_SDLEVENT\n#define _INC_STRUCT_SDLEVENT\n\ntypedef struct sdlevent_struct\ \ {\n int type;\n int what;\n int data[12];\n} sdlevent_struct;\n\n#endif", - !!python/unicode "import HGamer3D.Data\n\nimport HGamer3D.Bindings.SDL2.EnumSDLEventType\n\ - import HGamer3D.Bindings.SDL2.EnumSDLKeymod\nimport HGamer3D.Bindings.SDL2.EnumSDLScancode\n\ - import HGamer3D.Bindings.SDL2.EnumSDLWindowEventID\n\nimport Control.Monad\n\ - import Control.Applicative\nimport Control.Exception\n\nimport qualified Data.ByteString.Char8\ - \ as BSC8\nimport qualified Data.String.UTF8 as UTF8\n\nimport Foreign.Storable\n\ - import Foreign.C.Types\nimport Foreign.Ptr\n\ntype Keycode = Word32\ntype\ - \ Keymod = Word16\n\ntype MouseID = Int\n\ndata SDLButton = SDLButtonLeft\ - \ | SDLButtonRight | SDLButtonMiddle | SDLButtonX1 | SDLButtonX2 | SDLButtonNumber\ - \ Int deriving (Eq, Show)\n\n_getButton :: Word8 -> SDLButton\n_getButton\ - \ w = case w of\n 1 -> SDLButtonLeft\n 2 -> SDLButtonMiddle\n 3 -> SDLButtonRight\n\ - \ 4 -> SDLButtonX1\n 5 -> SDLButtonX2\n _ -> SDLButtonNumber ((fromIntegral\ - \ . toInteger) w)\n\ndata SDLEvent = EvtKeyUp TimeMS Window EnumSDLScancode\ - \ Keycode Keymod |\n EvtKeyDown TimeMS Window EnumSDLScancode\ - \ Keycode Keymod |\n EvtText TimeMS Window String | \n \ - \ EvtQuit TimeMS |\n EvtWindow TimeMS Window EnumSDLWindowEventID\ - \ Int Int |\n EvtMouseButtonDown TimeMS Window MouseID SDLButton\ - \ Int Int |\n EvtMouseButtonUp TimeMS Window MouseID SDLButton\ - \ Int Int |\n EvtMouseMotion TimeMS Window MouseID Int Int Int\ - \ Int | \n EvtCommon TimeMS EnumSDLEventType |\n EvtNotValid\n\ + !!python/unicode "import HGamer3D.Data\nimport HGamer3D.Data.Window\n\nimport\ + \ HGamer3D.Bindings.SDL2.EnumSDLEventType\nimport HGamer3D.Bindings.SDL2.EnumSDLKeymod\n\ + import HGamer3D.Bindings.SDL2.EnumSDLScancode\nimport HGamer3D.Bindings.SDL2.EnumSDLWindowEventID\n\ + \nimport Control.Monad\nimport Control.Applicative\nimport Control.Exception\n\ + \nimport qualified Data.ByteString.Char8 as BSC8\nimport qualified Data.String.UTF8\ + \ as UTF8\n\nimport Foreign.Storable\nimport Foreign.C.Types\nimport Foreign.Ptr\n\ + \ntype Keycode = Word32\ntype Keymod = Word16\n\ntype MouseID = Int\n\ndata\ + \ SDLButton = SDLButtonLeft | SDLButtonRight | SDLButtonMiddle | SDLButtonX1\ + \ | SDLButtonX2 | SDLButtonNumber Int deriving (Eq, Show)\n\n_getButton ::\ + \ Word8 -> SDLButton\n_getButton w = case w of\n 1 -> SDLButtonLeft\n \ + \ 2 -> SDLButtonMiddle\n 3 -> SDLButtonRight\n 4 -> SDLButtonX1\n 5\ + \ -> SDLButtonX2\n _ -> SDLButtonNumber ((fromIntegral . toInteger) w)\n\ + \ndata SDLEvent = EvtKeyUp TimeMS Window EnumSDLScancode Keycode Keymod |\n\ + \ EvtKeyDown TimeMS Window EnumSDLScancode Keycode Keymod |\n\ + \ EvtText TimeMS Window String | \n EvtQuit TimeMS\ + \ |\n EvtWindow TimeMS Window EnumSDLWindowEventID Int Int |\n\ + \ EvtMouseButtonDown TimeMS Window MouseID SDLButton Int Int |\n\ + \ EvtMouseButtonUp TimeMS Window MouseID SDLButton Int Int |\n\ + \ EvtMouseMotion TimeMS Window MouseID Int Int Int Int | \n \ + \ EvtCommon TimeMS EnumSDLEventType |\n EvtNotValid\n\ \ninstance Storable SDLEvent where\n sizeOf _ = 56\n alignment _ = 4\n \ \ \n peek p = do\n typ <- (peekByteOff p 0 :: IO CUInt)\n time <- (peekByteOff\ \ p 4 :: IO CUInt)\n Control.Exception.catch (do\n let evttyp = (toEnum\ @@ -931,8 +932,8 @@ items: \ on Windows and Linux. \nThis binding does not claim to have full coverage\ \ of SDL2 \nfunctionality, but only to support what is needed for the\nHGamer3D-WinEvent\ \ package.", !!python/unicode 'base >= 3 && < 5, utf8-string, bytestring, - HGamer3D-Data >= 0.3.0', !!python/unicode 'http://www.hgamer3d.org', !!python/unicode 'Game - Engine', !!python/unicode '0.3.3'] + HGamer3D-Data >= 0.4.0', !!python/unicode 'http://www.hgamer3d.org', !!python/unicode 'Game + Engine', !!python/unicode '0.4.0'] /config/namespaces: [] /config/sourcedirs: - class: Directory diff --git a/Bindings-HBind-Source/SDL2/Templates/sconssource.tmpl b/Bindings-HBind-Source/SDL2/Templates/sconssource.tmpl index 4966a0d..184230c 100644 --- a/Bindings-HBind-Source/SDL2/Templates/sconssource.tmpl +++ b/Bindings-HBind-Source/SDL2/Templates/sconssource.tmpl @@ -19,12 +19,20 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/SDL2/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-GUI || true", +"ghc-pkg unregister HGamer3D-WinEvent || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings-HBind-Source/SFML/SFML.cfg b/Bindings-HBind-Source/SFML/SFML.cfg index 79473a6..e083210 100644 --- a/Bindings-HBind-Source/SFML/SFML.cfg +++ b/Bindings-HBind-Source/SFML/SFML.cfg @@ -380,8 +380,8 @@ items: \ on Windows and Linux. \nThis binding does not claim to have full coverage\ \ of SFML \nfunctionality, but only to support what is needed for the\nHGamer3D-Audio\ \ and HGamer3D-InputSystem packages.", !!python/unicode 'base >= 3 && < 5, - HGamer3D-Data >= 0.3.0', !!python/unicode 'http://www.hgamer3d.org', !!python/unicode 'Game - Engine, Audio, Graphics', !!python/unicode '0.3.2'] + HGamer3D-Data >= 0.4.0', !!python/unicode 'http://www.hgamer3d.org', !!python/unicode 'Game + Engine, Audio, Graphics', !!python/unicode '0.4.0'] /config/namespaces: - class: Namespace values: [!!python/unicode 'namespace sf'] diff --git a/Bindings-HBind-Source/SFML/Templates/sconssource.tmpl b/Bindings-HBind-Source/SFML/Templates/sconssource.tmpl index a5d6a45..97b444f 100644 --- a/Bindings-HBind-Source/SFML/Templates/sconssource.tmpl +++ b/Bindings-HBind-Source/SFML/Templates/sconssource.tmpl @@ -19,12 +19,20 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/SFML/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-Audio || true", +"ghc-pkg unregister HGamer3D-InputSystem || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings/CEGUI/cBuild/ClassCheckbox.cpp b/Bindings/CEGUI/cBuild/ClassCheckbox.cpp index 99b74ea..849ac23 100644 --- a/Bindings/CEGUI/cBuild/ClassCheckbox.cpp +++ b/Bindings/CEGUI/cBuild/ClassCheckbox.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassComboDropList.cpp b/Bindings/CEGUI/cBuild/ClassComboDropList.cpp index 4849065..0d03176 100644 --- a/Bindings/CEGUI/cBuild/ClassComboDropList.cpp +++ b/Bindings/CEGUI/cBuild/ClassComboDropList.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassCombobox.cpp b/Bindings/CEGUI/cBuild/ClassCombobox.cpp index dab62e9..7344753 100644 --- a/Bindings/CEGUI/cBuild/ClassCombobox.cpp +++ b/Bindings/CEGUI/cBuild/ClassCombobox.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassDefaultLogger.cpp b/Bindings/CEGUI/cBuild/ClassDefaultLogger.cpp index ac14841..2ea5859 100644 --- a/Bindings/CEGUI/cBuild/ClassDefaultLogger.cpp +++ b/Bindings/CEGUI/cBuild/ClassDefaultLogger.cpp @@ -37,10 +37,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassDefaultResourceProvider.cpp b/Bindings/CEGUI/cBuild/ClassDefaultResourceProvider.cpp index 9fc5b7d..6755f05 100644 --- a/Bindings/CEGUI/cBuild/ClassDefaultResourceProvider.cpp +++ b/Bindings/CEGUI/cBuild/ClassDefaultResourceProvider.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassDragContainer.cpp b/Bindings/CEGUI/cBuild/ClassDragContainer.cpp index 775ec8e..1529079 100644 --- a/Bindings/CEGUI/cBuild/ClassDragContainer.cpp +++ b/Bindings/CEGUI/cBuild/ClassDragContainer.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassEditbox.cpp b/Bindings/CEGUI/cBuild/ClassEditbox.cpp index 4552352..aba0b54 100644 --- a/Bindings/CEGUI/cBuild/ClassEditbox.cpp +++ b/Bindings/CEGUI/cBuild/ClassEditbox.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassEventArgs.cpp b/Bindings/CEGUI/cBuild/ClassEventArgs.cpp index c8e01c9..718bc30 100644 --- a/Bindings/CEGUI/cBuild/ClassEventArgs.cpp +++ b/Bindings/CEGUI/cBuild/ClassEventArgs.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassEventSet.cpp b/Bindings/CEGUI/cBuild/ClassEventSet.cpp index 11afe5e..01fab29 100644 --- a/Bindings/CEGUI/cBuild/ClassEventSet.cpp +++ b/Bindings/CEGUI/cBuild/ClassEventSet.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassFont.cpp b/Bindings/CEGUI/cBuild/ClassFont.cpp index 57bbc36..2ce4b5f 100644 --- a/Bindings/CEGUI/cBuild/ClassFont.cpp +++ b/Bindings/CEGUI/cBuild/ClassFont.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassFontManager.cpp b/Bindings/CEGUI/cBuild/ClassFontManager.cpp index 17619dd..b087480 100644 --- a/Bindings/CEGUI/cBuild/ClassFontManager.cpp +++ b/Bindings/CEGUI/cBuild/ClassFontManager.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassFrameWindow.cpp b/Bindings/CEGUI/cBuild/ClassFrameWindow.cpp index dc41f46..c7b2186 100644 --- a/Bindings/CEGUI/cBuild/ClassFrameWindow.cpp +++ b/Bindings/CEGUI/cBuild/ClassFrameWindow.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassHG3DEventController.cpp b/Bindings/CEGUI/cBuild/ClassHG3DEventController.cpp index 29d3c6c..5274af9 100644 --- a/Bindings/CEGUI/cBuild/ClassHG3DEventController.cpp +++ b/Bindings/CEGUI/cBuild/ClassHG3DEventController.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassHG3DEventStaticFunctions.cpp b/Bindings/CEGUI/cBuild/ClassHG3DEventStaticFunctions.cpp index b0f13ee..5a790a1 100644 --- a/Bindings/CEGUI/cBuild/ClassHG3DEventStaticFunctions.cpp +++ b/Bindings/CEGUI/cBuild/ClassHG3DEventStaticFunctions.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassHG3DListboxStaticFunctions.cpp b/Bindings/CEGUI/cBuild/ClassHG3DListboxStaticFunctions.cpp index 28c4037..d425da0 100644 --- a/Bindings/CEGUI/cBuild/ClassHG3DListboxStaticFunctions.cpp +++ b/Bindings/CEGUI/cBuild/ClassHG3DListboxStaticFunctions.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp b/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp index 3565790..5aa030c 100644 --- a/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp +++ b/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassImageCodec.cpp b/Bindings/CEGUI/cBuild/ClassImageCodec.cpp index b4dba88..3e2fed0 100644 --- a/Bindings/CEGUI/cBuild/ClassImageCodec.cpp +++ b/Bindings/CEGUI/cBuild/ClassImageCodec.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassImageset.cpp b/Bindings/CEGUI/cBuild/ClassImageset.cpp index f2af5a3..2ccf0dc 100644 --- a/Bindings/CEGUI/cBuild/ClassImageset.cpp +++ b/Bindings/CEGUI/cBuild/ClassImageset.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassItemEntry.cpp b/Bindings/CEGUI/cBuild/ClassItemEntry.cpp index 7cc1d43..f5916ab 100644 --- a/Bindings/CEGUI/cBuild/ClassItemEntry.cpp +++ b/Bindings/CEGUI/cBuild/ClassItemEntry.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassItemListbox.cpp b/Bindings/CEGUI/cBuild/ClassItemListbox.cpp index df23182..f126a81 100644 --- a/Bindings/CEGUI/cBuild/ClassItemListbox.cpp +++ b/Bindings/CEGUI/cBuild/ClassItemListbox.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassListHeader.cpp b/Bindings/CEGUI/cBuild/ClassListHeader.cpp index d77ddc5..d3cdc47 100644 --- a/Bindings/CEGUI/cBuild/ClassListHeader.cpp +++ b/Bindings/CEGUI/cBuild/ClassListHeader.cpp @@ -37,10 +37,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassListHeaderSegment.cpp b/Bindings/CEGUI/cBuild/ClassListHeaderSegment.cpp index 886a2f4..aa991cc 100644 --- a/Bindings/CEGUI/cBuild/ClassListHeaderSegment.cpp +++ b/Bindings/CEGUI/cBuild/ClassListHeaderSegment.cpp @@ -37,10 +37,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassListbox.cpp b/Bindings/CEGUI/cBuild/ClassListbox.cpp index 0bb59ab..818a467 100644 --- a/Bindings/CEGUI/cBuild/ClassListbox.cpp +++ b/Bindings/CEGUI/cBuild/ClassListbox.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" @@ -206,8 +206,7 @@ extern "C" CEGUI_LIB_EXPORT void cegui_lstbx_addItem(struct hg3dclass_struct * t (thisclass_cpp->addItem(item_cpp)); }; -// Insert an item into the list box before a specified item already in the - +// Insert an item into the list box before a specified item already in the list. extern "C" CEGUI_LIB_EXPORT void cegui_lstbx_insertItem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * item_c, struct hg3dclass_struct * position_c) { CEGUI::Listbox * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Listbox")); diff --git a/Bindings/CEGUI/cBuild/ClassListboxItem.cpp b/Bindings/CEGUI/cBuild/ClassListboxItem.cpp index 9e0913a..90435a1 100644 --- a/Bindings/CEGUI/cBuild/ClassListboxItem.cpp +++ b/Bindings/CEGUI/cBuild/ClassListboxItem.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassListboxTextItem.cpp b/Bindings/CEGUI/cBuild/ClassListboxTextItem.cpp index c1ccb48..d9fbb40 100644 --- a/Bindings/CEGUI/cBuild/ClassListboxTextItem.cpp +++ b/Bindings/CEGUI/cBuild/ClassListboxTextItem.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassLogger.cpp b/Bindings/CEGUI/cBuild/ClassLogger.cpp index 60d51d9..11cbda7 100644 --- a/Bindings/CEGUI/cBuild/ClassLogger.cpp +++ b/Bindings/CEGUI/cBuild/ClassLogger.cpp @@ -37,10 +37,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassMenuBase.cpp b/Bindings/CEGUI/cBuild/ClassMenuBase.cpp index 00bde5e..a66f5e5 100644 --- a/Bindings/CEGUI/cBuild/ClassMenuBase.cpp +++ b/Bindings/CEGUI/cBuild/ClassMenuBase.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassMenuItem.cpp b/Bindings/CEGUI/cBuild/ClassMenuItem.cpp index 6541290..53f49d0 100644 --- a/Bindings/CEGUI/cBuild/ClassMenuItem.cpp +++ b/Bindings/CEGUI/cBuild/ClassMenuItem.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassMultiColumnList.cpp b/Bindings/CEGUI/cBuild/ClassMultiColumnList.cpp index d757702..c6d1eea 100644 --- a/Bindings/CEGUI/cBuild/ClassMultiColumnList.cpp +++ b/Bindings/CEGUI/cBuild/ClassMultiColumnList.cpp @@ -38,10 +38,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassMultiLineEditbox.cpp b/Bindings/CEGUI/cBuild/ClassMultiLineEditbox.cpp index c6d6df8..98b8765 100644 --- a/Bindings/CEGUI/cBuild/ClassMultiLineEditbox.cpp +++ b/Bindings/CEGUI/cBuild/ClassMultiLineEditbox.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassOgreRenderer.cpp b/Bindings/CEGUI/cBuild/ClassOgreRenderer.cpp index bacf178..8531f68 100644 --- a/Bindings/CEGUI/cBuild/ClassOgreRenderer.cpp +++ b/Bindings/CEGUI/cBuild/ClassOgreRenderer.cpp @@ -37,10 +37,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassOgreResourceProvider.cpp b/Bindings/CEGUI/cBuild/ClassOgreResourceProvider.cpp index 0ce1edd..39c19d2 100644 --- a/Bindings/CEGUI/cBuild/ClassOgreResourceProvider.cpp +++ b/Bindings/CEGUI/cBuild/ClassOgreResourceProvider.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassProgressBar.cpp b/Bindings/CEGUI/cBuild/ClassProgressBar.cpp index bbf3e79..f05c1c4 100644 --- a/Bindings/CEGUI/cBuild/ClassProgressBar.cpp +++ b/Bindings/CEGUI/cBuild/ClassProgressBar.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassPropertySet.cpp b/Bindings/CEGUI/cBuild/ClassPropertySet.cpp index ea71add..061679b 100644 --- a/Bindings/CEGUI/cBuild/ClassPropertySet.cpp +++ b/Bindings/CEGUI/cBuild/ClassPropertySet.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassPtr.cpp b/Bindings/CEGUI/cBuild/ClassPtr.cpp index 05f2eef..653a3c2 100644 --- a/Bindings/CEGUI/cBuild/ClassPtr.cpp +++ b/Bindings/CEGUI/cBuild/ClassPtr.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassPushButton.cpp b/Bindings/CEGUI/cBuild/ClassPushButton.cpp index 5e15870..93d7b5f 100644 --- a/Bindings/CEGUI/cBuild/ClassPushButton.cpp +++ b/Bindings/CEGUI/cBuild/ClassPushButton.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassRadioButton.cpp b/Bindings/CEGUI/cBuild/ClassRadioButton.cpp index cbc79db..96cd8f4 100644 --- a/Bindings/CEGUI/cBuild/ClassRadioButton.cpp +++ b/Bindings/CEGUI/cBuild/ClassRadioButton.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassRenderer.cpp b/Bindings/CEGUI/cBuild/ClassRenderer.cpp index 7313c7e..0e07a46 100644 --- a/Bindings/CEGUI/cBuild/ClassRenderer.cpp +++ b/Bindings/CEGUI/cBuild/ClassRenderer.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassResourceProvider.cpp b/Bindings/CEGUI/cBuild/ClassResourceProvider.cpp index 7a60dd2..5263d7d 100644 --- a/Bindings/CEGUI/cBuild/ClassResourceProvider.cpp +++ b/Bindings/CEGUI/cBuild/ClassResourceProvider.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassScheme.cpp b/Bindings/CEGUI/cBuild/ClassScheme.cpp index 0429666..7a4402a 100644 --- a/Bindings/CEGUI/cBuild/ClassScheme.cpp +++ b/Bindings/CEGUI/cBuild/ClassScheme.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassSchemeManager.cpp b/Bindings/CEGUI/cBuild/ClassSchemeManager.cpp index eaf0162..2582b71 100644 --- a/Bindings/CEGUI/cBuild/ClassSchemeManager.cpp +++ b/Bindings/CEGUI/cBuild/ClassSchemeManager.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassScriptFunctor.cpp b/Bindings/CEGUI/cBuild/ClassScriptFunctor.cpp index 3dd0a2a..946fe61 100644 --- a/Bindings/CEGUI/cBuild/ClassScriptFunctor.cpp +++ b/Bindings/CEGUI/cBuild/ClassScriptFunctor.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassScriptModule.cpp b/Bindings/CEGUI/cBuild/ClassScriptModule.cpp index a241615..78b238f 100644 --- a/Bindings/CEGUI/cBuild/ClassScriptModule.cpp +++ b/Bindings/CEGUI/cBuild/ClassScriptModule.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassScrollablePane.cpp b/Bindings/CEGUI/cBuild/ClassScrollablePane.cpp index 79f8db6..181668a 100644 --- a/Bindings/CEGUI/cBuild/ClassScrollablePane.cpp +++ b/Bindings/CEGUI/cBuild/ClassScrollablePane.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassScrollbar.cpp b/Bindings/CEGUI/cBuild/ClassScrollbar.cpp index 4ee2ca6..a49896f 100644 --- a/Bindings/CEGUI/cBuild/ClassScrollbar.cpp +++ b/Bindings/CEGUI/cBuild/ClassScrollbar.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassScrolledContainer.cpp b/Bindings/CEGUI/cBuild/ClassScrolledContainer.cpp index 157f21b..bf169da 100644 --- a/Bindings/CEGUI/cBuild/ClassScrolledContainer.cpp +++ b/Bindings/CEGUI/cBuild/ClassScrolledContainer.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassScrolledItemListBase.cpp b/Bindings/CEGUI/cBuild/ClassScrolledItemListBase.cpp index 335e738..1c821eb 100644 --- a/Bindings/CEGUI/cBuild/ClassScrolledItemListBase.cpp +++ b/Bindings/CEGUI/cBuild/ClassScrolledItemListBase.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassSlider.cpp b/Bindings/CEGUI/cBuild/ClassSlider.cpp index 150fd47..9471d3d 100644 --- a/Bindings/CEGUI/cBuild/ClassSlider.cpp +++ b/Bindings/CEGUI/cBuild/ClassSlider.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassSpinner.cpp b/Bindings/CEGUI/cBuild/ClassSpinner.cpp index a452832..7fde1e4 100644 --- a/Bindings/CEGUI/cBuild/ClassSpinner.cpp +++ b/Bindings/CEGUI/cBuild/ClassSpinner.cpp @@ -37,10 +37,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassSystem.cpp b/Bindings/CEGUI/cBuild/ClassSystem.cpp index c449021..e97520f 100644 --- a/Bindings/CEGUI/cBuild/ClassSystem.cpp +++ b/Bindings/CEGUI/cBuild/ClassSystem.cpp @@ -37,10 +37,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassSystemHG3D.cpp b/Bindings/CEGUI/cBuild/ClassSystemHG3D.cpp index 468d625..8701e54 100644 --- a/Bindings/CEGUI/cBuild/ClassSystemHG3D.cpp +++ b/Bindings/CEGUI/cBuild/ClassSystemHG3D.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassTabButton.cpp b/Bindings/CEGUI/cBuild/ClassTabButton.cpp index 109bc78..16b788f 100644 --- a/Bindings/CEGUI/cBuild/ClassTabButton.cpp +++ b/Bindings/CEGUI/cBuild/ClassTabButton.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassThumb.cpp b/Bindings/CEGUI/cBuild/ClassThumb.cpp index b43896c..faf2d3a 100644 --- a/Bindings/CEGUI/cBuild/ClassThumb.cpp +++ b/Bindings/CEGUI/cBuild/ClassThumb.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassTooltip.cpp b/Bindings/CEGUI/cBuild/ClassTooltip.cpp index 042ada6..e996441 100644 --- a/Bindings/CEGUI/cBuild/ClassTooltip.cpp +++ b/Bindings/CEGUI/cBuild/ClassTooltip.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassTree.cpp b/Bindings/CEGUI/cBuild/ClassTree.cpp index baf10fc..4820e68 100644 --- a/Bindings/CEGUI/cBuild/ClassTree.cpp +++ b/Bindings/CEGUI/cBuild/ClassTree.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassWidgetLookManager.cpp b/Bindings/CEGUI/cBuild/ClassWidgetLookManager.cpp index 6455b51..96715b9 100644 --- a/Bindings/CEGUI/cBuild/ClassWidgetLookManager.cpp +++ b/Bindings/CEGUI/cBuild/ClassWidgetLookManager.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassWindow.cpp b/Bindings/CEGUI/cBuild/ClassWindow.cpp index 989e87a..348d0a7 100644 --- a/Bindings/CEGUI/cBuild/ClassWindow.cpp +++ b/Bindings/CEGUI/cBuild/ClassWindow.cpp @@ -39,10 +39,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassWindowManager.cpp b/Bindings/CEGUI/cBuild/ClassWindowManager.cpp index 7af347c..9881e3c 100644 --- a/Bindings/CEGUI/cBuild/ClassWindowManager.cpp +++ b/Bindings/CEGUI/cBuild/ClassWindowManager.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassWindowManagerHG3D.cpp b/Bindings/CEGUI/cBuild/ClassWindowManagerHG3D.cpp index 6843887..8f40622 100644 --- a/Bindings/CEGUI/cBuild/ClassWindowManagerHG3D.cpp +++ b/Bindings/CEGUI/cBuild/ClassWindowManagerHG3D.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/ClassXMLParser.cpp b/Bindings/CEGUI/cBuild/ClassXMLParser.cpp index 8d08a36..57f7bf1 100644 --- a/Bindings/CEGUI/cBuild/ClassXMLParser.cpp +++ b/Bindings/CEGUI/cBuild/ClassXMLParser.cpp @@ -36,10 +36,10 @@ #include "RendererModules/Ogre/CEGUIOgreRenderer.h" #include "./WindowManagerHG3D.h" #include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" #include "HG3DEventStaticFunctions.h" #include "HG3DListboxStaticFunctions.h" #include "HG3DEventController.h" -#include "HG3DCommandHandler.h" #include "HG3DEventModule.h" #include "HG3DWindowStaticFunctions.h" diff --git a/Bindings/CEGUI/cBuild/SConstruct b/Bindings/CEGUI/cBuild/SConstruct index 04c3aaa..fa8c82b 100644 --- a/Bindings/CEGUI/cBuild/SConstruct +++ b/Bindings/CEGUI/cBuild/SConstruct @@ -14,7 +14,7 @@ # -# scons file to build HGamer3DCEGUI library, version 0.3.1 +# scons file to build HGamer3DCEGUI library, version 0.4.0 # set environment @@ -31,7 +31,7 @@ libpath = home + "/.HGamer3D/lib" if env["PLATFORM"] == "win32": # on windows, create new environment, which finds MS C-Compiler env = Environment(TARGET_ARCH="x86", MSVC_VERSION="10.0") - env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DCEGUI031_EXPORTS /EHsc /MD"}) + env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DCEGUI040_EXPORTS /EHsc /MD"}) # set other compile parameters ############################## @@ -40,15 +40,15 @@ if env["PLATFORM"] == "win32": env.Append(CPPPATH=["include","../Deps/include","../Deps/include/CEGUI","../Deps/dependencies/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3dcegui031", ["ClassListboxItem.cpp","ClassSchemeManager.cpp","ClassSystem.cpp","ClassEventArgs.cpp","ClassPropertySet.cpp","ClassScrollbar.cpp","ClassRenderer.cpp","ClassScriptModule.cpp","ClassScrollablePane.cpp","HG3DEventModule.cpp","ClassHG3DListboxStaticFunctions.cpp","ClassWindowManager.cpp","ClassThumb.cpp","ClassComboDropList.cpp","ClassFont.cpp","HG3DEventStaticFunctions.cpp","ClassFontManager.cpp","ClassCombobox.cpp","ClassHG3DEventStaticFunctions.cpp","ClassSlider.cpp","HG3DListboxStaticFunctions.cpp","ClassItemListbox.cpp","ClassWidgetLookManager.cpp","ClassDefaultResourceProvider.cpp","ClassTree.cpp","ClassImageset.cpp","ClassScrolledContainer.cpp","ClassOgreResourceProvider.cpp","HG3DCommandHandler.cpp","ClassDragContainer.cpp","ClassResourceProvider.cpp","ClassMenuBase.cpp","ClassItemEntry.cpp","ClassEventSet.cpp","ClassProgressBar.cpp","ClassSpinner.cpp","ClassListboxTextItem.cpp","ClassWindow.cpp","ClassMenuItem.cpp","ClassHG3DWindowStaticFunctions.cpp","ClassLogger.cpp","ClassTabButton.cpp","ClassScriptFunctor.cpp","ClassOgreRenderer.cpp","ClassRadioButton.cpp","ClassScrolledItemListBase.cpp","ClassPushButton.cpp","ClassListHeaderSegment.cpp","ClassImageCodec.cpp","ClassWindowManagerHG3D.cpp","ClassListHeader.cpp","HG3DEventController.cpp","HG3DWindowStaticFunctions.cpp","ClassXMLParser.cpp","ClassMultiLineEditbox.cpp","ClassSystemHG3D.cpp","ClassPtr.cpp","ClassFrameWindow.cpp","ClassHG3DEventController.cpp","ClassMultiColumnList.cpp","ClassEditbox.cpp","ClassListbox.cpp","ClassScheme.cpp","ClassCheckbox.cpp","ClassTooltip.cpp","ClassDefaultLogger.cpp"], LIBS = ["CEGUIBase.lib","CEGUIOgreRenderer.lib"]) + env.SharedLibrary("hg3dcegui040", ["HG3DEventModule.cpp","ClassEventSet.cpp","ClassMenuItem.cpp","ClassHG3DListboxStaticFunctions.cpp","ClassWidgetLookManager.cpp","ClassHG3DEventStaticFunctions.cpp","ClassRadioButton.cpp","ClassMenuBase.cpp","HG3DCommandHandler.cpp","ClassProgressBar.cpp","ClassImageCodec.cpp","ClassCheckbox.cpp","ClassListboxItem.cpp","ClassItemEntry.cpp","ClassCombobox.cpp","ClassFrameWindow.cpp","ClassEditbox.cpp","ClassRenderer.cpp","ClassLogger.cpp","HG3DWindowStaticFunctions.cpp","ClassDefaultResourceProvider.cpp","ClassTooltip.cpp","ClassHG3DWindowStaticFunctions.cpp","ClassScheme.cpp","ClassSystemHG3D.cpp","ClassPropertySet.cpp","HG3DListboxStaticFunctions.cpp","ClassFont.cpp","ClassResourceProvider.cpp","HG3DEventController.cpp","ClassPushButton.cpp","ClassScrollbar.cpp","ClassWindow.cpp","ClassListbox.cpp","ClassScriptModule.cpp","ClassListHeader.cpp","ClassSlider.cpp","ClassItemListbox.cpp","ClassListboxTextItem.cpp","ClassDragContainer.cpp","ClassWindowManager.cpp","HG3DEventStaticFunctions.cpp","ClassWindowManagerHG3D.cpp","ClassScriptFunctor.cpp","ClassOgreResourceProvider.cpp","ClassTree.cpp","ClassTabButton.cpp","ClassDefaultLogger.cpp","ClassPtr.cpp","ClassOgreRenderer.cpp","ClassSystem.cpp","ClassListHeaderSegment.cpp","ClassHG3DEventController.cpp","ClassThumb.cpp","ClassScrolledContainer.cpp","ClassScrollablePane.cpp","ClassSpinner.cpp","ClassImageset.cpp","ClassMultiLineEditbox.cpp","ClassSchemeManager.cpp","ClassFontManager.cpp","ClassMultiColumnList.cpp","ClassEventArgs.cpp","ClassComboDropList.cpp","ClassXMLParser.cpp","ClassScrolledItemListBase.cpp"], LIBS = ["CEGUIBase.lib","CEGUIOgreRenderer.lib"]) env.Alias('install', libpath) - env.Install(libpath, "hg3dcegui031.dll") + env.Install(libpath, "hg3dcegui040.dll") else: env.Append(CPPPATH=["include","../Deps/include","../Deps/include/CEGUI","../Deps/dependencies/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3dcegui031", ["ClassListboxItem.cpp","ClassSchemeManager.cpp","ClassSystem.cpp","ClassEventArgs.cpp","ClassPropertySet.cpp","ClassScrollbar.cpp","ClassRenderer.cpp","ClassScriptModule.cpp","ClassScrollablePane.cpp","HG3DEventModule.cpp","ClassHG3DListboxStaticFunctions.cpp","ClassWindowManager.cpp","ClassThumb.cpp","ClassComboDropList.cpp","ClassFont.cpp","HG3DEventStaticFunctions.cpp","ClassFontManager.cpp","ClassCombobox.cpp","ClassHG3DEventStaticFunctions.cpp","ClassSlider.cpp","HG3DListboxStaticFunctions.cpp","ClassItemListbox.cpp","ClassWidgetLookManager.cpp","ClassDefaultResourceProvider.cpp","ClassTree.cpp","ClassImageset.cpp","ClassScrolledContainer.cpp","ClassOgreResourceProvider.cpp","HG3DCommandHandler.cpp","ClassDragContainer.cpp","ClassResourceProvider.cpp","ClassMenuBase.cpp","ClassItemEntry.cpp","ClassEventSet.cpp","ClassProgressBar.cpp","ClassSpinner.cpp","ClassListboxTextItem.cpp","ClassWindow.cpp","ClassMenuItem.cpp","ClassHG3DWindowStaticFunctions.cpp","ClassLogger.cpp","ClassTabButton.cpp","ClassScriptFunctor.cpp","ClassOgreRenderer.cpp","ClassRadioButton.cpp","ClassScrolledItemListBase.cpp","ClassPushButton.cpp","ClassListHeaderSegment.cpp","ClassImageCodec.cpp","ClassWindowManagerHG3D.cpp","ClassListHeader.cpp","HG3DEventController.cpp","HG3DWindowStaticFunctions.cpp","ClassXMLParser.cpp","ClassMultiLineEditbox.cpp","ClassSystemHG3D.cpp","ClassPtr.cpp","ClassFrameWindow.cpp","ClassHG3DEventController.cpp","ClassMultiColumnList.cpp","ClassEditbox.cpp","ClassListbox.cpp","ClassScheme.cpp","ClassCheckbox.cpp","ClassTooltip.cpp","ClassDefaultLogger.cpp"], LIBS = ["CEGUIBase-0.7.7","CEGUIOgreRenderer-0.7.7"]) + env.SharedLibrary("hg3dcegui040", ["HG3DEventModule.cpp","ClassEventSet.cpp","ClassMenuItem.cpp","ClassHG3DListboxStaticFunctions.cpp","ClassWidgetLookManager.cpp","ClassHG3DEventStaticFunctions.cpp","ClassRadioButton.cpp","ClassMenuBase.cpp","HG3DCommandHandler.cpp","ClassProgressBar.cpp","ClassImageCodec.cpp","ClassCheckbox.cpp","ClassListboxItem.cpp","ClassItemEntry.cpp","ClassCombobox.cpp","ClassFrameWindow.cpp","ClassEditbox.cpp","ClassRenderer.cpp","ClassLogger.cpp","HG3DWindowStaticFunctions.cpp","ClassDefaultResourceProvider.cpp","ClassTooltip.cpp","ClassHG3DWindowStaticFunctions.cpp","ClassScheme.cpp","ClassSystemHG3D.cpp","ClassPropertySet.cpp","HG3DListboxStaticFunctions.cpp","ClassFont.cpp","ClassResourceProvider.cpp","HG3DEventController.cpp","ClassPushButton.cpp","ClassScrollbar.cpp","ClassWindow.cpp","ClassListbox.cpp","ClassScriptModule.cpp","ClassListHeader.cpp","ClassSlider.cpp","ClassItemListbox.cpp","ClassListboxTextItem.cpp","ClassDragContainer.cpp","ClassWindowManager.cpp","HG3DEventStaticFunctions.cpp","ClassWindowManagerHG3D.cpp","ClassScriptFunctor.cpp","ClassOgreResourceProvider.cpp","ClassTree.cpp","ClassTabButton.cpp","ClassDefaultLogger.cpp","ClassPtr.cpp","ClassOgreRenderer.cpp","ClassSystem.cpp","ClassListHeaderSegment.cpp","ClassHG3DEventController.cpp","ClassThumb.cpp","ClassScrolledContainer.cpp","ClassScrollablePane.cpp","ClassSpinner.cpp","ClassImageset.cpp","ClassMultiLineEditbox.cpp","ClassSchemeManager.cpp","ClassFontManager.cpp","ClassMultiColumnList.cpp","ClassEventArgs.cpp","ClassComboDropList.cpp","ClassXMLParser.cpp","ClassScrolledItemListBase.cpp"], LIBS = ["CEGUIBase-0.7.7","CEGUIOgreRenderer-0.7.7"]) env.Alias('install', libpath) - env.Install(libpath, "libhg3dcegui031.so") + env.Install(libpath, "libhg3dcegui040.so") diff --git a/Bindings/CEGUI/cBuild/include/CEGUIDllDefines.h b/Bindings/CEGUI/cBuild/include/CEGUIDllDefines.h index dd8ae98..08ec9a6 100644 --- a/Bindings/CEGUI/cBuild/include/CEGUIDllDefines.h +++ b/Bindings/CEGUI/cBuild/include/CEGUIDllDefines.h @@ -16,10 +16,10 @@ // CEGUIDllDefines.h -#ifndef _HGamer3DCEGUI031_DLLDEFINES_H_ -#define _HGamer3DCEGUI031_DLLDEFINES_H_ +#ifndef _HGamer3DCEGUI040_DLLDEFINES_H_ +#define _HGamer3DCEGUI040_DLLDEFINES_H_ -/* Cmake will define HGamer3DCEGUI031_EXPORTS on Windows when it +/* Cmake will define HGamer3DCEGUI040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DCEGUI031_EXPORTS) + #if defined(HGamer3DCEGUI040_EXPORTS) #define CEGUI_LIB_EXPORT __declspec(dllexport) #else #define CEGUI_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DCEGUI031_EXPORTS */ + #endif /* HGamer3DCEGUI040_EXPORTS */ #else /* defined (_WIN32) */ #define CEGUI_LIB_EXPORT #endif -#endif /* _HGamer3DCEGUI031_DLLDEFINES_H_ */ +#endif /* _HGamer3DCEGUI040_DLLDEFINES_H_ */ diff --git a/Bindings/CEGUI/cBuild/include/ClassListbox.h b/Bindings/CEGUI/cBuild/include/ClassListbox.h index 270988b..9e00f3d 100644 --- a/Bindings/CEGUI/cBuild/include/ClassListbox.h +++ b/Bindings/CEGUI/cBuild/include/ClassListbox.h @@ -80,8 +80,7 @@ void cegui_lstbx_resetList(struct hg3dclass_struct * thisclass_c); // Add the given ListboxItem void cegui_lstbx_addItem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * item_c); -// Insert an item into the list box before a specified item already in the - +// Insert an item into the list box before a specified item already in the list. void cegui_lstbx_insertItem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * item_c, struct hg3dclass_struct * position_c); // Removes the given item from the list box. If the item is has the auto delete state set, the item will be deleted. diff --git a/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal b/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal index e0aa60c..3af3a66 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal +++ b/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-CEGUI-Binding -Version: 0.3.1 +Version: 0.4.0 Synopsis: A Game Engine for the Haskell Programmer - CEGUI Bindings Description: HGamer3D is a game engine for developing 3D games in the programming @@ -16,12 +16,12 @@ Build-Type: Simple Cabal-Version: >=1.4 Homepage: http://www.hgamer3d.org Category: Game Engine, GUI -Extra-source-files: Setup.hs, include/EnumMouseButton.h, include/EnumSystemKey.h, include/ClassListboxTextItem.h, include/ClassSlider.h, include/ClassMultiColumnList.h, include/HG3DEventStaticFunctions.h, include/StructHG3DClass.h, include/ClassImageset.h, include/ClassTabButton.h, include/ClassListHeaderSegment.h, include/ClassMenuBase.h, include/EnumTipState.h, include/SystemHG3D.h, include/EnumVerticalAlignment.h, include/ClassHG3DEventStaticFunctions.h, include/ClassHG3DEventController.h, include/ClassComboDropList.h, include/HG3DListboxStaticFunctions.h, include/ClassWindowManager.h, include/ClassFrameWindow.h, include/ClassHG3DListboxStaticFunctions.h, include/ClassXMLParser.h, include/ClassThumb.h, include/ClassSpinner.h, include/quaternion_struct.h, include/CEGUIDllDefines.h, include/HG3DEventController.h, include/WindowManagerHG3D.h, include/ClassSystemHG3D.h, include/ClassSchemeManager.h, include/sharedptr_struct.h, include/radian_struct.h, include/ClassScrolledItemListBase.h, include/ClassDefaultLogger.h, include/ClassWindowManagerHG3D.h, include/ClassScrollbar.h, include/ClassDefaultResourceProvider.h, include/ClassRadioButton.h, include/vector2_struct.h, include/ClassListbox.h, include/ClassListHeader.h, include/ClassWindow.h, include/ClassEditbox.h, include/EnumTextInputMode.h, include/ClassItemEntry.h, include/EnumWindowUpdateMode.h, include/EnumQuadSplitMode.h, include/ClassItemListbox.h, include/ClassFont.h, include/ClassImageCodec.h, include/ClassOgreRenderer.h, include/ClassEventSet.h, include/EnumSortDirection.h, include/EnumTabPanePosition.h, include/ClassHG3DWindowStaticFunctions.h, include/ClassScrollablePane.h, include/EnumLoggingLevel.h, include/HG3DCommandHandler.h, include/ClassTooltip.h, include/ClassCombobox.h, include/ClassScheme.h, include/ClassTree.h, include/ClassScriptFunctor.h, include/HG3DEventModule.h, include/ClassDragContainer.h, include/ClassMultiLineEditbox.h, include/ClassFontManager.h, include/EnumBlendMode.h, include/EnumFWSizingLocation.h, include/ClassResourceProvider.h, include/ClassScriptModule.h, include/ClassLogger.h, include/ClassScrolledContainer.h, include/ClassMenuItem.h, include/vector4_struct.h, include/ClassPushButton.h, include/ClassProgressBar.h, include/ClassPtr.h, include/HG3DWindowStaticFunctions.h, include/hg3dstruct.h, include/vector3_struct.h, include/ClassListboxItem.h, include/ClassSystem.h, include/colorvalue_struct.h, include/EnumHorizontalAlignment.h, include/ClassPropertySet.h, include/ClassEventArgs.h, include/EnumKeyScan.h, include/ClassRenderer.h, include/degree_struct.h, include/EnumSelectionMode.h, include/ClassOgreResourceProvider.h, include/ClassCheckbox.h, include/ClassWidgetLookManager.h +Extra-source-files: Setup.hs, include/colorvalue_struct.h, include/StructHG3DClass.h, include/ClassThumb.h, include/EnumTabPanePosition.h, include/hg3dstruct.h, include/vector4_struct.h, include/HG3DCommandHandler.h, include/ClassListboxItem.h, include/ClassEditbox.h, include/ClassSchemeManager.h, include/ClassSpinner.h, include/ClassItemListbox.h, include/EnumQuadSplitMode.h, include/ClassMultiLineEditbox.h, include/ClassMenuItem.h, include/radian_struct.h, include/ClassListHeaderSegment.h, include/ClassTree.h, include/ClassHG3DEventController.h, include/CEGUIDllDefines.h, include/ClassSlider.h, include/ClassListbox.h, include/SystemHG3D.h, include/ClassMultiColumnList.h, include/HG3DEventStaticFunctions.h, include/HG3DListboxStaticFunctions.h, include/ClassScrollablePane.h, include/vector2_struct.h, include/EnumTipState.h, include/ClassFont.h, include/ClassWindowManagerHG3D.h, include/ClassScheme.h, include/EnumSelectionMode.h, include/ClassFrameWindow.h, include/ClassWindowManager.h, include/ClassHG3DListboxStaticFunctions.h, include/sharedptr_struct.h, include/ClassHG3DEventStaticFunctions.h, include/HG3DEventController.h, include/ClassTabButton.h, include/ClassPushButton.h, include/ClassFontManager.h, include/EnumMouseButton.h, include/EnumWindowUpdateMode.h, include/ClassScrollbar.h, include/EnumFWSizingLocation.h, include/ClassDefaultResourceProvider.h, include/ClassItemEntry.h, include/EnumBlendMode.h, include/ClassPtr.h, include/ClassScrolledContainer.h, include/ClassDragContainer.h, include/ClassListboxTextItem.h, include/EnumSystemKey.h, include/ClassRadioButton.h, include/ClassXMLParser.h, include/ClassComboDropList.h, include/quaternion_struct.h, include/ClassScriptModule.h, include/ClassWindow.h, include/EnumHorizontalAlignment.h, include/EnumLoggingLevel.h, include/ClassEventSet.h, include/ClassRenderer.h, include/ClassOgreResourceProvider.h, include/ClassLogger.h, include/ClassResourceProvider.h, include/ClassImageCodec.h, include/vector3_struct.h, include/ClassScrolledItemListBase.h, include/ClassEventArgs.h, include/ClassPropertySet.h, include/EnumSortDirection.h, include/EnumKeyScan.h, include/EnumVerticalAlignment.h, include/ClassImageset.h, include/ClassProgressBar.h, include/ClassSystem.h, include/ClassDefaultLogger.h, include/ClassSystemHG3D.h, include/WindowManagerHG3D.h, include/HG3DEventModule.h, include/ClassMenuBase.h, include/ClassCheckbox.h, include/ClassCombobox.h, include/degree_struct.h, include/ClassWidgetLookManager.h, include/ClassListHeader.h, include/ClassTooltip.h, include/ClassOgreRenderer.h, include/EnumTextInputMode.h, include/ClassScriptFunctor.h, include/ClassHG3DWindowStaticFunctions.h, include/HG3DWindowStaticFunctions.h Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Bindings.CEGUI.Utils, HGamer3D.Bindings.CEGUI.StructHG3DClass, HGamer3D.Bindings.CEGUI.ClassPtr, HGamer3D.Bindings.CEGUI.EnumBlendMode, HGamer3D.Bindings.CEGUI.EnumTipState, HGamer3D.Bindings.CEGUI.EnumLoggingLevel, HGamer3D.Bindings.CEGUI.EnumVerticalAlignment, HGamer3D.Bindings.CEGUI.EnumKeyScan, HGamer3D.Bindings.CEGUI.EnumTextInputMode, HGamer3D.Bindings.CEGUI.EnumSortDirection, HGamer3D.Bindings.CEGUI.EnumHorizontalAlignment, HGamer3D.Bindings.CEGUI.EnumQuadSplitMode, HGamer3D.Bindings.CEGUI.EnumWindowUpdateMode, HGamer3D.Bindings.CEGUI.EnumFWSizingLocation, HGamer3D.Bindings.CEGUI.EnumTabPanePosition, HGamer3D.Bindings.CEGUI.EnumSystemKey, HGamer3D.Bindings.CEGUI.EnumMouseButton, HGamer3D.Bindings.CEGUI.EnumSelectionMode, HGamer3D.Bindings.CEGUI.ClassTooltip, HGamer3D.Bindings.CEGUI.ClassListboxItem, HGamer3D.Bindings.CEGUI.ClassScrolledItemListBase, HGamer3D.Bindings.CEGUI.ClassFontManager, HGamer3D.Bindings.CEGUI.ClassOgreResourceProvider, HGamer3D.Bindings.CEGUI.ClassMenuBase, HGamer3D.Bindings.CEGUI.ClassEventArgs, HGamer3D.Bindings.CEGUI.ClassScheme, HGamer3D.Bindings.CEGUI.ClassWindowManager, HGamer3D.Bindings.CEGUI.ClassListboxTextItem, HGamer3D.Bindings.CEGUI.ClassListbox, HGamer3D.Bindings.CEGUI.ClassDragContainer, HGamer3D.Bindings.CEGUI.ClassPropertySet, HGamer3D.Bindings.CEGUI.ClassDefaultLogger, HGamer3D.Bindings.CEGUI.ClassEventSet, HGamer3D.Bindings.CEGUI.ClassImageCodec, HGamer3D.Bindings.CEGUI.ClassResourceProvider, HGamer3D.Bindings.CEGUI.ClassListHeader, HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions, HGamer3D.Bindings.CEGUI.ClassWindow, HGamer3D.Bindings.CEGUI.ClassSpinner, HGamer3D.Bindings.CEGUI.ClassSchemeManager, HGamer3D.Bindings.CEGUI.ClassComboDropList, HGamer3D.Bindings.CEGUI.ClassScrollbar, HGamer3D.Bindings.CEGUI.ClassHG3DListboxStaticFunctions, HGamer3D.Bindings.CEGUI.ClassScriptModule, HGamer3D.Bindings.CEGUI.ClassHG3DEventController, HGamer3D.Bindings.CEGUI.ClassMultiColumnList, HGamer3D.Bindings.CEGUI.ClassWidgetLookManager, HGamer3D.Bindings.CEGUI.ClassScriptFunctor, HGamer3D.Bindings.CEGUI.ClassTree, HGamer3D.Bindings.CEGUI.ClassFrameWindow, HGamer3D.Bindings.CEGUI.ClassThumb, HGamer3D.Bindings.CEGUI.ClassFont, HGamer3D.Bindings.CEGUI.ClassDefaultResourceProvider, HGamer3D.Bindings.CEGUI.ClassItemListbox, HGamer3D.Bindings.CEGUI.ClassScrollablePane, HGamer3D.Bindings.CEGUI.ClassLogger, HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions, HGamer3D.Bindings.CEGUI.ClassRenderer, HGamer3D.Bindings.CEGUI.ClassMenuItem, HGamer3D.Bindings.CEGUI.ClassListHeaderSegment, HGamer3D.Bindings.CEGUI.ClassProgressBar, HGamer3D.Bindings.CEGUI.ClassSystem, HGamer3D.Bindings.CEGUI.ClassTabButton, HGamer3D.Bindings.CEGUI.ClassSlider, HGamer3D.Bindings.CEGUI.ClassImageset, HGamer3D.Bindings.CEGUI.ClassMultiLineEditbox, HGamer3D.Bindings.CEGUI.ClassPushButton, HGamer3D.Bindings.CEGUI.ClassOgreRenderer, HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D, HGamer3D.Bindings.CEGUI.ClassScrolledContainer, HGamer3D.Bindings.CEGUI.ClassItemEntry, HGamer3D.Bindings.CEGUI.ClassCheckbox, HGamer3D.Bindings.CEGUI.ClassEditbox, HGamer3D.Bindings.CEGUI.ClassCombobox, HGamer3D.Bindings.CEGUI.ClassRadioButton, HGamer3D.Bindings.CEGUI.ClassSystemHG3D, HGamer3D.Bindings.CEGUI.ClassXMLParser + Exposed-modules: HGamer3D.Bindings.CEGUI.Utils, HGamer3D.Bindings.CEGUI.StructHG3DClass, HGamer3D.Bindings.CEGUI.ClassPtr, HGamer3D.Bindings.CEGUI.EnumTextInputMode, HGamer3D.Bindings.CEGUI.EnumLoggingLevel, HGamer3D.Bindings.CEGUI.EnumWindowUpdateMode, HGamer3D.Bindings.CEGUI.EnumMouseButton, HGamer3D.Bindings.CEGUI.EnumTipState, HGamer3D.Bindings.CEGUI.EnumQuadSplitMode, HGamer3D.Bindings.CEGUI.EnumHorizontalAlignment, HGamer3D.Bindings.CEGUI.EnumKeyScan, HGamer3D.Bindings.CEGUI.EnumSelectionMode, HGamer3D.Bindings.CEGUI.EnumVerticalAlignment, HGamer3D.Bindings.CEGUI.EnumSortDirection, HGamer3D.Bindings.CEGUI.EnumTabPanePosition, HGamer3D.Bindings.CEGUI.EnumBlendMode, HGamer3D.Bindings.CEGUI.EnumFWSizingLocation, HGamer3D.Bindings.CEGUI.EnumSystemKey, HGamer3D.Bindings.CEGUI.ClassScrolledContainer, HGamer3D.Bindings.CEGUI.ClassSystem, HGamer3D.Bindings.CEGUI.ClassPushButton, HGamer3D.Bindings.CEGUI.ClassScheme, HGamer3D.Bindings.CEGUI.ClassWindowManager, HGamer3D.Bindings.CEGUI.ClassRadioButton, HGamer3D.Bindings.CEGUI.ClassMenuBase, HGamer3D.Bindings.CEGUI.ClassCombobox, HGamer3D.Bindings.CEGUI.ClassThumb, HGamer3D.Bindings.CEGUI.ClassSchemeManager, HGamer3D.Bindings.CEGUI.ClassEventArgs, HGamer3D.Bindings.CEGUI.ClassComboDropList, HGamer3D.Bindings.CEGUI.ClassImageset, HGamer3D.Bindings.CEGUI.ClassScriptFunctor, HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D, HGamer3D.Bindings.CEGUI.ClassScrollbar, HGamer3D.Bindings.CEGUI.ClassTree, HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions, HGamer3D.Bindings.CEGUI.ClassListHeaderSegment, HGamer3D.Bindings.CEGUI.ClassItemListbox, HGamer3D.Bindings.CEGUI.ClassCheckbox, HGamer3D.Bindings.CEGUI.ClassOgreResourceProvider, HGamer3D.Bindings.CEGUI.ClassHG3DEventController, HGamer3D.Bindings.CEGUI.ClassScrollablePane, HGamer3D.Bindings.CEGUI.ClassTooltip, HGamer3D.Bindings.CEGUI.ClassResourceProvider, HGamer3D.Bindings.CEGUI.ClassLogger, HGamer3D.Bindings.CEGUI.ClassListHeader, HGamer3D.Bindings.CEGUI.ClassPropertySet, HGamer3D.Bindings.CEGUI.ClassEventSet, HGamer3D.Bindings.CEGUI.ClassMultiColumnList, HGamer3D.Bindings.CEGUI.ClassFrameWindow, HGamer3D.Bindings.CEGUI.ClassOgreRenderer, HGamer3D.Bindings.CEGUI.ClassFont, HGamer3D.Bindings.CEGUI.ClassFontManager, HGamer3D.Bindings.CEGUI.ClassImageCodec, HGamer3D.Bindings.CEGUI.ClassDefaultResourceProvider, HGamer3D.Bindings.CEGUI.ClassWidgetLookManager, HGamer3D.Bindings.CEGUI.ClassScriptModule, HGamer3D.Bindings.CEGUI.ClassItemEntry, HGamer3D.Bindings.CEGUI.ClassRenderer, HGamer3D.Bindings.CEGUI.ClassTabButton, HGamer3D.Bindings.CEGUI.ClassMenuItem, HGamer3D.Bindings.CEGUI.ClassScrolledItemListBase, HGamer3D.Bindings.CEGUI.ClassDefaultLogger, HGamer3D.Bindings.CEGUI.ClassEditbox, HGamer3D.Bindings.CEGUI.ClassProgressBar, HGamer3D.Bindings.CEGUI.ClassMultiLineEditbox, HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions, HGamer3D.Bindings.CEGUI.ClassListboxTextItem, HGamer3D.Bindings.CEGUI.ClassSystemHG3D, HGamer3D.Bindings.CEGUI.ClassSlider, HGamer3D.Bindings.CEGUI.ClassDragContainer, HGamer3D.Bindings.CEGUI.ClassListboxItem, HGamer3D.Bindings.CEGUI.ClassXMLParser, HGamer3D.Bindings.CEGUI.ClassSpinner, HGamer3D.Bindings.CEGUI.ClassHG3DListboxStaticFunctions, HGamer3D.Bindings.CEGUI.ClassWindow, HGamer3D.Bindings.CEGUI.ClassListbox Other-modules: ghc-options: @@ -31,6 +31,6 @@ Library Build-tools: build-depends: if os(windows) - extra-libraries: hg3dcegui031 + extra-libraries: hg3dcegui040 else - extra-libraries: hg3dcegui031,CEGUIBase-0.7.7,CEGUIOgreRenderer-0.7.7 + extra-libraries: hg3dcegui040,CEGUIBase-0.7.7,CEGUIOgreRenderer-0.7.7 diff --git a/Bindings/CEGUI/hBuild/SConstruct b/Bindings/CEGUI/hBuild/SConstruct index 8950d00..3afe8d6 100644 --- a/Bindings/CEGUI/hBuild/SConstruct +++ b/Bindings/CEGUI/hBuild/SConstruct @@ -19,12 +19,19 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/CEGUI/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-GUI || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings/CEGUI/hBuild/include/CEGUIDllDefines.h b/Bindings/CEGUI/hBuild/include/CEGUIDllDefines.h index dd8ae98..08ec9a6 100644 --- a/Bindings/CEGUI/hBuild/include/CEGUIDllDefines.h +++ b/Bindings/CEGUI/hBuild/include/CEGUIDllDefines.h @@ -16,10 +16,10 @@ // CEGUIDllDefines.h -#ifndef _HGamer3DCEGUI031_DLLDEFINES_H_ -#define _HGamer3DCEGUI031_DLLDEFINES_H_ +#ifndef _HGamer3DCEGUI040_DLLDEFINES_H_ +#define _HGamer3DCEGUI040_DLLDEFINES_H_ -/* Cmake will define HGamer3DCEGUI031_EXPORTS on Windows when it +/* Cmake will define HGamer3DCEGUI040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DCEGUI031_EXPORTS) + #if defined(HGamer3DCEGUI040_EXPORTS) #define CEGUI_LIB_EXPORT __declspec(dllexport) #else #define CEGUI_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DCEGUI031_EXPORTS */ + #endif /* HGamer3DCEGUI040_EXPORTS */ #else /* defined (_WIN32) */ #define CEGUI_LIB_EXPORT #endif -#endif /* _HGamer3DCEGUI031_DLLDEFINES_H_ */ +#endif /* _HGamer3DCEGUI040_DLLDEFINES_H_ */ diff --git a/Bindings/CEGUI/hBuild/include/ClassListbox.h b/Bindings/CEGUI/hBuild/include/ClassListbox.h index 270988b..9e00f3d 100644 --- a/Bindings/CEGUI/hBuild/include/ClassListbox.h +++ b/Bindings/CEGUI/hBuild/include/ClassListbox.h @@ -80,8 +80,7 @@ void cegui_lstbx_resetList(struct hg3dclass_struct * thisclass_c); // Add the given ListboxItem void cegui_lstbx_addItem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * item_c); -// Insert an item into the list box before a specified item already in the - +// Insert an item into the list box before a specified item already in the list. void cegui_lstbx_insertItem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * item_c, struct hg3dclass_struct * position_c); // Removes the given item from the list box. If the item is has the auto delete state set, the item will be deleted. diff --git a/Bindings/Enet/cBuild/SConstruct b/Bindings/Enet/cBuild/SConstruct index 00f3526..ae9ef32 100644 --- a/Bindings/Enet/cBuild/SConstruct +++ b/Bindings/Enet/cBuild/SConstruct @@ -14,7 +14,7 @@ # -# scons file to build HGamer3DEnet library, version 0.3.2 +# scons file to build HGamer3DEnet library, version 0.4.0 # set environment @@ -31,7 +31,7 @@ libpath = home + "/.HGamer3D/lib" if env["PLATFORM"] == "win32": # on windows, create new environment, which finds MS C-Compiler env = Environment(TARGET_ARCH="x86", MSVC_VERSION="10.0") - env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DEnet032_EXPORTS /EHsc /MD"}) + env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DEnet040_EXPORTS /EHsc /MD"}) # set other compile parameters ############################## @@ -40,15 +40,15 @@ if env["PLATFORM"] == "win32": env.Append(CPPPATH=["include","../Deps/include","../deps/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3denet032", ["ClassEnet.cpp","ClassEnetPacket.cpp","ClassEnetClient.cpp","hg3denet.cpp","ClassEnetServer.cpp","ClassPtr.cpp"], LIBS = ["enet137.lib","winmm.lib","ws2_32.lib"]) + env.SharedLibrary("hg3denet040", ["ClassEnet.cpp","ClassEnetServer.cpp","ClassEnetClient.cpp","ClassEnetPacket.cpp","ClassPtr.cpp","hg3denet.cpp"], LIBS = ["enet137.lib","winmm.lib","ws2_32.lib"]) env.Alias('install', libpath) - env.Install(libpath, "hg3denet032.dll") + env.Install(libpath, "hg3denet040.dll") else: env.Append(CPPPATH=["include","../Deps/include","../deps/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3denet032", ["ClassEnet.cpp","ClassEnetPacket.cpp","ClassEnetClient.cpp","hg3denet.cpp","ClassEnetServer.cpp","ClassPtr.cpp"], LIBS = ["enet"]) + env.SharedLibrary("hg3denet040", ["ClassEnet.cpp","ClassEnetServer.cpp","ClassEnetClient.cpp","ClassEnetPacket.cpp","ClassPtr.cpp","hg3denet.cpp"], LIBS = ["enet"]) env.Alias('install', libpath) - env.Install(libpath, "libhg3denet032.so") + env.Install(libpath, "libhg3denet040.so") diff --git a/Bindings/Enet/cBuild/include/EnetDllDefines.h b/Bindings/Enet/cBuild/include/EnetDllDefines.h index 7178814..52c36dc 100644 --- a/Bindings/Enet/cBuild/include/EnetDllDefines.h +++ b/Bindings/Enet/cBuild/include/EnetDllDefines.h @@ -16,10 +16,10 @@ // EnetDllDefines.h -#ifndef _HGamer3DEnet032_DLLDEFINES_H_ -#define _HGamer3DEnet032_DLLDEFINES_H_ +#ifndef _HGamer3DEnet040_DLLDEFINES_H_ +#define _HGamer3DEnet040_DLLDEFINES_H_ -/* Cmake will define HGamer3DEnet032_EXPORTS on Windows when it +/* Cmake will define HGamer3DEnet040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DEnet032_EXPORTS) + #if defined(HGamer3DEnet040_EXPORTS) #define Enet_LIB_EXPORT __declspec(dllexport) #else #define Enet_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DEnet032_EXPORTS */ + #endif /* HGamer3DEnet040_EXPORTS */ #else /* defined (_WIN32) */ #define Enet_LIB_EXPORT #endif -#endif /* _HGamer3DEnet032_DLLDEFINES_H_ */ +#endif /* _HGamer3DEnet040_DLLDEFINES_H_ */ diff --git a/Bindings/Enet/hBuild/HGamer3D-Enet-Binding.cabal b/Bindings/Enet/hBuild/HGamer3D-Enet-Binding.cabal index bf193a5..9e0e5ce 100644 --- a/Bindings/Enet/hBuild/HGamer3D-Enet-Binding.cabal +++ b/Bindings/Enet/hBuild/HGamer3D-Enet-Binding.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-Enet-Binding -Version: 0.3.2 +Version: 0.4.0 Synopsis: Enet Binding for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -19,12 +19,12 @@ Build-Type: Simple Cabal-Version: >=1.4 Homepage: http://www.hgamer3d.org Category: Game Engine, Network -Extra-source-files: Setup.hs, include/ClassEnetPacket.h, include/StructHG3DClass.h, include/ClassEnetClient.h, include/hg3denet.hpp, include/ClassEnetServer.h, include/ClassEnet.h, include/EnetDllDefines.h, include/ClassPtr.h, include/hg3dstruct.h +Extra-source-files: Setup.hs, include/ClassEnetClient.h, include/StructHG3DClass.h, include/hg3dstruct.h, include/EnetDllDefines.h, include/ClassPtr.h, include/ClassEnetServer.h, include/ClassEnet.h, include/ClassEnetPacket.h, include/hg3denet.hpp Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.3.0 + Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 - Exposed-modules: HGamer3D.Bindings.Enet.Utils, HGamer3D.Bindings.Enet.StructHG3DClass, HGamer3D.Bindings.Enet.ClassPtr, HGamer3D.Bindings.Enet.ClassEnetServer, HGamer3D.Bindings.Enet.ClassEnetClient, HGamer3D.Bindings.Enet.ClassEnetPacket, HGamer3D.Bindings.Enet.ClassEnet + Exposed-modules: HGamer3D.Bindings.Enet.Utils, HGamer3D.Bindings.Enet.StructHG3DClass, HGamer3D.Bindings.Enet.ClassPtr, HGamer3D.Bindings.Enet.ClassEnetServer, HGamer3D.Bindings.Enet.ClassEnet, HGamer3D.Bindings.Enet.ClassEnetPacket, HGamer3D.Bindings.Enet.ClassEnetClient Other-modules: ghc-options: @@ -34,6 +34,6 @@ Library Build-tools: build-depends: if os(windows) - extra-libraries: hg3denet032 + extra-libraries: hg3denet040 else - extra-libraries: hg3denet032,enet + extra-libraries: hg3denet040,enet diff --git a/Bindings/Enet/hBuild/SConstruct b/Bindings/Enet/hBuild/SConstruct index 21804ca..f38eac4 100644 --- a/Bindings/Enet/hBuild/SConstruct +++ b/Bindings/Enet/hBuild/SConstruct @@ -19,12 +19,19 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/Enet/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-Network || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings/Enet/hBuild/include/EnetDllDefines.h b/Bindings/Enet/hBuild/include/EnetDllDefines.h index 7178814..52c36dc 100644 --- a/Bindings/Enet/hBuild/include/EnetDllDefines.h +++ b/Bindings/Enet/hBuild/include/EnetDllDefines.h @@ -16,10 +16,10 @@ // EnetDllDefines.h -#ifndef _HGamer3DEnet032_DLLDEFINES_H_ -#define _HGamer3DEnet032_DLLDEFINES_H_ +#ifndef _HGamer3DEnet040_DLLDEFINES_H_ +#define _HGamer3DEnet040_DLLDEFINES_H_ -/* Cmake will define HGamer3DEnet032_EXPORTS on Windows when it +/* Cmake will define HGamer3DEnet040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DEnet032_EXPORTS) + #if defined(HGamer3DEnet040_EXPORTS) #define Enet_LIB_EXPORT __declspec(dllexport) #else #define Enet_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DEnet032_EXPORTS */ + #endif /* HGamer3DEnet040_EXPORTS */ #else /* defined (_WIN32) */ #define Enet_LIB_EXPORT #endif -#endif /* _HGamer3DEnet032_DLLDEFINES_H_ */ +#endif /* _HGamer3DEnet040_DLLDEFINES_H_ */ diff --git a/Bindings/Ogre/Deps/FindFreetype.patch b/Bindings/Ogre/Deps/FindFreetype.patch new file mode 100644 index 0000000..db8f3fe --- /dev/null +++ b/Bindings/Ogre/Deps/FindFreetype.patch @@ -0,0 +1,14 @@ +34c34 +< set(FREETYPE_LIBRARY_NAMES freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype) +--- +> set(FREETYPE_LIBRARY_NAMES freetype253 freetype252 freetype251 freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype) +46c46 +< find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2) +--- +> find_path(FREETYPE_INCLUDE_DIR NAMES freetype.h freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2) +49,50c49,50 +< find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel) +< find_library(FREETYPE_LIBRARY_DBG NAMES ${FREETYPE_LIBRARY_NAMES_DBG} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug) +--- +> find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel) +> find_library(FREETYPE_LIBRARY_DBG NAMES ${FREETYPE_LIBRARY_NAMES_DBG} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug) diff --git a/Bindings/Ogre/Deps/SConstruct b/Bindings/Ogre/Deps/SConstruct index 864ad31..21306f5 100644 --- a/Bindings/Ogre/Deps/SConstruct +++ b/Bindings/Ogre/Deps/SConstruct @@ -38,6 +38,10 @@ def linkSO(target, source, env): os.system(cmd) +def patch_findfreetype(target, source, env): + os.system("patch -N -r- ogre_src_v1-8-1/CMake/Packages/FindFreetype.cmake FindFreetype.patch") + return 0 + # download pre-build binaries or source and extract if env["PLATFORM"] == "win32": # download and extract pre-build binaries @@ -63,7 +67,9 @@ else: "md5sum -c md5-ogre || (rm -f ogre-1.8.1.tar.bz2 && exit 1)" ]) # extract all files - env.Command("ogre_src_v1-8-1/OgreMain/src", "ogre-1.8.1.tar.bz2", "tar xjf ogre-1.8.1.tar.bz2") + env.Command("ogre_src_v1-8-1/OgreMain/src", "ogre-1.8.1.tar.bz2", [ + "tar xjf ogre-1.8.1.tar.bz2", + patch_findfreetype ]) # configure and create Makefile env.Command("ogre_src_v1-8-1/Makefile", "ogre_src_v1-8-1/OgreMain/src", [ diff --git a/Bindings/Ogre/cBuild/ClassAnimation.cpp b/Bindings/Ogre/cBuild/ClassAnimation.cpp index 3f49a5b..c5b55bf 100644 --- a/Bindings/Ogre/cBuild/ClassAnimation.cpp +++ b/Bindings/Ogre/cBuild/ClassAnimation.cpp @@ -148,13 +148,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_anm_getNodeTrack(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_anm_hasNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anm_hasNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c) { Ogre::Animation * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Animation")); unsigned short handle_cpp = (unsigned short)handle_c; bool result_cpp; result_cpp = (thisclass_cpp->hasNodeTrack(handle_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -178,13 +178,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_anm_getNumericTrack(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_anm_hasNumericTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anm_hasNumericTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c) { Ogre::Animation * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Animation")); unsigned short handle_cpp = (unsigned short)handle_c; bool result_cpp; result_cpp = (thisclass_cpp->hasNumericTrack(handle_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -208,13 +208,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_anm_getVertexTrack(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_anm_hasVertexTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anm_hasVertexTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c) { Ogre::Animation * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Animation")); unsigned short handle_cpp = (unsigned short)handle_c; bool result_cpp; result_cpp = (thisclass_cpp->hasVertexTrack(handle_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -302,7 +302,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_anm_apply2(struct hg3dclass_struct * thiscl }; // -extern "C" Ogre_LIB_EXPORT void ogre_anm_apply4(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * entity_c, float timePos_c, float weight_c, int software_c, int hardware_c) +extern "C" Ogre_LIB_EXPORT void ogre_anm_apply4(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * entity_c, float timePos_c, float weight_c, long software_c, long hardware_c) { Ogre::Animation * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Animation")); Ogre::Entity * entity_cpp = static_cast (getHG3DClassPtr(*entity_c, "Ogre::Entity")); @@ -348,7 +348,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_anm_getRotationInterpolationMode(struct hg3 }; // -extern "C" Ogre_LIB_EXPORT void ogre_anm_optimise(struct hg3dclass_struct * thisclass_c, int discardIdentityNodeTracks_c) +extern "C" Ogre_LIB_EXPORT void ogre_anm_optimise(struct hg3dclass_struct * thisclass_c, long discardIdentityNodeTracks_c) { Ogre::Animation * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Animation")); bool discardIdentityNodeTracks_cpp = (bool)discardIdentityNodeTracks_c; @@ -367,7 +367,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_anm_clone(struct hg3dclass_struct * thiscla }; // -extern "C" Ogre_LIB_EXPORT void ogre_anm_setUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, int useBaseKeyFrame_c, float keyframeTime_c, char * baseAnimName_c) +extern "C" Ogre_LIB_EXPORT void ogre_anm_setUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, long useBaseKeyFrame_c, float keyframeTime_c, char * baseAnimName_c) { Ogre::Animation * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Animation")); bool useBaseKeyFrame_cpp = (bool)useBaseKeyFrame_c; @@ -377,12 +377,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_anm_setUseBaseKeyFrame(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_anm_getUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anm_getUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Animation * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Animation")); bool result_cpp; result_cpp = (thisclass_cpp->getUseBaseKeyFrame()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassAnimationState.cpp b/Bindings/Ogre/cBuild/ClassAnimationState.cpp index 632f920..0c1ce89 100644 --- a/Bindings/Ogre/cBuild/ClassAnimationState.cpp +++ b/Bindings/Ogre/cBuild/ClassAnimationState.cpp @@ -42,7 +42,7 @@ using Ogre::uint; // -extern "C" Ogre_LIB_EXPORT void ogre_anms_construct(char * animName_c, struct hg3dclass_struct * parent_c, float timePos_c, float length_c, float weight_c, int enabled_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_construct(char * animName_c, struct hg3dclass_struct * parent_c, float timePos_c, float length_c, float weight_c, long enabled_c, struct hg3dclass_struct * result_c) { Ogre::String animName_cpp = Ogre::String((const char*) animName_c); Ogre::AnimationStateSet * parent_cpp = static_cast (getHG3DClassPtr(*parent_c, "Ogre::AnimationStateSet")); @@ -136,25 +136,25 @@ extern "C" Ogre_LIB_EXPORT void ogre_anms_addTime(struct hg3dclass_struct * this }; // Returns true if the animation has reached the end and is not looping. -extern "C" Ogre_LIB_EXPORT void ogre_anms_hasEnded(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_hasEnded(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); bool result_cpp; result_cpp = (thisclass_cpp->hasEnded()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Returns true if this animation is currently enabled. -extern "C" Ogre_LIB_EXPORT void ogre_anms_getEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_getEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); bool result_cpp; result_cpp = (thisclass_cpp->getEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Sets whether this animation is enabled. -extern "C" Ogre_LIB_EXPORT void ogre_anms_setEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_setEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); bool enabled_cpp = (bool)enabled_c; @@ -162,7 +162,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_anms_setEnabled(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_anms_setLoop(struct hg3dclass_struct * thisclass_c, int loop_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_setLoop(struct hg3dclass_struct * thisclass_c, long loop_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); bool loop_cpp = (bool)loop_c; @@ -170,12 +170,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_anms_setLoop(struct hg3dclass_struct * this }; // Gets whether or not this animation loops. -extern "C" Ogre_LIB_EXPORT void ogre_anms_getLoop(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_getLoop(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); bool result_cpp; result_cpp = (thisclass_cpp->getLoop()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -197,7 +197,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_anms_getParent(struct hg3dclass_struct * th }; // Create a new blend mask with the given number of entries. -extern "C" Ogre_LIB_EXPORT void ogre_anms_createBlendMask(struct hg3dclass_struct * thisclass_c, int blendMaskSizeHint_c, float initialWeight_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_createBlendMask(struct hg3dclass_struct * thisclass_c, long blendMaskSizeHint_c, float initialWeight_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); size_t blendMaskSizeHint_cpp = (size_t)blendMaskSizeHint_c; @@ -213,16 +213,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_anms_destroyBlendMask(struct hg3dclass_stru }; // Return whether there is currently a valid blend mask set. -extern "C" Ogre_LIB_EXPORT void ogre_anms_hasBlendMask(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_hasBlendMask(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); bool result_cpp; result_cpp = (thisclass_cpp->hasBlendMask()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Set the weight for the bone identified by the given handle. -extern "C" Ogre_LIB_EXPORT void ogre_anms_setBlendMaskEntry(struct hg3dclass_struct * thisclass_c, int boneHandle_c, float weight_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_setBlendMaskEntry(struct hg3dclass_struct * thisclass_c, long boneHandle_c, float weight_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); size_t boneHandle_cpp = (size_t)boneHandle_c; @@ -231,7 +231,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_anms_setBlendMaskEntry(struct hg3dclass_str }; // Get the weight for the bone identified by the given handle. -extern "C" Ogre_LIB_EXPORT void ogre_anms_getBlendMaskEntry(struct hg3dclass_struct * thisclass_c, int boneHandle_c, float * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_anms_getBlendMaskEntry(struct hg3dclass_struct * thisclass_c, long boneHandle_c, float * result_c) { Ogre::AnimationState * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationState")); size_t boneHandle_cpp = (size_t)boneHandle_c; diff --git a/Bindings/Ogre/cBuild/ClassAnimationStateSet.cpp b/Bindings/Ogre/cBuild/ClassAnimationStateSet.cpp index ebe1011..911c010 100644 --- a/Bindings/Ogre/cBuild/ClassAnimationStateSet.cpp +++ b/Bindings/Ogre/cBuild/ClassAnimationStateSet.cpp @@ -49,7 +49,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_ass_destruct(struct hg3dclass_struct * this }; // -extern "C" Ogre_LIB_EXPORT void ogre_ass_createAnimationState(struct hg3dclass_struct * thisclass_c, char * animName_c, float timePos_c, float length_c, float weight_c, int enabled_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ass_createAnimationState(struct hg3dclass_struct * thisclass_c, char * animName_c, float timePos_c, float length_c, float weight_c, long enabled_c, struct hg3dclass_struct * result_c) { Ogre::AnimationStateSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationStateSet")); Ogre::String animName_cpp = Ogre::String((const char*) animName_c); @@ -75,13 +75,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_ass_getAnimationState(struct hg3dclass_stru }; // Tests if state for the named animation is present. -extern "C" Ogre_LIB_EXPORT void ogre_ass_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ass_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::AnimationStateSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationStateSet")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasAnimationState(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Remove animation state with the given name. @@ -107,12 +107,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_ass_copyMatchingState(struct hg3dclass_stru (thisclass_cpp->copyMatchingState(target_cpp)); }; +// Get the latest animation state been altered frame number. +extern "C" Ogre_LIB_EXPORT void ogre_ass_getDirtyFrameNumber(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) +{ + Ogre::AnimationStateSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationStateSet")); + unsigned long result_cpp; + result_cpp = (thisclass_cpp->getDirtyFrameNumber()); + *result_c = (unsigned long)result_cpp; +}; + // Tests if exists enabled animation state in this set. -extern "C" Ogre_LIB_EXPORT void ogre_ass_hasEnabledAnimationState(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ass_hasEnabledAnimationState(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::AnimationStateSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationStateSet")); bool result_cpp; result_cpp = (thisclass_cpp->hasEnabledAnimationState()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassAnimationTrack.cpp b/Bindings/Ogre/cBuild/ClassAnimationTrack.cpp index ea39755..ea25a66 100644 --- a/Bindings/Ogre/cBuild/ClassAnimationTrack.cpp +++ b/Bindings/Ogre/cBuild/ClassAnimationTrack.cpp @@ -92,12 +92,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_at_apply(struct hg3dclass_struct * thisclas }; // -extern "C" Ogre_LIB_EXPORT void ogre_at_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_at_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::AnimationTrack * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::AnimationTrack")); bool result_cpp; result_cpp = (thisclass_cpp->hasNonZeroKeyFrames()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassArchive.cpp b/Bindings/Ogre/cBuild/ClassArchive.cpp index d28d818..b0e4c4a 100644 --- a/Bindings/Ogre/cBuild/ClassArchive.cpp +++ b/Bindings/Ogre/cBuild/ClassArchive.cpp @@ -62,12 +62,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_arch_getName(struct hg3dclass_struct * this }; // Returns whether this archive is case sensitive in the way it matches files. -extern "C" Ogre_LIB_EXPORT void ogre_arch_isCaseSensitive(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_arch_isCaseSensitive(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Archive * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Archive")); bool result_cpp; result_cpp = (thisclass_cpp->isCaseSensitive()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -85,12 +85,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_arch_unload(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_arch_isReadOnly(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_arch_isReadOnly(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Archive * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Archive")); bool result_cpp; result_cpp = (thisclass_cpp->isReadOnly()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -102,13 +102,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_arch_remove(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_arch_exists(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_arch_exists(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c) { Ogre::Archive * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Archive")); Ogre::String filename_cpp = Ogre::String((const char*) filename_c); bool result_cpp; result_cpp = (thisclass_cpp->exists(filename_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Return the type code of this Archive diff --git a/Bindings/Ogre/cBuild/ClassBillboard.cpp b/Bindings/Ogre/cBuild/ClassBillboard.cpp index 299e620..8a9f688 100644 --- a/Bindings/Ogre/cBuild/ClassBillboard.cpp +++ b/Bindings/Ogre/cBuild/ClassBillboard.cpp @@ -138,12 +138,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbd_getColour(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbd_hasOwnDimensions(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbd_hasOwnDimensions(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Billboard * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Billboard")); bool result_cpp; result_cpp = (thisclass_cpp->hasOwnDimensions()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -165,12 +165,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbd_getOwnHeight(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbd_isUseTexcoordRect(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbd_isUseTexcoordRect(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Billboard * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Billboard")); bool result_cpp; result_cpp = (thisclass_cpp->isUseTexcoordRect()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassBillboardChain.cpp b/Bindings/Ogre/cBuild/ClassBillboardChain.cpp index 1dfb16c..7a47984 100644 --- a/Bindings/Ogre/cBuild/ClassBillboardChain.cpp +++ b/Bindings/Ogre/cBuild/ClassBillboardChain.cpp @@ -52,7 +52,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_destruct(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setMaxChainElements(struct hg3dclass_struct * thisclass_c, int maxElements_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setMaxChainElements(struct hg3dclass_struct * thisclass_c, long maxElements_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); size_t maxElements_cpp = (size_t)maxElements_c; @@ -60,16 +60,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setMaxChainElements(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getMaxChainElements(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getMaxChainElements(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); size_t result_cpp; result_cpp = (thisclass_cpp->getMaxChainElements()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setNumberOfChains(struct hg3dclass_struct * thisclass_c, int numChains_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setNumberOfChains(struct hg3dclass_struct * thisclass_c, long numChains_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); size_t numChains_cpp = (size_t)numChains_c; @@ -77,16 +77,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setNumberOfChains(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getNumberOfChains(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getNumberOfChains(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); size_t result_cpp; result_cpp = (thisclass_cpp->getNumberOfChains()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setUseTextureCoords(struct hg3dclass_struct * thisclass_c, int use_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setUseTextureCoords(struct hg3dclass_struct * thisclass_c, long use_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); bool use_cpp = (bool)use_c; @@ -94,12 +94,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setUseTextureCoords(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getUseTextureCoords(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getUseTextureCoords(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); bool result_cpp; result_cpp = (thisclass_cpp->getUseTextureCoords()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -129,7 +129,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setOtherTextureCoordRange(struct hg3dc }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setUseVertexColours(struct hg3dclass_struct * thisclass_c, int use_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setUseVertexColours(struct hg3dclass_struct * thisclass_c, long use_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); bool use_cpp = (bool)use_c; @@ -137,16 +137,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setUseVertexColours(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getUseVertexColours(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getUseVertexColours(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); bool result_cpp; result_cpp = (thisclass_cpp->getUseVertexColours()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setDynamic(struct hg3dclass_struct * thisclass_c, int dyn_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setDynamic(struct hg3dclass_struct * thisclass_c, long dyn_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); bool dyn_cpp = (bool)dyn_c; @@ -154,16 +154,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setDynamic(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getDynamic(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getDynamic(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); bool result_cpp; result_cpp = (thisclass_cpp->getDynamic()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_removeChainElement(struct hg3dclass_struct * thisclass_c, int chainIndex_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_removeChainElement(struct hg3dclass_struct * thisclass_c, long chainIndex_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); size_t chainIndex_cpp = (size_t)chainIndex_c; @@ -171,17 +171,17 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_removeChainElement(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getNumChainElements(struct hg3dclass_struct * thisclass_c, int chainIndex_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getNumChainElements(struct hg3dclass_struct * thisclass_c, long chainIndex_c, long * result_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); size_t chainIndex_cpp = (size_t)chainIndex_c; size_t result_cpp; result_cpp = (thisclass_cpp->getNumChainElements(chainIndex_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_clearChain(struct hg3dclass_struct * thisclass_c, int chainIndex_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_clearChain(struct hg3dclass_struct * thisclass_c, long chainIndex_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); size_t chainIndex_cpp = (size_t)chainIndex_c; @@ -196,7 +196,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_clearAllChains(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setFaceCamera(struct hg3dclass_struct * thisclass_c, int faceCamera_c, struct vector3_struct * normalVector_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_setFaceCamera(struct hg3dclass_struct * thisclass_c, long faceCamera_c, struct vector3_struct * normalVector_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); bool faceCamera_cpp = (bool)faceCamera_c; @@ -268,13 +268,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbdc_getMovableType(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbdc_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbdc_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, long * result_c) { Ogre::BillboardChain * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardChain")); Ogre::SceneManager * sm_cpp = static_cast (getHG3DClassPtr(*sm_c, "Ogre::SceneManager")); Ogre::RenderSystem * rsys_cpp = static_cast (getHG3DClassPtr(*rsys_c, "Ogre::RenderSystem")); bool result_cpp; result_cpp = (thisclass_cpp->preRender(sm_cpp, rsys_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassBillboardSet.cpp b/Bindings/Ogre/cBuild/ClassBillboardSet.cpp index d8730d0..dad213e 100644 --- a/Bindings/Ogre/cBuild/ClassBillboardSet.cpp +++ b/Bindings/Ogre/cBuild/ClassBillboardSet.cpp @@ -48,7 +48,7 @@ using Ogre::uint; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_construct(char * name_c, unsigned int poolSize_c, int externalDataSource_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_construct(char * name_c, unsigned long poolSize_c, long externalDataSource_c, struct hg3dclass_struct * result_c) { Ogre::String name_cpp = Ogre::String((const char*) name_c); unsigned int poolSize_cpp = (unsigned int)poolSize_c; @@ -93,16 +93,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_createBillboard2(struct hg3dclass_struc }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getNumBillboards(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getNumBillboards(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); int result_cpp; result_cpp = (thisclass_cpp->getNumBillboards()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_setAutoextend(struct hg3dclass_struct * thisclass_c, int autoextend_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_setAutoextend(struct hg3dclass_struct * thisclass_c, long autoextend_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool autoextend_cpp = (bool)autoextend_c; @@ -110,16 +110,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_setAutoextend(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getAutoextend(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getAutoextend(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool result_cpp; result_cpp = (thisclass_cpp->getAutoextend()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_setSortingEnabled(struct hg3dclass_struct * thisclass_c, int sortenable_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_setSortingEnabled(struct hg3dclass_struct * thisclass_c, long sortenable_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool sortenable_cpp = (bool)sortenable_c; @@ -127,16 +127,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_setSortingEnabled(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getSortingEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getSortingEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool result_cpp; result_cpp = (thisclass_cpp->getSortingEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_setPoolSize(struct hg3dclass_struct * thisclass_c, int size_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_setPoolSize(struct hg3dclass_struct * thisclass_c, long size_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); size_t size_cpp = (size_t)size_c; @@ -144,12 +144,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_setPoolSize(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getPoolSize(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getPoolSize(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getPoolSize()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // @@ -160,7 +160,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_clear(struct hg3dclass_struct * thiscla }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getBillboard(struct hg3dclass_struct * thisclass_c, unsigned int index_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getBillboard(struct hg3dclass_struct * thisclass_c, unsigned long index_c, struct hg3dclass_struct * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); unsigned int index_cpp = (unsigned int)index_c; @@ -171,7 +171,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_getBillboard(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_removeBillboard(struct hg3dclass_struct * thisclass_c, unsigned int index_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_removeBillboard(struct hg3dclass_struct * thisclass_c, unsigned long index_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); unsigned int index_cpp = (unsigned int)index_c; @@ -286,7 +286,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_getMaterialName(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_beginBillboards(struct hg3dclass_struct * thisclass_c, int numBillboards_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_beginBillboards(struct hg3dclass_struct * thisclass_c, long numBillboards_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); size_t numBillboards_cpp = (size_t)numBillboards_c; @@ -335,16 +335,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_setMaterial(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getCullIndividually(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getCullIndividually(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool result_cpp; result_cpp = (thisclass_cpp->getCullIndividually()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_setCullIndividually(struct hg3dclass_struct * thisclass_c, int cullIndividual_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_setCullIndividually(struct hg3dclass_struct * thisclass_c, long cullIndividual_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool cullIndividual_cpp = (bool)cullIndividual_c; @@ -403,7 +403,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_getCommonUpVector(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_setUseAccurateFacing(struct hg3dclass_struct * thisclass_c, int acc_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_setUseAccurateFacing(struct hg3dclass_struct * thisclass_c, long acc_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool acc_cpp = (bool)acc_c; @@ -411,12 +411,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_setUseAccurateFacing(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getUseAccurateFacing(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getUseAccurateFacing(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool result_cpp; result_cpp = (thisclass_cpp->getUseAccurateFacing()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -443,7 +443,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_getSquaredViewDepth(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_setBillboardsInWorldSpace(struct hg3dclass_struct * thisclass_c, int ws_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_setBillboardsInWorldSpace(struct hg3dclass_struct * thisclass_c, long ws_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool ws_cpp = (bool)ws_c; @@ -451,7 +451,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_setBillboardsInWorldSpace(struct hg3dcl }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_setPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_setPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool enabled_cpp = (bool)enabled_c; @@ -459,25 +459,25 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_setPointRenderingEnabled(struct hg3dcla }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_isPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_isPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool result_cpp; result_cpp = (thisclass_cpp->isPointRenderingEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Override to return specific type flag. -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); uint32 result_cpp; result_cpp = (thisclass_cpp->getTypeFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_setAutoUpdate(struct hg3dclass_struct * thisclass_c, int autoUpdate_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_setAutoUpdate(struct hg3dclass_struct * thisclass_c, long autoUpdate_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool autoUpdate_cpp = (bool)autoUpdate_c; @@ -485,12 +485,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_bbs_setAutoUpdate(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_bbs_getAutoUpdate(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bbs_getAutoUpdate(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::BillboardSet * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::BillboardSet")); bool result_cpp; result_cpp = (thisclass_cpp->getAutoUpdate()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassBone.cpp b/Bindings/Ogre/cBuild/ClassBone.cpp index 1914eb8..ef27f18 100644 --- a/Bindings/Ogre/cBuild/ClassBone.cpp +++ b/Bindings/Ogre/cBuild/ClassBone.cpp @@ -87,7 +87,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_bn_reset(struct hg3dclass_struct * thisclas }; // -extern "C" Ogre_LIB_EXPORT void ogre_bn_setManuallyControlled(struct hg3dclass_struct * thisclass_c, int manuallyControlled_c) +extern "C" Ogre_LIB_EXPORT void ogre_bn_setManuallyControlled(struct hg3dclass_struct * thisclass_c, long manuallyControlled_c) { Ogre::Bone * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Bone")); bool manuallyControlled_cpp = (bool)manuallyControlled_c; @@ -95,16 +95,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_bn_setManuallyControlled(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_bn_isManuallyControlled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_bn_isManuallyControlled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Bone * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Bone")); bool result_cpp; result_cpp = (thisclass_cpp->isManuallyControlled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_bn_needUpdate(struct hg3dclass_struct * thisclass_c, int forceParentUpdate_c) +extern "C" Ogre_LIB_EXPORT void ogre_bn_needUpdate(struct hg3dclass_struct * thisclass_c, long forceParentUpdate_c) { Ogre::Bone * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Bone")); bool forceParentUpdate_cpp = (bool)forceParentUpdate_c; diff --git a/Bindings/Ogre/cBuild/ClassCamera.cpp b/Bindings/Ogre/cBuild/ClassCamera.cpp index 111f7ac..490a472 100644 --- a/Bindings/Ogre/cBuild/ClassCamera.cpp +++ b/Bindings/Ogre/cBuild/ClassCamera.cpp @@ -221,7 +221,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_rotate2(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_cam_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, int useFixed_c, struct vector3_struct * fixedAxis_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, long useFixed_c, struct vector3_struct * fixedAxis_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); bool useFixed_cpp = (bool)useFixed_c; @@ -403,12 +403,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_resetWindow(struct hg3dclass_struct * t }; // Returns if a viewport window is being used. -extern "C" Ogre_LIB_EXPORT void ogre_cam_isWindowSet(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_isWindowSet(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); bool result_cpp; result_cpp = (thisclass_cpp->isWindowSet()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -450,7 +450,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_getViewport(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_cam_setAutoAspectRatio(struct hg3dclass_struct * thisclass_c, int autoratio_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_setAutoAspectRatio(struct hg3dclass_struct * thisclass_c, long autoratio_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); bool autoratio_cpp = (bool)autoratio_c; @@ -458,12 +458,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_setAutoAspectRatio(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_cam_getAutoAspectRatio(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_getAutoAspectRatio(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); bool result_cpp; result_cpp = (thisclass_cpp->getAutoAspectRatio()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -485,7 +485,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_getCullingFrustum(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_cam_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, long * result_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); Vector3 vert_cpp = *((Vector3*) vert_c); @@ -493,7 +493,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_isVisible3(struct hg3dclass_struct * th bool result_cpp; result_cpp = (thisclass_cpp->isVisible(vert_cpp, &culledBy_cpp)); *culledBy_c = (enum EnumFrustumPlane) culledBy_cpp; - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -524,7 +524,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_getFarClipDistance(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_cam_setUseRenderingDistance(struct hg3dclass_struct * thisclass_c, int use_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_setUseRenderingDistance(struct hg3dclass_struct * thisclass_c, long use_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); bool use_cpp = (bool)use_c; @@ -532,12 +532,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_setUseRenderingDistance(struct hg3dclas }; // -extern "C" Ogre_LIB_EXPORT void ogre_cam_getUseRenderingDistance(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_getUseRenderingDistance(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); bool result_cpp; result_cpp = (thisclass_cpp->getUseRenderingDistance()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -568,7 +568,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_getOrientationForViewUpdate(struct hg3d // Sets whether to use min display size calculations -extern "C" Ogre_LIB_EXPORT void ogre_cam_setUseMinPixelSize(struct hg3dclass_struct * thisclass_c, int enable_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_setUseMinPixelSize(struct hg3dclass_struct * thisclass_c, long enable_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); bool enable_cpp = (bool)enable_c; @@ -576,12 +576,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_cam_setUseMinPixelSize(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_cam_getUseMinPixelSize(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_cam_getUseMinPixelSize(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Camera * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Camera")); bool result_cpp; result_cpp = (thisclass_cpp->getUseMinPixelSize()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassConfigFile.cpp b/Bindings/Ogre/cBuild/ClassConfigFile.cpp index 6bfc0cd..632e2e1 100644 --- a/Bindings/Ogre/cBuild/ClassConfigFile.cpp +++ b/Bindings/Ogre/cBuild/ClassConfigFile.cpp @@ -58,7 +58,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cf_destruct(struct hg3dclass_struct * thisc }; // load from a filename (not using resource group locations) -extern "C" Ogre_LIB_EXPORT void ogre_cf_load(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, int trimWhitespace_c) +extern "C" Ogre_LIB_EXPORT void ogre_cf_load(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, long trimWhitespace_c) { Ogre::ConfigFile * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ConfigFile")); Ogre::String filename_cpp = Ogre::String((const char*) filename_c); @@ -68,7 +68,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cf_load(struct hg3dclass_struct * thisclass }; // load from a filename (using resource group locations) -extern "C" Ogre_LIB_EXPORT void ogre_cf_load2(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, int trimWhitespace_c) +extern "C" Ogre_LIB_EXPORT void ogre_cf_load2(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, long trimWhitespace_c) { Ogre::ConfigFile * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ConfigFile")); Ogre::String filename_cpp = Ogre::String((const char*) filename_c); @@ -79,7 +79,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cf_load2(struct hg3dclass_struct * thisclas }; // load from a filename (not using resource group locations) -extern "C" Ogre_LIB_EXPORT void ogre_cf_loadDirect(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, int trimWhitespace_c) +extern "C" Ogre_LIB_EXPORT void ogre_cf_loadDirect(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, long trimWhitespace_c) { Ogre::ConfigFile * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ConfigFile")); Ogre::String filename_cpp = Ogre::String((const char*) filename_c); @@ -89,7 +89,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_cf_loadDirect(struct hg3dclass_struct * thi }; // load from a filename (using resource group locations) -extern "C" Ogre_LIB_EXPORT void ogre_cf_loadFromResourceSystem(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, int trimWhitespace_c) +extern "C" Ogre_LIB_EXPORT void ogre_cf_loadFromResourceSystem(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, long trimWhitespace_c) { Ogre::ConfigFile * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ConfigFile")); Ogre::String filename_cpp = Ogre::String((const char*) filename_c); diff --git a/Bindings/Ogre/cBuild/ClassEntity.cpp b/Bindings/Ogre/cBuild/ClassEntity.cpp index d495351..42b15d9 100644 --- a/Bindings/Ogre/cBuild/ClassEntity.cpp +++ b/Bindings/Ogre/cBuild/ClassEntity.cpp @@ -60,12 +60,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_getMesh(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_getNumSubEntities(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_getNumSubEntities(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getNumSubEntities()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // @@ -121,13 +121,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_getAnimationState(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasAnimationState(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -141,7 +141,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_getAllAnimationStates(struct hg3dclass_ }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_setDisplaySkeleton(struct hg3dclass_struct * thisclass_c, int display_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_setDisplaySkeleton(struct hg3dclass_struct * thisclass_c, long display_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool display_cpp = (bool)display_c; @@ -149,16 +149,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_setDisplaySkeleton(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_getDisplaySkeleton(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_getDisplaySkeleton(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->getDisplaySkeleton()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_getManualLodLevel(struct hg3dclass_struct * thisclass_c, int index_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_getManualLodLevel(struct hg3dclass_struct * thisclass_c, long index_c, struct hg3dclass_struct * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); size_t index_cpp = (size_t)index_c; @@ -169,16 +169,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_getManualLodLevel(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_getNumManualLodLevels(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_getNumManualLodLevels(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); size_t result_cpp; result_cpp = (thisclass_cpp->getNumManualLodLevels()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int PolygonModeOverrideable_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long PolygonModeOverrideable_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool PolygonModeOverrideable_cpp = (bool)PolygonModeOverrideable_c; @@ -221,52 +221,52 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_getBoundingRadius(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->hasEdgeList()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_hasSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_hasSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->hasSkeleton()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_isHardwareAnimationEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_isHardwareAnimationEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->isHardwareAnimationEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_getSoftwareAnimationRequests(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_getSoftwareAnimationRequests(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); int result_cpp; result_cpp = (thisclass_cpp->getSoftwareAnimationRequests()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_getSoftwareAnimationNormalsRequests(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_getSoftwareAnimationNormalsRequests(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); int result_cpp; result_cpp = (thisclass_cpp->getSoftwareAnimationNormalsRequests()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_addSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, int normalsAlso_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_addSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, long normalsAlso_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool normalsAlso_cpp = (bool)normalsAlso_c; @@ -274,7 +274,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_addSoftwareAnimationRequest(struct hg3d }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_removeSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, int normalsAlso_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_removeSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, long normalsAlso_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool normalsAlso_cpp = (bool)normalsAlso_c; @@ -290,12 +290,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_shareSkeletonInstanceWith(struct hg3dcl }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->hasVertexAnimation()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -306,12 +306,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_stopSharingSkeletonInstance(struct hg3d }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_sharesSkeletonInstance(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_sharesSkeletonInstance(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->sharesSkeletonInstance()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -322,7 +322,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_refreshAvailableAnimationState(struct h }; // Choose which vertex data to bind to the renderer. -extern "C" Ogre_LIB_EXPORT void ogre_ent_chooseVertexDataForBinding(struct hg3dclass_struct * thisclass_c, int hasVertexAnim_c, enum EnumEntityVertexDataBindChoice * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_chooseVertexDataForBinding(struct hg3dclass_struct * thisclass_c, long hasVertexAnim_c, enum EnumEntityVertexDataBindChoice * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool hasVertexAnim_cpp = (bool)hasVertexAnim_c; @@ -332,12 +332,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_chooseVertexDataForBinding(struct hg3dc }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_isInitialised(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_isInitialised(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->isInitialised()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -349,7 +349,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_backgroundLoadingComplete(struct hg3dcl }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_setSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, int skip_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_setSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, long skip_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool skip_cpp = (bool)skip_c; @@ -357,16 +357,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_setSkipAnimationStateUpdate(struct hg3d }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_getSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_getSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->getSkipAnimationStateUpdate()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_setAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, int update_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_setAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, long update_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool update_cpp = (bool)update_c; @@ -374,11 +374,11 @@ extern "C" Ogre_LIB_EXPORT void ogre_ent_setAlwaysUpdateMainSkeleton(struct hg3d }; // -extern "C" Ogre_LIB_EXPORT void ogre_ent_getAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_ent_getAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Entity * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Entity")); bool result_cpp; result_cpp = (thisclass_cpp->getAlwaysUpdateMainSkeleton()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassException.cpp b/Bindings/Ogre/cBuild/ClassException.cpp index 93e5af4..2754f48 100644 --- a/Bindings/Ogre/cBuild/ClassException.cpp +++ b/Bindings/Ogre/cBuild/ClassException.cpp @@ -42,7 +42,7 @@ using Ogre::uint; // -extern "C" Ogre_LIB_EXPORT void ogre_exc_construct(int number_c, char * description_c, char * source_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_exc_construct(long number_c, char * description_c, char * source_c, struct hg3dclass_struct * result_c) { int number_cpp = (int)number_c; Ogre::String description_cpp = Ogre::String((const char*) description_c); @@ -74,12 +74,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_exc_getFullDescription(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_exc_getNumber(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_exc_getNumber(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Exception * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Exception")); int result_cpp; result_cpp = (thisclass_cpp->getNumber()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -109,12 +109,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_exc_getFile(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_exc_getLine(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_exc_getLine(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Exception * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Exception")); long result_cpp; result_cpp = (thisclass_cpp->getLine()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassFrustum.cpp b/Bindings/Ogre/cBuild/ClassFrustum.cpp index cbe78c6..188e507 100644 --- a/Bindings/Ogre/cBuild/ClassFrustum.cpp +++ b/Bindings/Ogre/cBuild/ClassFrustum.cpp @@ -211,25 +211,25 @@ extern "C" Ogre_LIB_EXPORT void ogre_frst_getFrustumExtents(struct hg3dclass_str }; // Returns whether a custom view matrix is in use. -extern "C" Ogre_LIB_EXPORT void ogre_frst_isCustomViewMatrixEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_frst_isCustomViewMatrixEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Frustum * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Frustum")); bool result_cpp; result_cpp = (thisclass_cpp->isCustomViewMatrixEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Returns whether a custom projection matrix is in use. -extern "C" Ogre_LIB_EXPORT void ogre_frst_isCustomProjectionMatrixEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_frst_isCustomProjectionMatrixEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Frustum * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Frustum")); bool result_cpp; result_cpp = (thisclass_cpp->isCustomProjectionMatrixEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_frst_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_frst_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, long * result_c) { Ogre::Frustum * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Frustum")); Vector3 vert_cpp = *((Vector3*) vert_c); @@ -237,16 +237,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_frst_isVisible3(struct hg3dclass_struct * t bool result_cpp; result_cpp = (thisclass_cpp->isVisible(vert_cpp, &culledBy_cpp)); *culledBy_c = (enum EnumFrustumPlane) culledBy_cpp; - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Overridden from MovableObject::getTypeFlags -extern "C" Ogre_LIB_EXPORT void ogre_frst_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_frst_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::Frustum * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Frustum")); uint32 result_cpp; result_cpp = (thisclass_cpp->getTypeFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // @@ -367,12 +367,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_frst_disableReflection(struct hg3dclass_str }; // Returns whether this frustum is being reflected. -extern "C" Ogre_LIB_EXPORT void ogre_frst_isReflected(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_frst_isReflected(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Frustum * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Frustum")); bool result_cpp; result_cpp = (thisclass_cpp->isReflected()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -383,12 +383,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_frst_disableCustomNearClipPlane(struct hg3d }; // -extern "C" Ogre_LIB_EXPORT void ogre_frst_isCustomNearClipPlaneEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_frst_isCustomNearClipPlaneEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Frustum * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Frustum")); bool result_cpp; result_cpp = (thisclass_cpp->isCustomNearClipPlaneEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassHG3DUtilities.cpp b/Bindings/Ogre/cBuild/ClassHG3DUtilities.cpp index 7525bba..9679b33 100644 --- a/Bindings/Ogre/cBuild/ClassHG3DUtilities.cpp +++ b/Bindings/Ogre/cBuild/ClassHG3DUtilities.cpp @@ -42,12 +42,12 @@ using Ogre::uint; // -extern "C" Ogre_LIB_EXPORT void ogre_hg3dutl_getWindowHandle(struct hg3dclass_struct * window_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_hg3dutl_getWindowHandle(struct hg3dclass_struct * window_c, unsigned long * result_c) { Ogre::RenderWindow * window_cpp = static_cast (getHG3DClassPtr(*window_c, "Ogre::RenderWindow")); - unsigned int result_cpp; + unsigned long result_cpp; result_cpp = (HG3DUtilities::getWindowHandle(window_cpp)); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // @@ -58,11 +58,11 @@ extern "C" Ogre_LIB_EXPORT void ogre_hg3dutl_setupCloseEventHandler(struct hg3dc }; // -extern "C" Ogre_LIB_EXPORT void ogre_hg3dutl_checkQuitReceived(int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_hg3dutl_checkQuitReceived(long * result_c) { int result_cpp; result_cpp = (HG3DUtilities::checkQuitReceived()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassLight.cpp b/Bindings/Ogre/cBuild/ClassLight.cpp index faec2f3..532a0e8 100644 --- a/Bindings/Ogre/cBuild/ClassLight.cpp +++ b/Bindings/Ogre/cBuild/ClassLight.cpp @@ -343,7 +343,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_lgt_getMovableType(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_lgt_getDerivedPosition(struct hg3dclass_struct * thisclass_c, int cameraRelativeIfSet_c, struct vector3_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_lgt_getDerivedPosition(struct hg3dclass_struct * thisclass_c, long cameraRelativeIfSet_c, struct vector3_struct * result_c) { Ogre::Light * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Light")); bool cameraRelativeIfSet_cpp = (bool)cameraRelativeIfSet_c; @@ -362,7 +362,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_lgt_getDerivedDirection(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_lgt_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c) +extern "C" Ogre_LIB_EXPORT void ogre_lgt_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c) { Ogre::Light * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Light")); bool visible_cpp = (bool)visible_c; @@ -379,12 +379,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_lgt_getBoundingRadius(struct hg3dclass_stru }; // Override to return specific type flag. -extern "C" Ogre_LIB_EXPORT void ogre_lgt_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_lgt_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::Light * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Light")); uint32 result_cpp; result_cpp = (thisclass_cpp->getTypeFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassLog.cpp b/Bindings/Ogre/cBuild/ClassLog.cpp index c97f062..99dd33c 100644 --- a/Bindings/Ogre/cBuild/ClassLog.cpp +++ b/Bindings/Ogre/cBuild/ClassLog.cpp @@ -64,34 +64,34 @@ extern "C" Ogre_LIB_EXPORT void ogre_lg_getName(struct hg3dclass_struct * thiscl }; // Get whether debug output is enabled for this log. -extern "C" Ogre_LIB_EXPORT void ogre_lg_isDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_lg_isDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Log * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Log")); bool result_cpp; result_cpp = (thisclass_cpp->isDebugOutputEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Get whether file output is suppressed for this log. -extern "C" Ogre_LIB_EXPORT void ogre_lg_isFileOutputSuppressed(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_lg_isFileOutputSuppressed(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Log * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Log")); bool result_cpp; result_cpp = (thisclass_cpp->isFileOutputSuppressed()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Get whether time stamps are printed for this log. -extern "C" Ogre_LIB_EXPORT void ogre_lg_isTimeStampEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_lg_isTimeStampEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Log * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Log")); bool result_cpp; result_cpp = (thisclass_cpp->isTimeStampEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_lg_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, int maskDebug_c) +extern "C" Ogre_LIB_EXPORT void ogre_lg_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, long maskDebug_c) { Ogre::Log * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Log")); Ogre::String message_cpp = Ogre::String((const char*) message_c); @@ -101,7 +101,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_lg_logMessage(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_lg_setDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, int debugOutput_c) +extern "C" Ogre_LIB_EXPORT void ogre_lg_setDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, long debugOutput_c) { Ogre::Log * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Log")); bool debugOutput_cpp = (bool)debugOutput_c; @@ -117,7 +117,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_lg_setLogDetail(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_lg_setTimeStampEnabled(struct hg3dclass_struct * thisclass_c, int timeStamp_c) +extern "C" Ogre_LIB_EXPORT void ogre_lg_setTimeStampEnabled(struct hg3dclass_struct * thisclass_c, long timeStamp_c) { Ogre::Log * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Log")); bool timeStamp_cpp = (bool)timeStamp_c; diff --git a/Bindings/Ogre/cBuild/ClassLogManager.cpp b/Bindings/Ogre/cBuild/ClassLogManager.cpp index 57ae916..86290bc 100644 --- a/Bindings/Ogre/cBuild/ClassLogManager.cpp +++ b/Bindings/Ogre/cBuild/ClassLogManager.cpp @@ -51,7 +51,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_lmgr_destruct(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_lmgr_createLog(struct hg3dclass_struct * thisclass_c, char * name_c, int defaultLog_c, int debuggerOutput_c, int suppressFileOutput_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_lmgr_createLog(struct hg3dclass_struct * thisclass_c, char * name_c, long defaultLog_c, long debuggerOutput_c, long suppressFileOutput_c, struct hg3dclass_struct * result_c) { Ogre::LogManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::LogManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -113,7 +113,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_lmgr_setDefaultLog(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_lmgr_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, int maskDebug_c) +extern "C" Ogre_LIB_EXPORT void ogre_lmgr_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, long maskDebug_c) { Ogre::LogManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::LogManager")); Ogre::String message_cpp = Ogre::String((const char*) message_c); @@ -123,7 +123,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_lmgr_logMessage(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_lmgr_logMessage2(struct hg3dclass_struct * thisclass_c, enum EnumLogMessageLevel lml_c, char * message_c, int maskDebug_c) +extern "C" Ogre_LIB_EXPORT void ogre_lmgr_logMessage2(struct hg3dclass_struct * thisclass_c, enum EnumLogMessageLevel lml_c, char * message_c, long maskDebug_c) { Ogre::LogManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::LogManager")); enum Ogre::LogMessageLevel lml_cpp = (enum Ogre::LogMessageLevel)lml_c; diff --git a/Bindings/Ogre/cBuild/ClassManualObject.cpp b/Bindings/Ogre/cBuild/ClassManualObject.cpp index adab471..3612e5c 100644 --- a/Bindings/Ogre/cBuild/ClassManualObject.cpp +++ b/Bindings/Ogre/cBuild/ClassManualObject.cpp @@ -71,7 +71,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_clear(struct hg3dclass_struct * thiscla }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_estimateVertexCount(struct hg3dclass_struct * thisclass_c, int vcount_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_estimateVertexCount(struct hg3dclass_struct * thisclass_c, long vcount_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); size_t vcount_cpp = (size_t)vcount_c; @@ -79,7 +79,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_estimateVertexCount(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_estimateIndexCount(struct hg3dclass_struct * thisclass_c, int icount_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_estimateIndexCount(struct hg3dclass_struct * thisclass_c, long icount_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); size_t icount_cpp = (size_t)icount_c; @@ -97,7 +97,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_begin(struct hg3dclass_struct * thiscla }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_setDynamic(struct hg3dclass_struct * thisclass_c, int dyn_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_setDynamic(struct hg3dclass_struct * thisclass_c, long dyn_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool dyn_cpp = (bool)dyn_c; @@ -105,16 +105,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_setDynamic(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_getDynamic(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_getDynamic(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool result_cpp; result_cpp = (thisclass_cpp->getDynamic()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_beginUpdate(struct hg3dclass_struct * thisclass_c, int sectionIndex_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_beginUpdate(struct hg3dclass_struct * thisclass_c, long sectionIndex_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); size_t sectionIndex_cpp = (size_t)sectionIndex_c; @@ -249,7 +249,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_colour2(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_index(struct hg3dclass_struct * thisclass_c, unsigned int idx_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_index(struct hg3dclass_struct * thisclass_c, unsigned long idx_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); uint32 idx_cpp = (uint32)idx_c; @@ -257,7 +257,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_index(struct hg3dclass_struct * thiscla }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_triangle(struct hg3dclass_struct * thisclass_c, unsigned int i1_c, unsigned int i2_c, unsigned int i3_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_triangle(struct hg3dclass_struct * thisclass_c, unsigned long i1_c, unsigned long i2_c, unsigned long i3_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); uint32 i1_cpp = (uint32)i1_c; @@ -267,7 +267,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_triangle(struct hg3dclass_struct * this }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_quad(struct hg3dclass_struct * thisclass_c, unsigned int i1_c, unsigned int i2_c, unsigned int i3_c, unsigned int i4_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_quad(struct hg3dclass_struct * thisclass_c, unsigned long i1_c, unsigned long i2_c, unsigned long i3_c, unsigned long i4_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); uint32 i1_cpp = (uint32)i1_c; @@ -278,21 +278,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_quad(struct hg3dclass_struct * thisclas }; // Get the number of vertices in the section currently being defined (returns 0 if no section is in progress). -extern "C" Ogre_LIB_EXPORT void ogre_mno_getCurrentVertexCount(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_getCurrentVertexCount(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); size_t result_cpp; result_cpp = (thisclass_cpp->getCurrentVertexCount()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Get the number of indices in the section currently being defined (returns 0 if no section is in progress). -extern "C" Ogre_LIB_EXPORT void ogre_mno_getCurrentIndexCount(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_getCurrentIndexCount(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); size_t result_cpp; result_cpp = (thisclass_cpp->getCurrentIndexCount()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -306,7 +306,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_end(struct hg3dclass_struct * thisclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_setMaterialName(struct hg3dclass_struct * thisclass_c, int subindex_c, char * name_c, char * group_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_setMaterialName(struct hg3dclass_struct * thisclass_c, long subindex_c, char * name_c, char * group_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); size_t subindex_cpp = (size_t)subindex_c; @@ -327,7 +327,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_convertToMesh(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int useIdentityProjection_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long useIdentityProjection_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool useIdentityProjection_cpp = (bool)useIdentityProjection_c; @@ -335,16 +335,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_setUseIdentityProjection(struct hg3dcla }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool result_cpp; result_cpp = (thisclass_cpp->getUseIdentityProjection()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_setUseIdentityView(struct hg3dclass_struct * thisclass_c, int useIdentityView_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_setUseIdentityView(struct hg3dclass_struct * thisclass_c, long useIdentityView_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool useIdentityView_cpp = (bool)useIdentityView_c; @@ -352,16 +352,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_setUseIdentityView(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_getUseIdentityView(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_getUseIdentityView(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool result_cpp; result_cpp = (thisclass_cpp->getUseIdentityView()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_getSection(struct hg3dclass_struct * thisclass_c, unsigned int index_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_getSection(struct hg3dclass_struct * thisclass_c, unsigned long index_c, struct hg3dclass_struct * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); unsigned int index_cpp = (unsigned int)index_c; @@ -372,16 +372,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_getSection(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_getNumSections(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_getNumSections(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getNumSections()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_setKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, int keepOrder_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_setKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, long keepOrder_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool keepOrder_cpp = (bool)keepOrder_c; @@ -389,15 +389,15 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_setKeepDeclarationOrder(struct hg3dclas }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_getKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_getKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool result_cpp; result_cpp = (thisclass_cpp->getKeepDeclarationOrder()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; -// . +// extern "C" Ogre_LIB_EXPORT void ogre_mno_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); @@ -410,7 +410,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_getMovableType(struct hg3dclass_struct }; }; -// . +// extern "C" Ogre_LIB_EXPORT void ogre_mno_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); @@ -420,11 +420,11 @@ extern "C" Ogre_LIB_EXPORT void ogre_mno_getBoundingRadius(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_mno_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mno_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ManualObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject")); bool result_cpp; result_cpp = (thisclass_cpp->hasEdgeList()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassManualObjectSection.cpp b/Bindings/Ogre/cBuild/ClassManualObjectSection.cpp index 6491967..1f4e648 100644 --- a/Bindings/Ogre/cBuild/ClassManualObjectSection.cpp +++ b/Bindings/Ogre/cBuild/ClassManualObjectSection.cpp @@ -99,7 +99,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mnos_setMaterialName(struct hg3dclass_struc }; // Set whether we need 32-bit indices. -extern "C" Ogre_LIB_EXPORT void ogre_mnos_set32BitIndices(struct hg3dclass_struct * thisclass_c, int n32_c) +extern "C" Ogre_LIB_EXPORT void ogre_mnos_set32BitIndices(struct hg3dclass_struct * thisclass_c, long n32_c) { Ogre::ManualObject::ManualObjectSection * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject::ManualObjectSection")); bool n32_cpp = (bool)n32_c; @@ -107,15 +107,15 @@ extern "C" Ogre_LIB_EXPORT void ogre_mnos_set32BitIndices(struct hg3dclass_struc }; // Get whether we need 32-bit indices. -extern "C" Ogre_LIB_EXPORT void ogre_mnos_get32BitIndices(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mnos_get32BitIndices(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ManualObject::ManualObjectSection * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject::ManualObjectSection")); bool result_cpp; result_cpp = (thisclass_cpp->get32BitIndices()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; -// . +// extern "C" Ogre_LIB_EXPORT void ogre_mnos_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c) { Ogre::ManualObject::ManualObjectSection * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject::ManualObjectSection")); @@ -124,7 +124,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mnos_getMaterial(struct hg3dclass_struct * *result_c = *((struct sharedptr_struct*) &result_cpp); }; -// . +// extern "C" Ogre_LIB_EXPORT void ogre_mnos_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * _c, float * result_c) { Ogre::ManualObject::ManualObjectSection * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ManualObject::ManualObjectSection")); diff --git a/Bindings/Ogre/cBuild/ClassMaterial.cpp b/Bindings/Ogre/cBuild/ClassMaterial.cpp index f240334..a4be418 100644 --- a/Bindings/Ogre/cBuild/ClassMaterial.cpp +++ b/Bindings/Ogre/cBuild/ClassMaterial.cpp @@ -51,16 +51,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_destruct(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_isTransparent(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_isTransparent(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool result_cpp; result_cpp = (thisclass_cpp->isTransparent()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setReceiveShadows(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setReceiveShadows(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool enabled_cpp = (bool)enabled_c; @@ -68,16 +68,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setReceiveShadows(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_getReceiveShadows(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_getReceiveShadows(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool result_cpp; result_cpp = (thisclass_cpp->getReceiveShadows()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool enabled_cpp = (bool)enabled_c; @@ -85,12 +85,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setTransparencyCastsShadows(struct hg3 }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_getTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_getTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool result_cpp; result_cpp = (thisclass_cpp->getTransparencyCastsShadows()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -160,7 +160,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_getNumLodLevels2(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, int changeGroup_c, char * newGroup_c, struct sharedptr_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, long changeGroup_c, char * newGroup_c, struct sharedptr_struct * result_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); Ogre::String newName_cpp = Ogre::String((const char*) newName_c); @@ -181,7 +181,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_copyDetailsTo(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_compile(struct hg3dclass_struct * thisclass_c, int autoManageTextureUnits_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_compile(struct hg3dclass_struct * thisclass_c, long autoManageTextureUnits_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool autoManageTextureUnits_cpp = (bool)autoManageTextureUnits_c; @@ -279,7 +279,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setSelfIllumination2(struct hg3dclass_ }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setDepthCheckEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setDepthCheckEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool enabled_cpp = (bool)enabled_c; @@ -287,7 +287,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setDepthCheckEnabled(struct hg3dclass_ }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setDepthWriteEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setDepthWriteEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool enabled_cpp = (bool)enabled_c; @@ -295,7 +295,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setDepthWriteEnabled(struct hg3dclass_ }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setColourWriteEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setColourWriteEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool enabled_cpp = (bool)enabled_c; @@ -303,7 +303,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setColourWriteEnabled(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setLightingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setLightingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool enabled_cpp = (bool)enabled_c; @@ -320,7 +320,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setDepthBias(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setTextureAnisotropy(struct hg3dclass_struct * thisclass_c, int maxAniso_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_setTextureAnisotropy(struct hg3dclass_struct * thisclass_c, long maxAniso_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); int maxAniso_cpp = (int)maxAniso_c; @@ -335,11 +335,11 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrl_touch(struct hg3dclass_struct * thiscl }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrl_getCompilationRequired(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrl_getCompilationRequired(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Material * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Material")); bool result_cpp; result_cpp = (thisclass_cpp->getCompilationRequired()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassMaterialManager.cpp b/Bindings/Ogre/cBuild/ClassMaterialManager.cpp index db49611..201d395 100644 --- a/Bindings/Ogre/cBuild/ClassMaterialManager.cpp +++ b/Bindings/Ogre/cBuild/ClassMaterialManager.cpp @@ -66,7 +66,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrlmgr_initialise(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_mtrlmgr_setDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned int maxAniso_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrlmgr_setDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned long maxAniso_c) { Ogre::MaterialManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MaterialManager")); unsigned int maxAniso_cpp = (unsigned int)maxAniso_c; @@ -74,12 +74,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_mtrlmgr_setDefaultAnisotropy(struct hg3dcla }; // Get the default maxAnisotropy. -extern "C" Ogre_LIB_EXPORT void ogre_mtrlmgr_getDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mtrlmgr_getDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::MaterialManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MaterialManager")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getDefaultAnisotropy()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassMesh.cpp b/Bindings/Ogre/cBuild/ClassMesh.cpp index d96936d..44c39ac 100644 --- a/Bindings/Ogre/cBuild/ClassMesh.cpp +++ b/Bindings/Ogre/cBuild/ClassMesh.cpp @@ -112,21 +112,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_msh_setSkeletonName(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_hasSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_hasSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->hasSkeleton()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->hasVertexAnimation()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -169,12 +169,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_msh_createManualLodLevel(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_isLodManual(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_isLodManual(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->isLodManual()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -185,21 +185,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_msh_removeLodLevels(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_isVertexBufferShadowed(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_isVertexBufferShadowed(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->isVertexBufferShadowed()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_isIndexBufferShadowed(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_isIndexBufferShadowed(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->isIndexBufferShadowed()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -224,25 +224,25 @@ extern "C" Ogre_LIB_EXPORT void ogre_msh_prepareForShadowVolume(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_isPreparedForShadowVolumes(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_isPreparedForShadowVolumes(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->isPreparedForShadowVolumes()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_isEdgeListBuilt(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_isEdgeListBuilt(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->isEdgeListBuilt()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_setAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, int autobuild_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_setAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, long autobuild_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool autobuild_cpp = (bool)autobuild_c; @@ -250,12 +250,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_msh_setAutoBuildEdgeLists(struct hg3dclass_ }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_getAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_getAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->getAutoBuildEdgeLists()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -268,12 +268,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_msh_getSharedVertexDataAnimationType(struct }; // Returns whether animation on shared vertex data includes normals. -extern "C" Ogre_LIB_EXPORT void ogre_msh_getSharedVertexDataAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_getSharedVertexDataAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); bool result_cpp; result_cpp = (thisclass_cpp->getSharedVertexDataAnimationIncludesNormals()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -300,13 +300,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_msh_getAnimation(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasAnimation(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -352,12 +352,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_msh_updateMaterialForAllSubMeshes(struct hg }; // -extern "C" Ogre_LIB_EXPORT void ogre_msh_getPoseCount(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_msh_getPoseCount(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Mesh * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Mesh")); size_t result_cpp; result_cpp = (thisclass_cpp->getPoseCount()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassMeshManager.cpp b/Bindings/Ogre/cBuild/ClassMeshManager.cpp index 3450ebe..03ef4ac 100644 --- a/Bindings/Ogre/cBuild/ClassMeshManager.cpp +++ b/Bindings/Ogre/cBuild/ClassMeshManager.cpp @@ -58,7 +58,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mshmgr_destruct(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_mshmgr_setPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, int enable_c) +extern "C" Ogre_LIB_EXPORT void ogre_mshmgr_setPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, long enable_c) { Ogre::MeshManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MeshManager")); bool enable_cpp = (bool)enable_c; @@ -66,12 +66,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_mshmgr_setPrepareAllMeshesForShadowVolumes( }; // -extern "C" Ogre_LIB_EXPORT void ogre_mshmgr_getPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mshmgr_getPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MeshManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MeshManager")); bool result_cpp; result_cpp = (thisclass_cpp->getPrepareAllMeshesForShadowVolumes()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassMovableObject.cpp b/Bindings/Ogre/cBuild/ClassMovableObject.cpp index d6946a5..afbc98e 100644 --- a/Bindings/Ogre/cBuild/ClassMovableObject.cpp +++ b/Bindings/Ogre/cBuild/ClassMovableObject.cpp @@ -95,21 +95,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_getParentSceneNode(struct hg3dclass_str }; // Gets whether the parent node is a TagPoint (or a SceneNode -extern "C" Ogre_LIB_EXPORT void ogre_mvo_isParentTagPoint(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_isParentTagPoint(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->isParentTagPoint()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_isAttached(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_isAttached(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->isAttached()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -120,12 +120,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_detachFromParent(struct hg3dclass_struc }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_isInScene(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_isInScene(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->isInScene()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -138,7 +138,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_getBoundingRadius(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool visible_cpp = (bool)visible_c; @@ -146,21 +146,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_setVisible(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getVisible(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getVisible(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->getVisible()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_isVisible(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_isVisible(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->isVisible()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -198,7 +198,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_getRenderingMinPixelSize(struct hg3dcla }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_setQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_setQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 flags_cpp = (uint32)flags_c; @@ -206,7 +206,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_setQueryFlags(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_addQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_addQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 flags_cpp = (uint32)flags_c; @@ -214,7 +214,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_addQueryFlags(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_removeQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_removeQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 flags_cpp = (uint32)flags_c; @@ -222,16 +222,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_removeQueryFlags(struct hg3dclass_struc }; // Returns the query flags relevant for this object. -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 result_cpp; result_cpp = (thisclass_cpp->getQueryFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_setVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_setVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 flags_cpp = (uint32)flags_c; @@ -239,7 +239,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_setVisibilityFlags(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_addVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_addVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 flags_cpp = (uint32)flags_c; @@ -247,7 +247,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_addVisibilityFlags(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_removeVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_removeVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 flags_cpp = (uint32)flags_c; @@ -255,25 +255,25 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_removeVisibilityFlags(struct hg3dclass_ }; // Returns the visibility flags relevant for this object. -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 result_cpp; result_cpp = (thisclass_cpp->getVisibilityFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getLightMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getLightMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 result_cpp; result_cpp = (thisclass_cpp->getLightMask()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_setLightMask(struct hg3dclass_struct * thisclass_c, unsigned int lightMask_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_setLightMask(struct hg3dclass_struct * thisclass_c, unsigned long lightMask_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 lightMask_cpp = (uint32)lightMask_c; @@ -281,16 +281,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_setLightMask(struct hg3dclass_struct * }; // Define a default implementation of method from ShadowCaster which implements no shadows. -extern "C" Ogre_LIB_EXPORT void ogre_mvo_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->hasEdgeList()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_setCastShadows(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_setCastShadows(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool enabled_cpp = (bool)enabled_c; @@ -298,21 +298,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_setCastShadows(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getCastShadows(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getCastShadows(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->getCastShadows()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getReceivesShadows(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getReceivesShadows(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->getReceivesShadows()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -326,16 +326,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_getPointExtrusionDistance(struct hg3dcl }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); uint32 result_cpp; result_cpp = (thisclass_cpp->getTypeFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool enabled_cpp = (bool)enabled_c; @@ -343,41 +343,41 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvo_setDebugDisplayEnabled(struct hg3dclass }; // Gets whether debug display of this object is enabled. -extern "C" Ogre_LIB_EXPORT void ogre_mvo_isDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_isDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObject * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObject")); bool result_cpp; result_cpp = (thisclass_cpp->isDebugDisplayEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_setDefaultQueryFlags(unsigned int flags_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_setDefaultQueryFlags(unsigned long flags_c) { uint32 flags_cpp = (uint32)flags_c; (Ogre::MovableObject::setDefaultQueryFlags(flags_cpp)); }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getDefaultQueryFlags(unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getDefaultQueryFlags(unsigned long * result_c) { uint32 result_cpp; result_cpp = (Ogre::MovableObject::getDefaultQueryFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_setDefaultVisibilityFlags(unsigned int flags_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_setDefaultVisibilityFlags(unsigned long flags_c) { uint32 flags_cpp = (uint32)flags_c; (Ogre::MovableObject::setDefaultVisibilityFlags(flags_cpp)); }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvo_getDefaultVisibilityFlags(unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvo_getDefaultVisibilityFlags(unsigned long * result_c) { uint32 result_cpp; result_cpp = (Ogre::MovableObject::getDefaultVisibilityFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassMovableObjectFactory.cpp b/Bindings/Ogre/cBuild/ClassMovableObjectFactory.cpp index 4821628..19e5fe4 100644 --- a/Bindings/Ogre/cBuild/ClassMovableObjectFactory.cpp +++ b/Bindings/Ogre/cBuild/ClassMovableObjectFactory.cpp @@ -70,20 +70,20 @@ extern "C" Ogre_LIB_EXPORT void ogre_mvof_destroyInstance(struct hg3dclass_struc }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvof_requestTypeFlags(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvof_requestTypeFlags(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::MovableObjectFactory * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObjectFactory")); bool result_cpp; result_cpp = (thisclass_cpp->requestTypeFlags()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_mvof_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mvof_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::MovableObjectFactory * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MovableObjectFactory")); uint32 result_cpp; result_cpp = (thisclass_cpp->getTypeFlags()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassMultiRenderTarget.cpp b/Bindings/Ogre/cBuild/ClassMultiRenderTarget.cpp index e777265..72af407 100644 --- a/Bindings/Ogre/cBuild/ClassMultiRenderTarget.cpp +++ b/Bindings/Ogre/cBuild/ClassMultiRenderTarget.cpp @@ -42,7 +42,7 @@ using Ogre::uint; // -extern "C" Ogre_LIB_EXPORT void ogre_mrt_bindSurface(struct hg3dclass_struct * thisclass_c, int attachment_c, struct hg3dclass_struct * target_c) +extern "C" Ogre_LIB_EXPORT void ogre_mrt_bindSurface(struct hg3dclass_struct * thisclass_c, long attachment_c, struct hg3dclass_struct * target_c) { Ogre::MultiRenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MultiRenderTarget")); size_t attachment_cpp = (size_t)attachment_c; @@ -51,7 +51,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mrt_bindSurface(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_mrt_unbindSurface(struct hg3dclass_struct * thisclass_c, int attachment_c) +extern "C" Ogre_LIB_EXPORT void ogre_mrt_unbindSurface(struct hg3dclass_struct * thisclass_c, long attachment_c) { Ogre::MultiRenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MultiRenderTarget")); size_t attachment_cpp = (size_t)attachment_c; @@ -59,7 +59,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_mrt_unbindSurface(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_mrt_getBoundSurface(struct hg3dclass_struct * thisclass_c, int index_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_mrt_getBoundSurface(struct hg3dclass_struct * thisclass_c, long index_c, struct hg3dclass_struct * result_c) { Ogre::MultiRenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::MultiRenderTarget")); size_t index_cpp = (size_t)index_c; diff --git a/Bindings/Ogre/cBuild/ClassNode.cpp b/Bindings/Ogre/cBuild/ClassNode.cpp index 64d677b..7adaa5c 100644 --- a/Bindings/Ogre/cBuild/ClassNode.cpp +++ b/Bindings/Ogre/cBuild/ClassNode.cpp @@ -165,7 +165,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_nd_getScale(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_nd_setInheritOrientation(struct hg3dclass_struct * thisclass_c, int inherit_c) +extern "C" Ogre_LIB_EXPORT void ogre_nd_setInheritOrientation(struct hg3dclass_struct * thisclass_c, long inherit_c) { Ogre::Node * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Node")); bool inherit_cpp = (bool)inherit_c; @@ -173,16 +173,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_nd_setInheritOrientation(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_nd_getInheritOrientation(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_nd_getInheritOrientation(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Node * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Node")); bool result_cpp; result_cpp = (thisclass_cpp->getInheritOrientation()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_nd_setInheritScale(struct hg3dclass_struct * thisclass_c, int inherit_c) +extern "C" Ogre_LIB_EXPORT void ogre_nd_setInheritScale(struct hg3dclass_struct * thisclass_c, long inherit_c) { Ogre::Node * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Node")); bool inherit_cpp = (bool)inherit_c; @@ -190,12 +190,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_nd_setInheritScale(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_nd_getInheritScale(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_nd_getInheritScale(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Node * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Node")); bool result_cpp; result_cpp = (thisclass_cpp->getInheritScale()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -478,7 +478,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_nd_getSquaredViewDepth(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_nd_needUpdate(struct hg3dclass_struct * thisclass_c, int forceParentUpdate_c) +extern "C" Ogre_LIB_EXPORT void ogre_nd_needUpdate(struct hg3dclass_struct * thisclass_c, long forceParentUpdate_c) { Ogre::Node * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Node")); bool forceParentUpdate_cpp = (bool)forceParentUpdate_c; @@ -486,7 +486,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_nd_needUpdate(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_nd_requestUpdate(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * child_c, int forceParentUpdate_c) +extern "C" Ogre_LIB_EXPORT void ogre_nd_requestUpdate(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * child_c, long forceParentUpdate_c) { Ogre::Node * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Node")); Ogre::Node * child_cpp = static_cast (getHG3DClassPtr(*child_c, "Ogre::Node")); diff --git a/Bindings/Ogre/cBuild/ClassNodeAnimationTrack.cpp b/Bindings/Ogre/cBuild/ClassNodeAnimationTrack.cpp index c02fd79..90f0f66 100644 --- a/Bindings/Ogre/cBuild/ClassNodeAnimationTrack.cpp +++ b/Bindings/Ogre/cBuild/ClassNodeAnimationTrack.cpp @@ -89,7 +89,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_noat_applyToNode(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_noat_setUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, int useShortestPath_c) +extern "C" Ogre_LIB_EXPORT void ogre_noat_setUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, long useShortestPath_c) { Ogre::NodeAnimationTrack * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::NodeAnimationTrack")); bool useShortestPath_cpp = (bool)useShortestPath_c; @@ -97,12 +97,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_noat_setUseShortestRotationPath(struct hg3d }; // -extern "C" Ogre_LIB_EXPORT void ogre_noat_getUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_noat_getUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::NodeAnimationTrack * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::NodeAnimationTrack")); bool result_cpp; result_cpp = (thisclass_cpp->getUseShortestRotationPath()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -116,12 +116,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_noat_apply(struct hg3dclass_struct * thiscl }; // -extern "C" Ogre_LIB_EXPORT void ogre_noat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_noat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::NodeAnimationTrack * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::NodeAnimationTrack")); bool result_cpp; result_cpp = (thisclass_cpp->hasNonZeroKeyFrames()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassRenderSystem.cpp b/Bindings/Ogre/cBuild/ClassRenderSystem.cpp index 9d5648b..20fdcd1 100644 --- a/Bindings/Ogre/cBuild/ClassRenderSystem.cpp +++ b/Bindings/Ogre/cBuild/ClassRenderSystem.cpp @@ -110,7 +110,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setAmbientLight(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setLightingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setLightingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool enabled_cpp = (bool)enabled_c; @@ -118,7 +118,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setLightingEnabled(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setWBufferEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setWBufferEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool enabled_cpp = (bool)enabled_c; @@ -126,12 +126,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setWBufferEnabled(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_getWBufferEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_getWBufferEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool result_cpp; result_cpp = (thisclass_cpp->getWBufferEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -200,7 +200,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_detachRenderTarget(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_getErrorDescription(struct hg3dclass_struct * thisclass_c, int errorNumber_c, char * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_getErrorDescription(struct hg3dclass_struct * thisclass_c, long errorNumber_c, char * result_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); long errorNumber_cpp = (long)errorNumber_c; @@ -214,7 +214,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_getErrorDescription(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool enabled_cpp = (bool)enabled_c; @@ -222,25 +222,25 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setWaitForVerticalBlank(struct hg3dclas }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_getWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_getWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool result_cpp; result_cpp = (thisclass_cpp->getWaitForVerticalBlank()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_getGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_getGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); size_t result_cpp; result_cpp = (thisclass_cpp->getGlobalNumberOfInstances()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, const int val_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, const long val_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); const size_t val_cpp = (size_t)val_c; @@ -256,26 +256,26 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setDepthBufferFor(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_areFixedFunctionLightsInViewSpace(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_areFixedFunctionLightsInViewSpace(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool result_cpp; result_cpp = (thisclass_cpp->areFixedFunctionLightsInViewSpace()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned int * pDest_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned long * pDest_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); ColourValue colour_cpp = *((ColourValue*) colour_c); uint32 pDest_cpp; (thisclass_cpp->convertColourValue(colour_cpp, &pDest_cpp)); - *pDest_c = (unsigned int)pDest_cpp; + *pDest_c = (unsigned long)pDest_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setStencilCheckEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setStencilCheckEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool enabled_cpp = (bool)enabled_c; @@ -283,7 +283,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setStencilCheckEnabled(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setNormaliseNormals(struct hg3dclass_struct * thisclass_c, int normalise_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setNormaliseNormals(struct hg3dclass_struct * thisclass_c, long normalise_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool normalise_cpp = (bool)normalise_c; @@ -307,13 +307,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_unbindGpuProgram(struct hg3dclass_struc }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_isGpuProgramBound(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_isGpuProgramBound(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c, long * result_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); enum Ogre::GpuProgramType gptype_cpp = (enum Ogre::GpuProgramType)gptype_c; bool result_cpp; result_cpp = (thisclass_cpp->isGpuProgramBound(gptype_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -335,7 +335,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_resetClipPlanes(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setInvertVertexWinding(struct hg3dclass_struct * thisclass_c, int invert_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setInvertVertexWinding(struct hg3dclass_struct * thisclass_c, long invert_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool invert_cpp = (bool)invert_c; @@ -343,16 +343,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setInvertVertexWinding(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_getInvertVertexWinding(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_getInvertVertexWinding(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool result_cpp; result_cpp = (thisclass_cpp->getInvertVertexWinding()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setScissorTest(struct hg3dclass_struct * thisclass_c, int enabled_c, int left_c, int top_c, int right_c, int bottom_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setScissorTest(struct hg3dclass_struct * thisclass_c, long enabled_c, long left_c, long top_c, long right_c, long bottom_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool enabled_cpp = (bool)enabled_c; @@ -364,7 +364,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setScissorTest(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_clearFrameBuffer(struct hg3dclass_struct * thisclass_c, unsigned int buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_clearFrameBuffer(struct hg3dclass_struct * thisclass_c, unsigned long buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); unsigned int buffers_cpp = (unsigned int)buffers_c; @@ -411,7 +411,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_getMaximumDepthInputValue(struct hg3dcl }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setCurrentPassIterationCount(struct hg3dclass_struct * thisclass_c, const int count_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setCurrentPassIterationCount(struct hg3dclass_struct * thisclass_c, const long count_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); const size_t count_cpp = (size_t)count_c; @@ -419,7 +419,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_setCurrentPassIterationCount(struct hg3 }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_setDeriveDepthBias(struct hg3dclass_struct * thisclass_c, int derive_c, float baseValue_c, float multiplier_c, float slopeScale_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_setDeriveDepthBias(struct hg3dclass_struct * thisclass_c, long derive_c, float baseValue_c, float multiplier_c, float slopeScale_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); bool derive_cpp = (bool)derive_c; @@ -458,12 +458,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_rds_unregisterThread(struct hg3dclass_struc }; // -extern "C" Ogre_LIB_EXPORT void ogre_rds_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rds_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::RenderSystem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderSystem")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getDisplayMonitorCount()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassRenderTarget.cpp b/Bindings/Ogre/cBuild/ClassRenderTarget.cpp index 0656e50..06f98bf 100644 --- a/Bindings/Ogre/cBuild/ClassRenderTarget.cpp +++ b/Bindings/Ogre/cBuild/ClassRenderTarget.cpp @@ -62,43 +62,43 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getName(struct hg3dclass_struct * this }; // Retrieve information about the render target. -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned int * width_c, unsigned int * height_c, unsigned int * colourDepth_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned long * width_c, unsigned long * height_c, unsigned long * colourDepth_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); unsigned int width_cpp; unsigned int height_cpp; unsigned int colourDepth_cpp; (thisclass_cpp->getMetrics(width_cpp, height_cpp, colourDepth_cpp)); - *width_c = (unsigned int)width_cpp; - *height_c = (unsigned int)height_cpp; - *colourDepth_c = (unsigned int)colourDepth_cpp; + *width_c = (unsigned long)width_cpp; + *height_c = (unsigned long)height_cpp; + *colourDepth_c = (unsigned long)colourDepth_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getWidth(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getWidth(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getWidth()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getHeight(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getHeight(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getHeight()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getColourDepth(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getColourDepth(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getColourDepth()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // @@ -126,7 +126,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_detachDepthBuffer(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_update(struct hg3dclass_struct * thisclass_c, int swapBuffers_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_update(struct hg3dclass_struct * thisclass_c, long swapBuffers_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool swapBuffers_cpp = (bool)swapBuffers_c; @@ -134,7 +134,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_update(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_swapBuffers(struct hg3dclass_struct * thisclass_c, int waitForVSync_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_swapBuffers(struct hg3dclass_struct * thisclass_c, long waitForVSync_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool waitForVSync_cpp = (bool)waitForVSync_c; @@ -142,7 +142,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_swapBuffers(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_addViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, int ZOrder_c, float left_c, float top_c, float width_c, float height_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_addViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, long ZOrder_c, float left_c, float top_c, float width_c, float height_c, struct hg3dclass_struct * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); Ogre::Camera * cam_cpp = static_cast (getHG3DClassPtr(*cam_c, "Ogre::Camera")); @@ -178,7 +178,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getViewport(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getViewportByZOrder(struct hg3dclass_struct * thisclass_c, int ZOrder_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getViewportByZOrder(struct hg3dclass_struct * thisclass_c, long ZOrder_c, struct hg3dclass_struct * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); int ZOrder_cpp = (int)ZOrder_c; @@ -189,17 +189,17 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getViewportByZOrder(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_hasViewportWithZOrder(struct hg3dclass_struct * thisclass_c, int ZOrder_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_hasViewportWithZOrder(struct hg3dclass_struct * thisclass_c, long ZOrder_c, long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); int ZOrder_cpp = (int)ZOrder_c; bool result_cpp; result_cpp = (thisclass_cpp->hasViewportWithZOrder(ZOrder_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_removeViewport(struct hg3dclass_struct * thisclass_c, int ZOrder_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_removeViewport(struct hg3dclass_struct * thisclass_c, long ZOrder_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); int ZOrder_cpp = (int)ZOrder_c; @@ -297,16 +297,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_removeAllListeners(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_isActive(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_isActive(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool result_cpp; result_cpp = (thisclass_cpp->isActive()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_setActive(struct hg3dclass_struct * thisclass_c, int state_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_setActive(struct hg3dclass_struct * thisclass_c, long state_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool state_cpp = (bool)state_c; @@ -314,7 +314,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_setActive(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, int autoupdate_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, long autoupdate_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool autoupdate_cpp = (bool)autoupdate_c; @@ -322,12 +322,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_setAutoUpdated(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool result_cpp; result_cpp = (thisclass_cpp->isAutoUpdated()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -354,57 +354,57 @@ extern "C" Ogre_LIB_EXPORT void ogre_rtgt_writeContentsToTimestampedFile(struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_requiresTextureFlipping(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_requiresTextureFlipping(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool result_cpp; result_cpp = (thisclass_cpp->requiresTextureFlipping()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getTriangleCount(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getTriangleCount(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); size_t result_cpp; result_cpp = (thisclass_cpp->getTriangleCount()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getBatchCount(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getBatchCount(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); size_t result_cpp; result_cpp = (thisclass_cpp->getBatchCount()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_isPrimary(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_isPrimary(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool result_cpp; result_cpp = (thisclass_cpp->isPrimary()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_isHardwareGammaEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_isHardwareGammaEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); bool result_cpp; result_cpp = (thisclass_cpp->isHardwareGammaEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getFSAA(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rtgt_getFSAA(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::RenderTarget * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderTarget")); uint result_cpp; result_cpp = (thisclass_cpp->getFSAA()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassRenderWindow.cpp b/Bindings/Ogre/cBuild/ClassRenderWindow.cpp index dc52f1a..504faa3 100644 --- a/Bindings/Ogre/cBuild/ClassRenderWindow.cpp +++ b/Bindings/Ogre/cBuild/ClassRenderWindow.cpp @@ -42,7 +42,7 @@ using Ogre::uint; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_setFullscreen(struct hg3dclass_struct * thisclass_c, int fullScreen_c, unsigned int width_c, unsigned int height_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_setFullscreen(struct hg3dclass_struct * thisclass_c, long fullScreen_c, unsigned long width_c, unsigned long height_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool fullScreen_cpp = (bool)fullScreen_c; @@ -59,7 +59,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rw_destroy(struct hg3dclass_struct * thiscl }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_resize(struct hg3dclass_struct * thisclass_c, unsigned int width_c, unsigned int height_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_resize(struct hg3dclass_struct * thisclass_c, unsigned long width_c, unsigned long height_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); unsigned int width_cpp = (unsigned int)width_c; @@ -75,7 +75,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rw_windowMovedOrResized(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_reposition(struct hg3dclass_struct * thisclass_c, int left_c, int top_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_reposition(struct hg3dclass_struct * thisclass_c, long left_c, long top_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); int left_cpp = (int)left_c; @@ -84,16 +84,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rw_reposition(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_isVisible(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_isVisible(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool result_cpp; result_cpp = (thisclass_cpp->isVisible()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool visible_cpp = (bool)visible_c; @@ -101,16 +101,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rw_setVisible(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_isHidden(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_isHidden(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool result_cpp; result_cpp = (thisclass_cpp->isHidden()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_setHidden(struct hg3dclass_struct * thisclass_c, int hidden_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_setHidden(struct hg3dclass_struct * thisclass_c, long hidden_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool hidden_cpp = (bool)hidden_c; @@ -118,7 +118,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rw_setHidden(struct hg3dclass_struct * this }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_setVSyncEnabled(struct hg3dclass_struct * thisclass_c, int vsync_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_setVSyncEnabled(struct hg3dclass_struct * thisclass_c, long vsync_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool vsync_cpp = (bool)vsync_c; @@ -126,16 +126,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rw_setVSyncEnabled(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_isVSyncEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_isVSyncEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool result_cpp; result_cpp = (thisclass_cpp->isVSyncEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_setVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned int interval_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_setVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned long interval_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); unsigned int interval_cpp = (unsigned int)interval_c; @@ -143,52 +143,52 @@ extern "C" Ogre_LIB_EXPORT void ogre_rw_setVSyncInterval(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_getVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_getVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getVSyncInterval()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_isActive(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_isActive(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool result_cpp; result_cpp = (thisclass_cpp->isActive()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_isClosed(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_isClosed(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool result_cpp; result_cpp = (thisclass_cpp->isClosed()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_isPrimary(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_isPrimary(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool result_cpp; result_cpp = (thisclass_cpp->isPrimary()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_isFullScreen(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_isFullScreen(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool result_cpp; result_cpp = (thisclass_cpp->isFullScreen()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned int * width_c, unsigned int * height_c, unsigned int * colourDepth_c, int * left_c, int * top_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned long * width_c, unsigned long * height_c, unsigned long * colourDepth_c, long * left_c, long * top_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); unsigned int width_cpp; @@ -197,24 +197,24 @@ extern "C" Ogre_LIB_EXPORT void ogre_rw_getMetrics(struct hg3dclass_struct * thi int left_cpp; int top_cpp; (thisclass_cpp->getMetrics(width_cpp, height_cpp, colourDepth_cpp, left_cpp, top_cpp)); - *width_c = (unsigned int)width_cpp; - *height_c = (unsigned int)height_cpp; - *colourDepth_c = (unsigned int)colourDepth_cpp; - *left_c = (int)left_cpp; - *top_c = (int)top_cpp; + *width_c = (unsigned long)width_cpp; + *height_c = (unsigned long)height_cpp; + *colourDepth_c = (unsigned long)colourDepth_cpp; + *left_c = (long)left_cpp; + *top_c = (long)top_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_isDeactivatedOnFocusChange(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_isDeactivatedOnFocusChange(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool result_cpp; result_cpp = (thisclass_cpp->isDeactivatedOnFocusChange()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rw_setDeactivateOnFocusChange(struct hg3dclass_struct * thisclass_c, int deactivate_c) +extern "C" Ogre_LIB_EXPORT void ogre_rw_setDeactivateOnFocusChange(struct hg3dclass_struct * thisclass_c, long deactivate_c) { Ogre::RenderWindow * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::RenderWindow")); bool deactivate_cpp = (bool)deactivate_c; diff --git a/Bindings/Ogre/cBuild/ClassRenderable.cpp b/Bindings/Ogre/cBuild/ClassRenderable.cpp index 7e3fb84..6db29e6 100644 --- a/Bindings/Ogre/cBuild/ClassRenderable.cpp +++ b/Bindings/Ogre/cBuild/ClassRenderable.cpp @@ -59,14 +59,14 @@ extern "C" Ogre_LIB_EXPORT void ogre_rndl_getMaterial(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, long * result_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); Ogre::SceneManager * sm_cpp = static_cast (getHG3DClassPtr(*sm_c, "Ogre::SceneManager")); Ogre::RenderSystem * rsys_cpp = static_cast (getHG3DClassPtr(*rsys_c, "Ogre::RenderSystem")); bool result_cpp; result_cpp = (thisclass_cpp->preRender(sm_cpp, rsys_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -88,7 +88,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rndl_getNumWorldTransforms(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int useIdentityProjection_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long useIdentityProjection_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); bool useIdentityProjection_cpp = (bool)useIdentityProjection_c; @@ -96,16 +96,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rndl_setUseIdentityProjection(struct hg3dcl }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); bool result_cpp; result_cpp = (thisclass_cpp->getUseIdentityProjection()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_setUseIdentityView(struct hg3dclass_struct * thisclass_c, int useIdentityView_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_setUseIdentityView(struct hg3dclass_struct * thisclass_c, long useIdentityView_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); bool useIdentityView_cpp = (bool)useIdentityView_c; @@ -113,12 +113,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_rndl_setUseIdentityView(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_getUseIdentityView(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_getUseIdentityView(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); bool result_cpp; result_cpp = (thisclass_cpp->getUseIdentityView()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -132,16 +132,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rndl_getSquaredViewDepth(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_getCastsShadows(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_getCastsShadows(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); bool result_cpp; result_cpp = (thisclass_cpp->getCastsShadows()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_removeCustomParameter(struct hg3dclass_struct * thisclass_c, int index_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_removeCustomParameter(struct hg3dclass_struct * thisclass_c, long index_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); size_t index_cpp = (size_t)index_c; @@ -149,17 +149,17 @@ extern "C" Ogre_LIB_EXPORT void ogre_rndl_removeCustomParameter(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_hasCustomParameter(struct hg3dclass_struct * thisclass_c, int index_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_hasCustomParameter(struct hg3dclass_struct * thisclass_c, long index_c, long * result_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); size_t index_cpp = (size_t)index_c; bool result_cpp; result_cpp = (thisclass_cpp->hasCustomParameter(index_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int override_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long override_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); bool override_cpp = (bool)override_c; @@ -167,11 +167,11 @@ extern "C" Ogre_LIB_EXPORT void ogre_rndl_setPolygonModeOverrideable(struct hg3d }; // -extern "C" Ogre_LIB_EXPORT void ogre_rndl_getPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rndl_getPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Renderable * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Renderable")); bool result_cpp; result_cpp = (thisclass_cpp->getPolygonModeOverrideable()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassResource.cpp b/Bindings/Ogre/cBuild/ClassResource.cpp index ec0b095..944114f 100644 --- a/Bindings/Ogre/cBuild/ClassResource.cpp +++ b/Bindings/Ogre/cBuild/ClassResource.cpp @@ -49,7 +49,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrc_destruct(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_prepare(struct hg3dclass_struct * thisclass_c, int backgroundThread_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_prepare(struct hg3dclass_struct * thisclass_c, long backgroundThread_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool backgroundThread_cpp = (bool)backgroundThread_c; @@ -57,7 +57,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrc_prepare(struct hg3dclass_struct * this }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_load(struct hg3dclass_struct * thisclass_c, int backgroundThread_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_load(struct hg3dclass_struct * thisclass_c, long backgroundThread_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool backgroundThread_cpp = (bool)backgroundThread_c; @@ -72,21 +72,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrc_reload(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isReloadable(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isReloadable(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool result_cpp; result_cpp = (thisclass_cpp->isReloadable()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isManuallyLoaded(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isManuallyLoaded(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool result_cpp; result_cpp = (thisclass_cpp->isManuallyLoaded()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -97,12 +97,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrc_unload(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_getSize(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_getSize(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); size_t result_cpp; result_cpp = (thisclass_cpp->getSize()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -126,43 +126,43 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrc_getName(struct hg3dclass_struct * this }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isPrepared(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isPrepared(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool result_cpp; result_cpp = (thisclass_cpp->isPrepared()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isLoaded(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isLoaded(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool result_cpp; result_cpp = (thisclass_cpp->isLoaded()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isLoading(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isLoading(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool result_cpp; result_cpp = (thisclass_cpp->isLoading()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isBackgroundLoaded(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_isBackgroundLoaded(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool result_cpp; result_cpp = (thisclass_cpp->isBackgroundLoaded()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_setBackgroundLoaded(struct hg3dclass_struct * thisclass_c, int bl_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_setBackgroundLoaded(struct hg3dclass_struct * thisclass_c, long bl_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); bool bl_cpp = (bool)bl_c; @@ -221,11 +221,11 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrc_getOrigin(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrc_getStateCount(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrc_getStateCount(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Resource * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Resource")); size_t result_cpp; result_cpp = (thisclass_cpp->getStateCount()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassResourceGroupManager.cpp b/Bindings/Ogre/cBuild/ClassResourceGroupManager.cpp index 1c347b8..ab8443e 100644 --- a/Bindings/Ogre/cBuild/ClassResourceGroupManager.cpp +++ b/Bindings/Ogre/cBuild/ClassResourceGroupManager.cpp @@ -58,7 +58,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_destruct(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_createResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, const int inGlobalPool_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_createResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, const long inGlobalPool_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -82,7 +82,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_initialiseAllResourceGroups(struct hg }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_prepareResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int prepareMainResources_c, int prepareWorldGeom_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_prepareResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long prepareMainResources_c, long prepareWorldGeom_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -92,7 +92,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_prepareResourceGroup(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_loadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int loadMainResources_c, int loadWorldGeom_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_loadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long loadMainResources_c, long loadWorldGeom_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -102,7 +102,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_loadResourceGroup(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_unloadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int reloadableOnly_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_unloadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long reloadableOnly_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -111,7 +111,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_unloadResourceGroup(struct hg3dclass_ }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_unloadUnreferencedResourcesInGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int reloadableOnly_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_unloadUnreferencedResourcesInGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long reloadableOnly_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -136,37 +136,37 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_destroyResourceGroup(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_isResourceGroupInitialised(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_isResourceGroupInitialised(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->isResourceGroupInitialised(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_isResourceGroupLoaded(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_isResourceGroupLoaded(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->isResourceGroupLoaded(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_resourceGroupExists(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_resourceGroupExists(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->resourceGroupExists(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * resGroup_c, int recursive_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * resGroup_c, long recursive_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -186,14 +186,14 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_removeResourceLocation(struct hg3dcla }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_resourceLocationExists(struct hg3dclass_struct * thisclass_c, char * name_c, char * resGroup_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_resourceLocationExists(struct hg3dclass_struct * thisclass_c, char * name_c, char * resGroup_c, long * result_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); Ogre::String resGroup_cpp = Ogre::String((const char*) resGroup_c); bool result_cpp; result_cpp = (thisclass_cpp->resourceLocationExists(name_cpp, resGroup_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -206,24 +206,24 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_undeclareResource(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * group_c, char * filename_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * group_c, char * filename_c, long * result_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String group_cpp = Ogre::String((const char*) group_c); Ogre::String filename_cpp = Ogre::String((const char*) filename_c); bool result_cpp; result_cpp = (thisclass_cpp->resourceExists(group_cpp, filename_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_resourceExistsInAnyGroup(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_resourceExistsInAnyGroup(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String filename_cpp = Ogre::String((const char*) filename_c); bool result_cpp; result_cpp = (thisclass_cpp->resourceExistsInAnyGroup(filename_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -300,13 +300,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_unlinkWorldGeometryFromResourceGroup( }; // -extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_isResourceGroupInGlobalPool(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rgmgr_isResourceGroupInGlobalPool(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::ResourceGroupManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceGroupManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->isResourceGroupInGlobalPool(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassResourceManager.cpp b/Bindings/Ogre/cBuild/ClassResourceManager.cpp index c29253c..9c6fd8b 100644 --- a/Bindings/Ogre/cBuild/ClassResourceManager.cpp +++ b/Bindings/Ogre/cBuild/ClassResourceManager.cpp @@ -49,7 +49,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_destruct(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_setMemoryBudget(struct hg3dclass_struct * thisclass_c, int bytes_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_setMemoryBudget(struct hg3dclass_struct * thisclass_c, long bytes_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); size_t bytes_cpp = (size_t)bytes_c; @@ -57,21 +57,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_setMemoryBudget(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_getMemoryBudget(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_getMemoryBudget(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); size_t result_cpp; result_cpp = (thisclass_cpp->getMemoryBudget()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_getMemoryUsage(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_getMemoryUsage(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); size_t result_cpp; result_cpp = (thisclass_cpp->getMemoryUsage()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -83,7 +83,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_unload(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_unloadAll(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_unloadAll(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); bool reloadableOnly_cpp = (bool)reloadableOnly_c; @@ -91,7 +91,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_unloadAll(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_reloadAll(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_reloadAll(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); bool reloadableOnly_cpp = (bool)reloadableOnly_c; @@ -99,7 +99,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_reloadAll(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_unloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_unloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); bool reloadableOnly_cpp = (bool)reloadableOnly_c; @@ -107,7 +107,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_unloadUnreferencedResources(struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_reloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_reloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); bool reloadableOnly_cpp = (bool)reloadableOnly_c; @@ -130,7 +130,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_removeAll(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_removeUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_removeUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); bool reloadableOnly_cpp = (bool)reloadableOnly_c; @@ -138,13 +138,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_removeUnreferencedResources(struct }; // Returns whether the named resource exists in this manager. -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->resourceExists(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -170,7 +170,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_getResourceType(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_setVerbose(struct hg3dclass_struct * thisclass_c, int v_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_setVerbose(struct hg3dclass_struct * thisclass_c, long v_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); bool v_cpp = (bool)v_c; @@ -178,12 +178,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_setVerbose(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_getVerbose(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rsrcmgr_getVerbose(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::ResourceManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::ResourceManager")); bool result_cpp; result_cpp = (thisclass_cpp->getVerbose()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Destroy a resource pool. diff --git a/Bindings/Ogre/cBuild/ClassRoot.cpp b/Bindings/Ogre/cBuild/ClassRoot.cpp index 73742af..3a80dc0 100644 --- a/Bindings/Ogre/cBuild/ClassRoot.cpp +++ b/Bindings/Ogre/cBuild/ClassRoot.cpp @@ -69,21 +69,21 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_saveConfig(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_restoreConfig(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_restoreConfig(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool result_cpp; result_cpp = (thisclass_cpp->restoreConfig()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_showConfigDialog(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_showConfigDialog(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool result_cpp; result_cpp = (thisclass_cpp->showConfigDialog()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -124,7 +124,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_getRenderSystem(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_initialise(struct hg3dclass_struct * thisclass_c, int autoCreateWindow_c, char * windowTitle_c, char * customCapabilitiesConfig_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_initialise(struct hg3dclass_struct * thisclass_c, long autoCreateWindow_c, char * windowTitle_c, char * customCapabilitiesConfig_c, struct hg3dclass_struct * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool autoCreateWindow_cpp = (bool)autoCreateWindow_c; @@ -137,25 +137,25 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_initialise(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_isInitialised(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_isInitialised(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool result_cpp; result_cpp = (thisclass_cpp->isInitialised()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_getRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_getRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool result_cpp; result_cpp = (thisclass_cpp->getRemoveRenderQueueStructuresOnClear()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_setRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, int r_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_setRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, long r_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool r_cpp = (bool)r_c; @@ -210,13 +210,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_getSceneManager(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_hasSceneManager(struct hg3dclass_struct * thisclass_c, char * instanceName_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_hasSceneManager(struct hg3dclass_struct * thisclass_c, char * instanceName_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); Ogre::String instanceName_cpp = Ogre::String((const char*) instanceName_c); bool result_cpp; result_cpp = (thisclass_cpp->hasSceneManager(instanceName_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -240,7 +240,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_getMeshManager(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_getErrorDescription(struct hg3dclass_struct * thisclass_c, int errorNumber_c, char * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_getErrorDescription(struct hg3dclass_struct * thisclass_c, long errorNumber_c, char * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); long errorNumber_cpp = (long)errorNumber_c; @@ -268,22 +268,22 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_startRendering(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_renderOneFrame(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_renderOneFrame(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool result_cpp; result_cpp = (thisclass_cpp->renderOneFrame()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_renderOneFrame2(struct hg3dclass_struct * thisclass_c, float timeSinceLastFrame_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_renderOneFrame2(struct hg3dclass_struct * thisclass_c, float timeSinceLastFrame_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); Real timeSinceLastFrame_cpp = (Real)timeSinceLastFrame_c; bool result_cpp; result_cpp = (thisclass_cpp->renderOneFrame(timeSinceLastFrame_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -294,7 +294,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_shutdown(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * groupName_c, int recursive_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * groupName_c, long recursive_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -314,13 +314,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_removeResourceLocation(struct hg3dclass_ }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned int * pDest_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned long * pDest_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); ColourValue colour_cpp = *((ColourValue*) colour_c); uint32 pDest_cpp; (thisclass_cpp->convertColourValue(colour_cpp, &pDest_cpp)); - *pDest_c = (unsigned int)pDest_cpp; + *pDest_c = (unsigned long)pDest_cpp; }; // @@ -398,6 +398,15 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_unloadPlugin(struct hg3dclass_struct * t (thisclass_cpp->unloadPlugin(pluginName_cpp)); }; +// +extern "C" Ogre_LIB_EXPORT void ogre_rt_getNextFrameNumber(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) +{ + Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); + unsigned long result_cpp; + result_cpp = (thisclass_cpp->getNextFrameNumber()); + *result_c = (unsigned long)result_cpp; +}; + // extern "C" Ogre_LIB_EXPORT void ogre_rt_destroyRenderQueueInvocationSequence(struct hg3dclass_struct * thisclass_c, char * name_c) { @@ -438,7 +447,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_getFrameSmoothingPeriod(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_addMovableObjectFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c, int overrideExisting_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_addMovableObjectFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c, long overrideExisting_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); Ogre::MovableObjectFactory * fact_cpp = static_cast (getHG3DClassPtr(*fact_c, "Ogre::MovableObjectFactory")); @@ -455,13 +464,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_removeMovableObjectFactory(struct hg3dcl }; // Checks whether a factory is registered for a given MovableObject -extern "C" Ogre_LIB_EXPORT void ogre_rt_hasMovableObjectFactory(struct hg3dclass_struct * thisclass_c, char * typeName_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_hasMovableObjectFactory(struct hg3dclass_struct * thisclass_c, char * typeName_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); Ogre::String typeName_cpp = Ogre::String((const char*) typeName_c); bool result_cpp; result_cpp = (thisclass_cpp->hasMovableObjectFactory(typeName_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Get a MovableObjectFactory @@ -476,16 +485,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_getMovableObjectFactory(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getDisplayMonitorCount()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_setBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, int redundant_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_setBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, long redundant_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool redundant_cpp = (bool)redundant_c; @@ -493,16 +502,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_setBlendIndicesGpuRedundant(struct hg3dc }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_isBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_isBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool result_cpp; result_cpp = (thisclass_cpp->isBlendIndicesGpuRedundant()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_setBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, int redundant_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_setBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, long redundant_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool redundant_cpp = (bool)redundant_c; @@ -510,12 +519,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_rt_setBlendWeightsGpuRedundant(struct hg3dc }; // -extern "C" Ogre_LIB_EXPORT void ogre_rt_isBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_rt_isBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Root * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Root")); bool result_cpp; result_cpp = (thisclass_cpp->isBlendWeightsGpuRedundant()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassSceneManager.cpp b/Bindings/Ogre/cBuild/ClassSceneManager.cpp index a2a4b33..b6020be 100644 --- a/Bindings/Ogre/cBuild/ClassSceneManager.cpp +++ b/Bindings/Ogre/cBuild/ClassSceneManager.cpp @@ -103,13 +103,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getCamera(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasCamera(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasCamera(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasCamera(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -168,13 +168,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getLight(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasLight(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasLight(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasLight(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -259,13 +259,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getSceneNode(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasSceneNode(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasSceneNode(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasSceneNode(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -350,13 +350,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getEntity(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasEntity(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasEntity(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasEntity(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -415,13 +415,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getManualObject(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasManualObject(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasManualObject(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasManualObject(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -480,13 +480,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getBillboardChain(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasBillboardChain(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasBillboardChain(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasBillboardChain(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -513,13 +513,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_destroyAllBillboardChains(struct hg3d }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasRibbonTrail(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasRibbonTrail(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasRibbonTrail(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -538,13 +538,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_destroyAllRibbonTrails(struct hg3dcla }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasParticleSystem(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasParticleSystem(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasParticleSystem(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -603,27 +603,27 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setWorldGeometry(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_estimateWorldGeometry(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_estimateWorldGeometry(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String filename_cpp = Ogre::String((const char*) filename_c); size_t result_cpp; result_cpp = (thisclass_cpp->estimateWorldGeometry(filename_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasOption(struct hg3dclass_struct * thisclass_c, char * strKey_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasOption(struct hg3dclass_struct * thisclass_c, char * strKey_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String strKey_cpp = Ogre::String((const char*) strKey_c); bool result_cpp; result_cpp = (thisclass_cpp->hasOption(strKey_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, int enable_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, long enable_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool enable_cpp = (bool)enable_c; @@ -631,12 +631,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyPlaneEnabled(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isSkyPlaneEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -650,7 +650,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getSkyPlaneNode(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyBox(struct hg3dclass_struct * thisclass_c, int enable_c, char * materialName_c, float distance_c, int drawFirst_c, struct quaternion_struct * orientation_c, char * groupName_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyBox(struct hg3dclass_struct * thisclass_c, long enable_c, char * materialName_c, float distance_c, long drawFirst_c, struct quaternion_struct * orientation_c, char * groupName_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool enable_cpp = (bool)enable_c; @@ -663,7 +663,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyBox(struct hg3dclass_struct * t }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, int enable_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, long enable_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool enable_cpp = (bool)enable_c; @@ -671,12 +671,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyBoxEnabled(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isSkyBoxEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -690,7 +690,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getSkyBoxNode(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyDome(struct hg3dclass_struct * thisclass_c, int enable_c, char * materialName_c, float curvature_c, float tiling_c, float distance_c, int drawFirst_c, struct quaternion_struct * orientation_c, int xsegments_c, int ysegments_c, int ysegments_keep_c, char * groupName_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyDome(struct hg3dclass_struct * thisclass_c, long enable_c, char * materialName_c, float curvature_c, float tiling_c, float distance_c, long drawFirst_c, struct quaternion_struct * orientation_c, long xsegments_c, long ysegments_c, long ysegments_keep_c, char * groupName_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool enable_cpp = (bool)enable_c; @@ -708,7 +708,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyDome(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, int enable_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, long enable_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool enable_cpp = (bool)enable_c; @@ -716,12 +716,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setSkyDomeEnabled(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isSkyDomeEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -771,7 +771,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getFogDensity(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_createBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, unsigned int poolSize_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_createBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, unsigned long poolSize_c, struct hg3dclass_struct * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); @@ -783,7 +783,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_createBillboardSet(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_createBillboardSet2(struct hg3dclass_struct * thisclass_c, unsigned int poolSize_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_createBillboardSet2(struct hg3dclass_struct * thisclass_c, unsigned long poolSize_c, struct hg3dclass_struct * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); unsigned int poolSize_cpp = (unsigned int)poolSize_c; @@ -805,13 +805,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getBillboardSet(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasBillboardSet(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -838,7 +838,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_destroyAllBillboardSets(struct hg3dcl }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, int display_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, long display_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool display_cpp = (bool)display_c; @@ -846,12 +846,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setDisplaySceneNodes(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getDisplaySceneNodes()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -878,13 +878,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getAnimation(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasAnimation(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -925,13 +925,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getAnimationState(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasAnimationState(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -974,7 +974,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getSpecialCaseRenderQueueMode(struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_showBoundingBoxes(struct hg3dclass_struct * thisclass_c, int bShow_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_showBoundingBoxes(struct hg3dclass_struct * thisclass_c, long bShow_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool bShow_cpp = (bool)bShow_c; @@ -982,16 +982,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_showBoundingBoxes(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShowBoundingBoxes(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShowBoundingBoxes(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getShowBoundingBoxes()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShowDebugShadows(struct hg3dclass_struct * thisclass_c, int debug_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShowDebugShadows(struct hg3dclass_struct * thisclass_c, long debug_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool debug_cpp = (bool)debug_c; @@ -999,12 +999,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShowDebugShadows(struct hg3dclass_ }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShowDebugShadows(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShowDebugShadows(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getShowDebugShadows()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -1068,7 +1068,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowFarDistanceSquared(struct hg }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, int size_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, long size_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); size_t size_cpp = (size_t)size_c; @@ -1076,12 +1076,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowIndexBufferSize(struct hg3dc }; // Get the size of the shadow index buffer. -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); size_t result_cpp; result_cpp = (thisclass_cpp->getShadowIndexBufferSize()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -1101,7 +1101,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureFSAA(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureCount(struct hg3dclass_struct * thisclass_c, int count_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureCount(struct hg3dclass_struct * thisclass_c, long count_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); size_t count_cpp = (size_t)count_c; @@ -1109,16 +1109,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureCount(struct hg3dclas }; // Get the number of the textures allocated for texture based shadows. -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowTextureCount(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowTextureCount(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); size_t result_cpp; result_cpp = (thisclass_cpp->getShadowTextureCount()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, int count_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, long count_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); enum Light::LightTypes type_cpp = (enum Light::LightTypes)type_c; @@ -1127,17 +1127,17 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureCountPerLightType(str }; // Get the number of shadow textures is assigned for the given light type. -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); enum Light::LightTypes type_cpp = (enum Light::LightTypes)type_c; size_t result_cpp; result_cpp = (thisclass_cpp->getShadowTextureCountPerLightType(type_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowTexture(struct hg3dclass_struct * thisclass_c, int shadowIndex_c, struct sharedptr_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowTexture(struct hg3dclass_struct * thisclass_c, long shadowIndex_c, struct sharedptr_struct * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); size_t shadowIndex_cpp = (size_t)shadowIndex_c; @@ -1180,7 +1180,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureFadeEnd(struct hg3dcl }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, int selfShadow_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, long selfShadow_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool selfShadow_cpp = (bool)selfShadow_c; @@ -1188,12 +1188,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureSelfShadow(struct hg3 }; // Gets whether or not texture shadows attempt to self-shadow. -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getShadowTextureSelfShadow()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -1213,7 +1213,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowTextureReceiverMaterial(stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, int bf_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, long bf_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool bf_cpp = (bool)bf_c; @@ -1221,16 +1221,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowCasterRenderBackFaces(struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getShadowCasterRenderBackFaces()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowUseInfiniteFarPlane(struct hg3dclass_struct * thisclass_c, int enable_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowUseInfiniteFarPlane(struct hg3dclass_struct * thisclass_c, long enable_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool enable_cpp = (bool)enable_c; @@ -1238,61 +1238,61 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowUseInfiniteFarPlane(struct h }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueStencilBased(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueStencilBased(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isShadowTechniqueStencilBased()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueTextureBased(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueTextureBased(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isShadowTechniqueTextureBased()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueModulative(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueModulative(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isShadowTechniqueModulative()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueAdditive(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueAdditive(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isShadowTechniqueAdditive()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueIntegrated(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueIntegrated(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isShadowTechniqueIntegrated()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueInUse(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isShadowTechniqueInUse(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isShadowTechniqueInUse()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool enabled_cpp = (bool)enabled_c; @@ -1300,16 +1300,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setShadowUseLightClipPlanes(struct hg }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getShadowUseLightClipPlanes()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setLateMaterialResolving(struct hg3dclass_struct * thisclass_c, int isLate_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setLateMaterialResolving(struct hg3dclass_struct * thisclass_c, long isLate_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool isLate_cpp = (bool)isLate_c; @@ -1317,22 +1317,22 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setLateMaterialResolving(struct hg3dc }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isLateMaterialResolving(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_isLateMaterialResolving(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->isLateMaterialResolving()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasStaticGeometry(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasStaticGeometry(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasStaticGeometry(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -1366,13 +1366,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_destroyAllInstancedGeometry(struct hg }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasInstanceManager(struct hg3dclass_struct * thisclass_c, char * managerName_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasInstanceManager(struct hg3dclass_struct * thisclass_c, char * managerName_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String managerName_cpp = Ogre::String((const char*) managerName_c); bool result_cpp; result_cpp = (thisclass_cpp->hasInstanceManager(managerName_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -1435,14 +1435,14 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getMovableObject(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasMovableObject(struct hg3dclass_struct * thisclass_c, char * name_c, char * typeName_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_hasMovableObject(struct hg3dclass_struct * thisclass_c, char * name_c, char * typeName_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); Ogre::String name_cpp = Ogre::String((const char*) name_c); Ogre::String typeName_cpp = Ogre::String((const char*) typeName_c); bool result_cpp; result_cpp = (thisclass_cpp->hasMovableObject(name_cpp, typeName_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -1479,7 +1479,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_extractAllMovableObjectsByType(struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int vmask_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long vmask_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); uint32 vmask_cpp = (uint32)vmask_c; @@ -1487,16 +1487,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setVisibilityMask(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); uint32 result_cpp; result_cpp = (thisclass_cpp->getVisibilityMask()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setFindVisibleObjects(struct hg3dclass_struct * thisclass_c, int find_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setFindVisibleObjects(struct hg3dclass_struct * thisclass_c, long find_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool find_cpp = (bool)find_c; @@ -1504,16 +1504,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setFindVisibleObjects(struct hg3dclas }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getFindVisibleObjects(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getFindVisibleObjects(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getFindVisibleObjects()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, int n_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, long n_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool n_cpp = (bool)n_c; @@ -1521,16 +1521,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setNormaliseNormalsOnScale(struct hg3 }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getNormaliseNormalsOnScale()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, int n_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, long n_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool n_cpp = (bool)n_c; @@ -1538,12 +1538,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setFlipCullingOnNegativeScale(struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getFlipCullingOnNegativeScale()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -1567,7 +1567,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getCurrentViewport(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, int rel_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, long rel_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool rel_cpp = (bool)rel_c; @@ -1575,11 +1575,11 @@ extern "C" Ogre_LIB_EXPORT void ogre_scmgr_setCameraRelativeRendering(struct hg3 }; // -extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_scmgr_getCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneManager")); bool result_cpp; result_cpp = (thisclass_cpp->getCameraRelativeRendering()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassSceneNode.cpp b/Bindings/Ogre/cBuild/ClassSceneNode.cpp index f2de1f1..06e412f 100644 --- a/Bindings/Ogre/cBuild/ClassSceneNode.cpp +++ b/Bindings/Ogre/cBuild/ClassSceneNode.cpp @@ -127,12 +127,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_sn_detachAllObjects(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_sn_isInSceneGraph(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_sn_isInSceneGraph(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneNode * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneNode")); bool result_cpp; result_cpp = (thisclass_cpp->isInSceneGraph()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -169,7 +169,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_sn_removeAndDestroyAllChildren(struct hg3dc }; // -extern "C" Ogre_LIB_EXPORT void ogre_sn_showBoundingBox(struct hg3dclass_struct * thisclass_c, int bShow_c) +extern "C" Ogre_LIB_EXPORT void ogre_sn_showBoundingBox(struct hg3dclass_struct * thisclass_c, long bShow_c) { Ogre::SceneNode * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneNode")); bool bShow_cpp = (bool)bShow_c; @@ -177,7 +177,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_sn_showBoundingBox(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_sn_hideBoundingBox(struct hg3dclass_struct * thisclass_c, int bHide_c) +extern "C" Ogre_LIB_EXPORT void ogre_sn_hideBoundingBox(struct hg3dclass_struct * thisclass_c, long bHide_c) { Ogre::SceneNode * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneNode")); bool bHide_cpp = (bool)bHide_c; @@ -185,12 +185,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_sn_hideBoundingBox(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_sn_getShowBoundingBox(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_sn_getShowBoundingBox(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::SceneNode * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneNode")); bool result_cpp; result_cpp = (thisclass_cpp->getShowBoundingBox()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -219,7 +219,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_sn_createChildSceneNode2(struct hg3dclass_s }; // -extern "C" Ogre_LIB_EXPORT void ogre_sn_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, int useFixed_c, struct vector3_struct * fixedAxis_c) +extern "C" Ogre_LIB_EXPORT void ogre_sn_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, long useFixed_c, struct vector3_struct * fixedAxis_c) { Ogre::SceneNode * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneNode")); bool useFixed_cpp = (bool)useFixed_c; @@ -266,7 +266,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_sn_getParentSceneNode(struct hg3dclass_stru }; // -extern "C" Ogre_LIB_EXPORT void ogre_sn_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c, int cascade_c) +extern "C" Ogre_LIB_EXPORT void ogre_sn_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c, long cascade_c) { Ogre::SceneNode * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneNode")); bool visible_cpp = (bool)visible_c; @@ -275,7 +275,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_sn_setVisible(struct hg3dclass_struct * thi }; // -extern "C" Ogre_LIB_EXPORT void ogre_sn_flipVisibility(struct hg3dclass_struct * thisclass_c, int cascade_c) +extern "C" Ogre_LIB_EXPORT void ogre_sn_flipVisibility(struct hg3dclass_struct * thisclass_c, long cascade_c) { Ogre::SceneNode * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneNode")); bool cascade_cpp = (bool)cascade_c; @@ -283,7 +283,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_sn_flipVisibility(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_sn_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c, int cascade_c) +extern "C" Ogre_LIB_EXPORT void ogre_sn_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c, long cascade_c) { Ogre::SceneNode * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::SceneNode")); bool enabled_cpp = (bool)enabled_c; diff --git a/Bindings/Ogre/cBuild/ClassSkeleton.cpp b/Bindings/Ogre/cBuild/ClassSkeleton.cpp index 0b470ff..9e4a132 100644 --- a/Bindings/Ogre/cBuild/ClassSkeleton.cpp +++ b/Bindings/Ogre/cBuild/ClassSkeleton.cpp @@ -135,13 +135,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_skl_getBone2(struct hg3dclass_struct * this }; // -extern "C" Ogre_LIB_EXPORT void ogre_skl_hasBone(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_skl_hasBone(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::Skeleton * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Skeleton")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasBone(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -152,7 +152,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_skl_setBindingPose(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_skl_reset(struct hg3dclass_struct * thisclass_c, int resetManualBones_c) +extern "C" Ogre_LIB_EXPORT void ogre_skl_reset(struct hg3dclass_struct * thisclass_c, long resetManualBones_c) { Ogre::Skeleton * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Skeleton")); bool resetManualBones_cpp = (bool)resetManualBones_c; @@ -183,13 +183,13 @@ extern "C" Ogre_LIB_EXPORT void ogre_skl_getAnimation2(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_skl_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_skl_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c) { Ogre::Skeleton * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Skeleton")); Ogre::String name_cpp = Ogre::String((const char*) name_c); bool result_cpp; result_cpp = (thisclass_cpp->hasAnimation(name_cpp)); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -246,7 +246,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_skl_setBlendMode(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_skl_optimiseAllAnimations(struct hg3dclass_struct * thisclass_c, int preservingIdentityNodeTracks_c) +extern "C" Ogre_LIB_EXPORT void ogre_skl_optimiseAllAnimations(struct hg3dclass_struct * thisclass_c, long preservingIdentityNodeTracks_c) { Ogre::Skeleton * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Skeleton")); bool preservingIdentityNodeTracks_cpp = (bool)preservingIdentityNodeTracks_c; @@ -270,20 +270,20 @@ extern "C" Ogre_LIB_EXPORT void ogre_skl_removeAllLinkedSkeletonAnimationSources }; // Have manual bones been modified since the skeleton was last updated? -extern "C" Ogre_LIB_EXPORT void ogre_skl_getManualBonesDirty(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_skl_getManualBonesDirty(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Skeleton * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Skeleton")); bool result_cpp; result_cpp = (thisclass_cpp->getManualBonesDirty()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // Are there any manually controlled bones? -extern "C" Ogre_LIB_EXPORT void ogre_skl_hasManualBones(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_skl_hasManualBones(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Skeleton * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Skeleton")); bool result_cpp; result_cpp = (thisclass_cpp->hasManualBones()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassTextureManager.cpp b/Bindings/Ogre/cBuild/ClassTextureManager.cpp index 4719223..1e425e9 100644 --- a/Bindings/Ogre/cBuild/ClassTextureManager.cpp +++ b/Bindings/Ogre/cBuild/ClassTextureManager.cpp @@ -49,7 +49,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_txmgr_destruct(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_txmgr_setDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, int num_c) +extern "C" Ogre_LIB_EXPORT void ogre_txmgr_setDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, long num_c) { Ogre::TextureManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::TextureManager")); size_t num_cpp = (size_t)num_c; @@ -57,12 +57,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_txmgr_setDefaultNumMipmaps(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_txmgr_getDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_txmgr_getDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::TextureManager * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::TextureManager")); size_t result_cpp; result_cpp = (thisclass_cpp->getDefaultNumMipmaps()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassTimeIndex.cpp b/Bindings/Ogre/cBuild/ClassTimeIndex.cpp index 4dce7d7..ad0b81b 100644 --- a/Bindings/Ogre/cBuild/ClassTimeIndex.cpp +++ b/Bindings/Ogre/cBuild/ClassTimeIndex.cpp @@ -52,12 +52,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_tnx_construct(float timePos_c, struct hg3dc }; // -extern "C" Ogre_LIB_EXPORT void ogre_tnx_hasKeyIndex(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_tnx_hasKeyIndex(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::TimeIndex * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::TimeIndex")); bool result_cpp; result_cpp = (thisclass_cpp->hasKeyIndex()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -70,11 +70,11 @@ extern "C" Ogre_LIB_EXPORT void ogre_tnx_getTimePos(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_tnx_getKeyIndex(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_tnx_getKeyIndex(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::TimeIndex * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::TimeIndex")); uint result_cpp; result_cpp = (thisclass_cpp->getKeyIndex()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; diff --git a/Bindings/Ogre/cBuild/ClassVertexAnimationTrack.cpp b/Bindings/Ogre/cBuild/ClassVertexAnimationTrack.cpp index c3c0a9c..167b30d 100644 --- a/Bindings/Ogre/cBuild/ClassVertexAnimationTrack.cpp +++ b/Bindings/Ogre/cBuild/ClassVertexAnimationTrack.cpp @@ -65,12 +65,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_vat_getAnimationType(struct hg3dclass_struc }; // -extern "C" Ogre_LIB_EXPORT void ogre_vat_getVertexAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vat_getVertexAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::VertexAnimationTrack * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::VertexAnimationTrack")); bool result_cpp; result_cpp = (thisclass_cpp->getVertexAnimationIncludesNormals()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -101,12 +101,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_vat_getTargetMode(struct hg3dclass_struct * }; // -extern "C" Ogre_LIB_EXPORT void ogre_vat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::VertexAnimationTrack * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::VertexAnimationTrack")); bool result_cpp; result_cpp = (thisclass_cpp->hasNonZeroKeyFrames()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // diff --git a/Bindings/Ogre/cBuild/ClassViewport.cpp b/Bindings/Ogre/cBuild/ClassViewport.cpp index 7cf46f5..140b99e 100644 --- a/Bindings/Ogre/cBuild/ClassViewport.cpp +++ b/Bindings/Ogre/cBuild/ClassViewport.cpp @@ -45,7 +45,7 @@ using Ogre::uint; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_construct(struct hg3dclass_struct * camera_c, struct hg3dclass_struct * target_c, float left_c, float top_c, float width_c, float height_c, int ZOrder_c, struct hg3dclass_struct * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_construct(struct hg3dclass_struct * camera_c, struct hg3dclass_struct * target_c, float left_c, float top_c, float width_c, float height_c, long ZOrder_c, struct hg3dclass_struct * result_c) { Ogre::Camera * camera_cpp = static_cast (getHG3DClassPtr(*camera_c, "Ogre::Camera")); Ogre::RenderTarget * target_cpp = static_cast (getHG3DClassPtr(*target_c, "Ogre::RenderTarget")); @@ -75,7 +75,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_update(struct hg3dclass_struct * thisc }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_clear(struct hg3dclass_struct * thisclass_c, unsigned int buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_clear(struct hg3dclass_struct * thisclass_c, unsigned long buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); unsigned int buffers_cpp = (unsigned int)buffers_c; @@ -114,12 +114,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_setCamera(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getZOrder(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getZOrder(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); int result_cpp; result_cpp = (thisclass_cpp->getZOrder()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -159,39 +159,39 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_getHeight(struct hg3dclass_struct * th }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualLeft(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualLeft(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); int result_cpp; result_cpp = (thisclass_cpp->getActualLeft()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualTop(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualTop(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); int result_cpp; result_cpp = (thisclass_cpp->getActualTop()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualWidth(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualWidth(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); int result_cpp; result_cpp = (thisclass_cpp->getActualWidth()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualHeight(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualHeight(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); int result_cpp; result_cpp = (thisclass_cpp->getActualHeight()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -206,7 +206,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_setDimensions(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_setOrientationMode(struct hg3dclass_struct * thisclass_c, enum EnumOrientationMode orientationMode_c, int setDefault_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_setOrientationMode(struct hg3dclass_struct * thisclass_c, enum EnumOrientationMode orientationMode_c, long setDefault_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); enum Ogre::OrientationMode orientationMode_cpp = (enum Ogre::OrientationMode)orientationMode_c; @@ -258,7 +258,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_getDepthClear(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_setClearEveryFrame(struct hg3dclass_struct * thisclass_c, int clear_c, unsigned int buffers_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_setClearEveryFrame(struct hg3dclass_struct * thisclass_c, long clear_c, unsigned long buffers_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool clear_cpp = (bool)clear_c; @@ -267,25 +267,25 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_setClearEveryFrame(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getClearEveryFrame(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getClearEveryFrame(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool result_cpp; result_cpp = (thisclass_cpp->getClearEveryFrame()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getClearBuffers(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getClearBuffers(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); unsigned int result_cpp; result_cpp = (thisclass_cpp->getClearBuffers()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, int autoupdate_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, long autoupdate_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool autoupdate_cpp = (bool)autoupdate_c; @@ -293,12 +293,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_setAutoUpdated(struct hg3dclass_struct }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool result_cpp; result_cpp = (thisclass_cpp->isAutoUpdated()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // @@ -323,7 +323,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_getMaterialScheme(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualDimensions(struct hg3dclass_struct * thisclass_c, int * left_c, int * top_c, int * width_c, int * height_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualDimensions(struct hg3dclass_struct * thisclass_c, long * left_c, long * top_c, long * width_c, long * height_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); int left_cpp; @@ -331,14 +331,14 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_getActualDimensions(struct hg3dclass_s int width_cpp; int height_cpp; (thisclass_cpp->getActualDimensions(left_cpp, top_cpp, width_cpp, height_cpp)); - *left_c = (int)left_cpp; - *top_c = (int)top_cpp; - *width_c = (int)width_cpp; - *height_c = (int)height_cpp; + *left_c = (long)left_cpp; + *top_c = (long)top_cpp; + *width_c = (long)width_cpp; + *height_c = (long)height_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_setOverlaysEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_setOverlaysEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool enabled_cpp = (bool)enabled_c; @@ -346,16 +346,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_setOverlaysEnabled(struct hg3dclass_st }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getOverlaysEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getOverlaysEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool result_cpp; result_cpp = (thisclass_cpp->getOverlaysEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_setSkiesEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_setSkiesEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool enabled_cpp = (bool)enabled_c; @@ -363,16 +363,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_setSkiesEnabled(struct hg3dclass_struc }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getSkiesEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getSkiesEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool result_cpp; result_cpp = (thisclass_cpp->getSkiesEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_setShadowsEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_setShadowsEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool enabled_cpp = (bool)enabled_c; @@ -380,16 +380,16 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_setShadowsEnabled(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getShadowsEnabled(struct hg3dclass_struct * thisclass_c, int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getShadowsEnabled(struct hg3dclass_struct * thisclass_c, long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); bool result_cpp; result_cpp = (thisclass_cpp->getShadowsEnabled()); - *result_c = (int)result_cpp; + *result_c = (long)result_cpp; }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int mask_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long mask_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); uint32 mask_cpp = (uint32)mask_c; @@ -397,12 +397,12 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_setVisibilityMask(struct hg3dclass_str }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); uint result_cpp; result_cpp = (thisclass_cpp->getVisibilityMask()); - *result_c = (unsigned int)result_cpp; + *result_c = (unsigned long)result_cpp; }; // @@ -427,7 +427,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_getRenderQueueInvocationSequenceName(s }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_pointOrientedToScreen(struct hg3dclass_struct * thisclass_c, struct vector2_struct * v_c, int orientationMode_c, struct vector2_struct * outv_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_pointOrientedToScreen(struct hg3dclass_struct * thisclass_c, struct vector2_struct * v_c, long orientationMode_c, struct vector2_struct * outv_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); Vector2 v_cpp = *((Vector2*) v_c); @@ -438,7 +438,7 @@ extern "C" Ogre_LIB_EXPORT void ogre_vprt_pointOrientedToScreen(struct hg3dclass }; // -extern "C" Ogre_LIB_EXPORT void ogre_vprt_pointOrientedToScreen2(struct hg3dclass_struct * thisclass_c, float orientedX_c, float orientedY_c, int orientationMode_c, float * screenX_c, float * screenY_c) +extern "C" Ogre_LIB_EXPORT void ogre_vprt_pointOrientedToScreen2(struct hg3dclass_struct * thisclass_c, float orientedX_c, float orientedY_c, long orientationMode_c, float * screenX_c, float * screenY_c) { Ogre::Viewport * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "Ogre::Viewport")); Real orientedX_cpp = (Real)orientedX_c; diff --git a/Bindings/Ogre/cBuild/HG3DUtilities.cpp b/Bindings/Ogre/cBuild/HG3DUtilities.cpp index 4d64aa4..03cde5f 100644 --- a/Bindings/Ogre/cBuild/HG3DUtilities.cpp +++ b/Bindings/Ogre/cBuild/HG3DUtilities.cpp @@ -25,9 +25,9 @@ limitations under the License. static int quitReceived = 0; -unsigned int HG3DUtilities::getWindowHandle(Ogre::RenderWindow *window) +unsigned long HG3DUtilities::getWindowHandle(Ogre::RenderWindow *window) { - unsigned int handle; + unsigned long handle; window->getCustomAttribute("WINDOW", &handle); return handle; diff --git a/Bindings/Ogre/cBuild/SConstruct b/Bindings/Ogre/cBuild/SConstruct index 3d95edb..0b18a24 100644 --- a/Bindings/Ogre/cBuild/SConstruct +++ b/Bindings/Ogre/cBuild/SConstruct @@ -14,7 +14,7 @@ # -# scons file to build HGamer3DOgre library, version 0.3.2 +# scons file to build HGamer3DOgre library, version 0.4.0 # set environment @@ -31,7 +31,7 @@ libpath = home + "/.HGamer3D/lib" if env["PLATFORM"] == "win32": # on windows, create new environment, which finds MS C-Compiler env = Environment(TARGET_ARCH="x86", MSVC_VERSION="10.0") - env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DOgre032_EXPORTS /EHsc /MD"}) + env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DOgre040_EXPORTS /EHsc /MD"}) # set other compile parameters ############################## @@ -40,15 +40,15 @@ if env["PLATFORM"] == "win32": env.Append(CPPPATH=["include","../Deps/include","../Deps/include/OgreMain","../Deps/include/boost","../Deps/include/BuildConfig"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib","../Deps/include/boost/lib"]) - env.SharedLibrary("hg3dogre032", ["ClassException.cpp","ClassHG3DUtilities.cpp","ClassViewport.cpp","ClassLightFactory.cpp","ClassBillboard.cpp","ClassTextureManager.cpp","ClassTimeIndex.cpp","ClassAnimationTrack.cpp","ClassRenderTexture.cpp","ClassAnimationStateSet.cpp","ClassNodeAnimationTrack.cpp","ClassLog.cpp","ClassSkeletonManager.cpp","ClassManualObject.cpp","ClassSceneManager.cpp","ClassManualObjectFactory.cpp","ClassSceneManagerFactory.cpp","ClassNumericAnimationTrack.cpp","ClassBillboardChainFactory.cpp","ClassArchiveManager.cpp","ClassResourceManager.cpp","ClassSceneNode.cpp","ClassMeshManager.cpp","ClassMesh.cpp","ClassRenderTarget.cpp","ClassMaterialManager.cpp","ClassEntityFactory.cpp","ClassBone.cpp","ClassRenderWindow.cpp","ClassBillboardSetFactory.cpp","ClassRenderSystem.cpp","ClassBillboardChain.cpp","ClassMultiRenderTarget.cpp","ClassManualObjectSection.cpp","ClassNode.cpp","ClassAnimationState.cpp","ClassCamera.cpp","ClassAnimation.cpp","ClassLogManager.cpp","ClassSkeleton.cpp","ClassControllerManager.cpp","ClassMovableObjectFactory.cpp","ClassRenderable.cpp","ClassResourceGroupManager.cpp","ClassBillboardSet.cpp","ClassMovableObject.cpp","ClassRoot.cpp","ClassArchive.cpp","ClassPtr.cpp","ClassResource.cpp","ClassWindowEventUtilities.cpp","ClassVertexAnimationTrack.cpp","ClassConfigFile.cpp","ClassEntity.cpp","ClassFrustum.cpp","ClassMaterial.cpp","ClassLight.cpp","HG3DUtilities.cpp"], LIBS = ["OgreMain","libboost_thread-vc100-mt-1_49"]) + env.SharedLibrary("hg3dogre040", ["ClassViewport.cpp","ClassRenderWindow.cpp","ClassManualObjectFactory.cpp","ClassRoot.cpp","ClassBillboardChainFactory.cpp","ClassArchiveManager.cpp","ClassRenderSystem.cpp","ClassMaterial.cpp","ClassBillboardSet.cpp","ClassManualObjectSection.cpp","ClassVertexAnimationTrack.cpp","ClassBillboardSetFactory.cpp","ClassNodeAnimationTrack.cpp","ClassRenderTarget.cpp","ClassResource.cpp","ClassSceneNode.cpp","ClassCamera.cpp","ClassNode.cpp","ClassResourceGroupManager.cpp","ClassSkeleton.cpp","ClassMovableObjectFactory.cpp","ClassAnimationStateSet.cpp","ClassAnimation.cpp","ClassConfigFile.cpp","ClassAnimationState.cpp","ClassSceneManager.cpp","ClassRenderable.cpp","ClassTextureManager.cpp","ClassManualObject.cpp","ClassRenderTexture.cpp","ClassEntity.cpp","ClassMeshManager.cpp","ClassBillboard.cpp","ClassHG3DUtilities.cpp","HG3DUtilities.cpp","ClassLog.cpp","ClassException.cpp","ClassLight.cpp","ClassMovableObject.cpp","ClassResourceManager.cpp","ClassMultiRenderTarget.cpp","ClassPtr.cpp","ClassLightFactory.cpp","ClassWindowEventUtilities.cpp","ClassEntityFactory.cpp","ClassAnimationTrack.cpp","ClassLogManager.cpp","ClassBillboardChain.cpp","ClassNumericAnimationTrack.cpp","ClassMaterialManager.cpp","ClassControllerManager.cpp","ClassTimeIndex.cpp","ClassFrustum.cpp","ClassBone.cpp","ClassArchive.cpp","ClassSkeletonManager.cpp","ClassMesh.cpp","ClassSceneManagerFactory.cpp"], LIBS = ["OgreMain","libboost_thread-vc100-mt-1_49"]) env.Alias('install', libpath) - env.Install(libpath, "hg3dogre032.dll") + env.Install(libpath, "hg3dogre040.dll") else: env.Append(CPPPATH=["include","../Deps/include","../Deps/include/OgreMain","../Deps/include/boost","../Deps/include/BuildConfig"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib","../Deps/include/boost/lib"]) - env.SharedLibrary("hg3dogre032", ["ClassException.cpp","ClassHG3DUtilities.cpp","ClassViewport.cpp","ClassLightFactory.cpp","ClassBillboard.cpp","ClassTextureManager.cpp","ClassTimeIndex.cpp","ClassAnimationTrack.cpp","ClassRenderTexture.cpp","ClassAnimationStateSet.cpp","ClassNodeAnimationTrack.cpp","ClassLog.cpp","ClassSkeletonManager.cpp","ClassManualObject.cpp","ClassSceneManager.cpp","ClassManualObjectFactory.cpp","ClassSceneManagerFactory.cpp","ClassNumericAnimationTrack.cpp","ClassBillboardChainFactory.cpp","ClassArchiveManager.cpp","ClassResourceManager.cpp","ClassSceneNode.cpp","ClassMeshManager.cpp","ClassMesh.cpp","ClassRenderTarget.cpp","ClassMaterialManager.cpp","ClassEntityFactory.cpp","ClassBone.cpp","ClassRenderWindow.cpp","ClassBillboardSetFactory.cpp","ClassRenderSystem.cpp","ClassBillboardChain.cpp","ClassMultiRenderTarget.cpp","ClassManualObjectSection.cpp","ClassNode.cpp","ClassAnimationState.cpp","ClassCamera.cpp","ClassAnimation.cpp","ClassLogManager.cpp","ClassSkeleton.cpp","ClassControllerManager.cpp","ClassMovableObjectFactory.cpp","ClassRenderable.cpp","ClassResourceGroupManager.cpp","ClassBillboardSet.cpp","ClassMovableObject.cpp","ClassRoot.cpp","ClassArchive.cpp","ClassPtr.cpp","ClassResource.cpp","ClassWindowEventUtilities.cpp","ClassVertexAnimationTrack.cpp","ClassConfigFile.cpp","ClassEntity.cpp","ClassFrustum.cpp","ClassMaterial.cpp","ClassLight.cpp","HG3DUtilities.cpp"], LIBS = ["OgreMain","OgrePaging","OgreProperty","OgreRTShaderSystem","OgreTerrain"]) + env.SharedLibrary("hg3dogre040", ["ClassViewport.cpp","ClassRenderWindow.cpp","ClassManualObjectFactory.cpp","ClassRoot.cpp","ClassBillboardChainFactory.cpp","ClassArchiveManager.cpp","ClassRenderSystem.cpp","ClassMaterial.cpp","ClassBillboardSet.cpp","ClassManualObjectSection.cpp","ClassVertexAnimationTrack.cpp","ClassBillboardSetFactory.cpp","ClassNodeAnimationTrack.cpp","ClassRenderTarget.cpp","ClassResource.cpp","ClassSceneNode.cpp","ClassCamera.cpp","ClassNode.cpp","ClassResourceGroupManager.cpp","ClassSkeleton.cpp","ClassMovableObjectFactory.cpp","ClassAnimationStateSet.cpp","ClassAnimation.cpp","ClassConfigFile.cpp","ClassAnimationState.cpp","ClassSceneManager.cpp","ClassRenderable.cpp","ClassTextureManager.cpp","ClassManualObject.cpp","ClassRenderTexture.cpp","ClassEntity.cpp","ClassMeshManager.cpp","ClassBillboard.cpp","ClassHG3DUtilities.cpp","HG3DUtilities.cpp","ClassLog.cpp","ClassException.cpp","ClassLight.cpp","ClassMovableObject.cpp","ClassResourceManager.cpp","ClassMultiRenderTarget.cpp","ClassPtr.cpp","ClassLightFactory.cpp","ClassWindowEventUtilities.cpp","ClassEntityFactory.cpp","ClassAnimationTrack.cpp","ClassLogManager.cpp","ClassBillboardChain.cpp","ClassNumericAnimationTrack.cpp","ClassMaterialManager.cpp","ClassControllerManager.cpp","ClassTimeIndex.cpp","ClassFrustum.cpp","ClassBone.cpp","ClassArchive.cpp","ClassSkeletonManager.cpp","ClassMesh.cpp","ClassSceneManagerFactory.cpp"], LIBS = ["OgreMain","OgrePaging","OgreProperty","OgreRTShaderSystem","OgreTerrain"]) env.Alias('install', libpath) - env.Install(libpath, "libhg3dogre032.so") + env.Install(libpath, "libhg3dogre040.so") diff --git a/Bindings/Ogre/cBuild/include/ClassAnimation.h b/Bindings/Ogre/cBuild/include/ClassAnimation.h index 200361c..37b1e87 100644 --- a/Bindings/Ogre/cBuild/include/ClassAnimation.h +++ b/Bindings/Ogre/cBuild/include/ClassAnimation.h @@ -67,7 +67,7 @@ void ogre_anm_getNumNodeTracks(struct hg3dclass_struct * thisclass_c, unsigned s void ogre_anm_getNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, struct hg3dclass_struct * result_c); // -void ogre_anm_hasNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c); +void ogre_anm_hasNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c); // void ogre_anm_getNumNumericTracks(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); @@ -76,7 +76,7 @@ void ogre_anm_getNumNumericTracks(struct hg3dclass_struct * thisclass_c, unsigne void ogre_anm_getNumericTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, struct hg3dclass_struct * result_c); // -void ogre_anm_hasNumericTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c); +void ogre_anm_hasNumericTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c); // void ogre_anm_getNumVertexTracks(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); @@ -85,7 +85,7 @@ void ogre_anm_getNumVertexTracks(struct hg3dclass_struct * thisclass_c, unsigned void ogre_anm_getVertexTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, struct hg3dclass_struct * result_c); // -void ogre_anm_hasVertexTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c); +void ogre_anm_hasVertexTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c); // void ogre_anm_destroyNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c); @@ -118,7 +118,7 @@ void ogre_anm_applyToNode(struct hg3dclass_struct * thisclass_c, struct hg3dclas void ogre_anm_apply2(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * skeleton_c, float timePos_c, float weight_c, float scale_c); // -void ogre_anm_apply4(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * entity_c, float timePos_c, float weight_c, int software_c, int hardware_c); +void ogre_anm_apply4(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * entity_c, float timePos_c, float weight_c, long software_c, long hardware_c); // void ogre_anm_setInterpolationMode(struct hg3dclass_struct * thisclass_c, enum EnumAnimationInterpolationMode im_c); @@ -133,16 +133,16 @@ void ogre_anm_setRotationInterpolationMode(struct hg3dclass_struct * thisclass_c void ogre_anm_getRotationInterpolationMode(struct hg3dclass_struct * thisclass_c, enum EnumAnimationRotationInterpolationMode * result_c); // -void ogre_anm_optimise(struct hg3dclass_struct * thisclass_c, int discardIdentityNodeTracks_c); +void ogre_anm_optimise(struct hg3dclass_struct * thisclass_c, long discardIdentityNodeTracks_c); // void ogre_anm_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, struct hg3dclass_struct * result_c); // -void ogre_anm_setUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, int useBaseKeyFrame_c, float keyframeTime_c, char * baseAnimName_c); +void ogre_anm_setUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, long useBaseKeyFrame_c, float keyframeTime_c, char * baseAnimName_c); // -void ogre_anm_getUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anm_getUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_anm_getBaseKeyFrameTime(struct hg3dclass_struct * thisclass_c, float * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassAnimationState.h b/Bindings/Ogre/cBuild/include/ClassAnimationState.h index a757f6f..d461037 100644 --- a/Bindings/Ogre/cBuild/include/ClassAnimationState.h +++ b/Bindings/Ogre/cBuild/include/ClassAnimationState.h @@ -29,7 +29,7 @@ // -void ogre_anms_construct(char * animName_c, struct hg3dclass_struct * parent_c, float timePos_c, float length_c, float weight_c, int enabled_c, struct hg3dclass_struct * result_c); +void ogre_anms_construct(char * animName_c, struct hg3dclass_struct * parent_c, float timePos_c, float length_c, float weight_c, long enabled_c, struct hg3dclass_struct * result_c); // void ogre_anms_destruct(struct hg3dclass_struct * thisclass_c); @@ -59,19 +59,19 @@ void ogre_anms_setWeight(struct hg3dclass_struct * thisclass_c, float weight_c); void ogre_anms_addTime(struct hg3dclass_struct * thisclass_c, float offset_c); // Returns true if the animation has reached the end and is not looping. -void ogre_anms_hasEnded(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anms_hasEnded(struct hg3dclass_struct * thisclass_c, long * result_c); // Returns true if this animation is currently enabled. -void ogre_anms_getEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anms_getEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // Sets whether this animation is enabled. -void ogre_anms_setEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_anms_setEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_anms_setLoop(struct hg3dclass_struct * thisclass_c, int loop_c); +void ogre_anms_setLoop(struct hg3dclass_struct * thisclass_c, long loop_c); // Gets whether or not this animation loops. -void ogre_anms_getLoop(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anms_getLoop(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_anms_copyStateFrom(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * animState_c); @@ -80,18 +80,18 @@ void ogre_anms_copyStateFrom(struct hg3dclass_struct * thisclass_c, struct hg3dc void ogre_anms_getParent(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // Create a new blend mask with the given number of entries. -void ogre_anms_createBlendMask(struct hg3dclass_struct * thisclass_c, int blendMaskSizeHint_c, float initialWeight_c); +void ogre_anms_createBlendMask(struct hg3dclass_struct * thisclass_c, long blendMaskSizeHint_c, float initialWeight_c); // Destroy the currently set blend mask. void ogre_anms_destroyBlendMask(struct hg3dclass_struct * thisclass_c); // Return whether there is currently a valid blend mask set. -void ogre_anms_hasBlendMask(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anms_hasBlendMask(struct hg3dclass_struct * thisclass_c, long * result_c); // Set the weight for the bone identified by the given handle. -void ogre_anms_setBlendMaskEntry(struct hg3dclass_struct * thisclass_c, int boneHandle_c, float weight_c); +void ogre_anms_setBlendMaskEntry(struct hg3dclass_struct * thisclass_c, long boneHandle_c, float weight_c); // Get the weight for the bone identified by the given handle. -void ogre_anms_getBlendMaskEntry(struct hg3dclass_struct * thisclass_c, int boneHandle_c, float * result_c); +void ogre_anms_getBlendMaskEntry(struct hg3dclass_struct * thisclass_c, long boneHandle_c, float * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassAnimationStateSet.h b/Bindings/Ogre/cBuild/include/ClassAnimationStateSet.h index dd0e8cd..1e1762c 100644 --- a/Bindings/Ogre/cBuild/include/ClassAnimationStateSet.h +++ b/Bindings/Ogre/cBuild/include/ClassAnimationStateSet.h @@ -32,13 +32,13 @@ void ogre_ass_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_ass_createAnimationState(struct hg3dclass_struct * thisclass_c, char * animName_c, float timePos_c, float length_c, float weight_c, int enabled_c, struct hg3dclass_struct * result_c); +void ogre_ass_createAnimationState(struct hg3dclass_struct * thisclass_c, char * animName_c, float timePos_c, float length_c, float weight_c, long enabled_c, struct hg3dclass_struct * result_c); // Get an animation state by the name of the animation. void ogre_ass_getAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // Tests if state for the named animation is present. -void ogre_ass_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_ass_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // Remove animation state with the given name. void ogre_ass_removeAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -49,7 +49,10 @@ void ogre_ass_removeAllAnimationStates(struct hg3dclass_struct * thisclass_c); // Copy the state of any matching animation states from this to another. void ogre_ass_copyMatchingState(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * target_c); +// Get the latest animation state been altered frame number. +void ogre_ass_getDirtyFrameNumber(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); + // Tests if exists enabled animation state in this set. -void ogre_ass_hasEnabledAnimationState(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ass_hasEnabledAnimationState(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassAnimationTrack.h b/Bindings/Ogre/cBuild/include/ClassAnimationTrack.h index b42777f..3315937 100644 --- a/Bindings/Ogre/cBuild/include/ClassAnimationTrack.h +++ b/Bindings/Ogre/cBuild/include/ClassAnimationTrack.h @@ -48,7 +48,7 @@ void ogre_at_removeAllKeyFrames(struct hg3dclass_struct * thisclass_c); void ogre_at_apply(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * timeIndex_c, float weight_c, float scale_c); // -void ogre_at_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_at_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_at_optimise(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/cBuild/include/ClassArchive.h b/Bindings/Ogre/cBuild/include/ClassArchive.h index fd746d9..ce0e6b8 100644 --- a/Bindings/Ogre/cBuild/include/ClassArchive.h +++ b/Bindings/Ogre/cBuild/include/ClassArchive.h @@ -34,7 +34,7 @@ void ogre_arch_destruct(struct hg3dclass_struct * thisclass_c); void ogre_arch_getName(struct hg3dclass_struct * thisclass_c, char * result_c); // Returns whether this archive is case sensitive in the way it matches files. -void ogre_arch_isCaseSensitive(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_arch_isCaseSensitive(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_arch_load(struct hg3dclass_struct * thisclass_c); @@ -43,13 +43,13 @@ void ogre_arch_load(struct hg3dclass_struct * thisclass_c); void ogre_arch_unload(struct hg3dclass_struct * thisclass_c); // -void ogre_arch_isReadOnly(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_arch_isReadOnly(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_arch_remove(struct hg3dclass_struct * thisclass_c, char * filename_c); // -void ogre_arch_exists(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c); +void ogre_arch_exists(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c); // Return the type code of this Archive void ogre_arch_getType(struct hg3dclass_struct * thisclass_c, char * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassBillboard.h b/Bindings/Ogre/cBuild/include/ClassBillboard.h index f99d5bd..f1dd044 100644 --- a/Bindings/Ogre/cBuild/include/ClassBillboard.h +++ b/Bindings/Ogre/cBuild/include/ClassBillboard.h @@ -64,7 +64,7 @@ void ogre_bbd_setColour(struct hg3dclass_struct * thisclass_c, struct colourvalu void ogre_bbd_getColour(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * result_c); // -void ogre_bbd_hasOwnDimensions(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbd_hasOwnDimensions(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbd_getOwnWidth(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -73,7 +73,7 @@ void ogre_bbd_getOwnWidth(struct hg3dclass_struct * thisclass_c, float * result_ void ogre_bbd_getOwnHeight(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_bbd_isUseTexcoordRect(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbd_isUseTexcoordRect(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbd_setTexcoordIndex(struct hg3dclass_struct * thisclass_c, unsigned short texcoordIndex_c); diff --git a/Bindings/Ogre/cBuild/include/ClassBillboardChain.h b/Bindings/Ogre/cBuild/include/ClassBillboardChain.h index ed2d720..fa771a2 100644 --- a/Bindings/Ogre/cBuild/include/ClassBillboardChain.h +++ b/Bindings/Ogre/cBuild/include/ClassBillboardChain.h @@ -37,22 +37,22 @@ void ogre_bbdc_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_bbdc_setMaxChainElements(struct hg3dclass_struct * thisclass_c, int maxElements_c); +void ogre_bbdc_setMaxChainElements(struct hg3dclass_struct * thisclass_c, long maxElements_c); // -void ogre_bbdc_getMaxChainElements(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getMaxChainElements(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbdc_setNumberOfChains(struct hg3dclass_struct * thisclass_c, int numChains_c); +void ogre_bbdc_setNumberOfChains(struct hg3dclass_struct * thisclass_c, long numChains_c); // -void ogre_bbdc_getNumberOfChains(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getNumberOfChains(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbdc_setUseTextureCoords(struct hg3dclass_struct * thisclass_c, int use_c); +void ogre_bbdc_setUseTextureCoords(struct hg3dclass_struct * thisclass_c, long use_c); // -void ogre_bbdc_getUseTextureCoords(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getUseTextureCoords(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbdc_setTextureCoordDirection(struct hg3dclass_struct * thisclass_c, enum EnumBillboardChainTexCoordDirection dir_c); @@ -64,31 +64,31 @@ void ogre_bbdc_getTextureCoordDirection(struct hg3dclass_struct * thisclass_c, e void ogre_bbdc_setOtherTextureCoordRange(struct hg3dclass_struct * thisclass_c, float start_c, float end_c); // -void ogre_bbdc_setUseVertexColours(struct hg3dclass_struct * thisclass_c, int use_c); +void ogre_bbdc_setUseVertexColours(struct hg3dclass_struct * thisclass_c, long use_c); // -void ogre_bbdc_getUseVertexColours(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getUseVertexColours(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbdc_setDynamic(struct hg3dclass_struct * thisclass_c, int dyn_c); +void ogre_bbdc_setDynamic(struct hg3dclass_struct * thisclass_c, long dyn_c); // -void ogre_bbdc_getDynamic(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getDynamic(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbdc_removeChainElement(struct hg3dclass_struct * thisclass_c, int chainIndex_c); +void ogre_bbdc_removeChainElement(struct hg3dclass_struct * thisclass_c, long chainIndex_c); // -void ogre_bbdc_getNumChainElements(struct hg3dclass_struct * thisclass_c, int chainIndex_c, int * result_c); +void ogre_bbdc_getNumChainElements(struct hg3dclass_struct * thisclass_c, long chainIndex_c, long * result_c); // -void ogre_bbdc_clearChain(struct hg3dclass_struct * thisclass_c, int chainIndex_c); +void ogre_bbdc_clearChain(struct hg3dclass_struct * thisclass_c, long chainIndex_c); // void ogre_bbdc_clearAllChains(struct hg3dclass_struct * thisclass_c); // -void ogre_bbdc_setFaceCamera(struct hg3dclass_struct * thisclass_c, int faceCamera_c, struct vector3_struct * normalVector_c); +void ogre_bbdc_setFaceCamera(struct hg3dclass_struct * thisclass_c, long faceCamera_c, struct vector3_struct * normalVector_c); // Get the material name in use. void ogre_bbdc_getMaterialName(struct hg3dclass_struct * thisclass_c, char * result_c); @@ -109,6 +109,6 @@ void ogre_bbdc_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedp void ogre_bbdc_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_bbdc_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, int * result_c); +void ogre_bbdc_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassBillboardSet.h b/Bindings/Ogre/cBuild/include/ClassBillboardSet.h index 39ddebb..38c2b9c 100644 --- a/Bindings/Ogre/cBuild/include/ClassBillboardSet.h +++ b/Bindings/Ogre/cBuild/include/ClassBillboardSet.h @@ -36,7 +36,7 @@ // -void ogre_bbs_construct(char * name_c, unsigned int poolSize_c, int externalDataSource_c, struct hg3dclass_struct * result_c); +void ogre_bbs_construct(char * name_c, unsigned long poolSize_c, long externalDataSource_c, struct hg3dclass_struct * result_c); // void ogre_bbs_destruct(struct hg3dclass_struct * thisclass_c); @@ -48,34 +48,34 @@ void ogre_bbs_createBillboard(struct hg3dclass_struct * thisclass_c, struct vect void ogre_bbs_createBillboard2(struct hg3dclass_struct * thisclass_c, float x_c, float y_c, float z_c, struct colourvalue_struct * colour_c, struct hg3dclass_struct * result_c); // -void ogre_bbs_getNumBillboards(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getNumBillboards(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbs_setAutoextend(struct hg3dclass_struct * thisclass_c, int autoextend_c); +void ogre_bbs_setAutoextend(struct hg3dclass_struct * thisclass_c, long autoextend_c); // -void ogre_bbs_getAutoextend(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getAutoextend(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbs_setSortingEnabled(struct hg3dclass_struct * thisclass_c, int sortenable_c); +void ogre_bbs_setSortingEnabled(struct hg3dclass_struct * thisclass_c, long sortenable_c); // -void ogre_bbs_getSortingEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getSortingEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbs_setPoolSize(struct hg3dclass_struct * thisclass_c, int size_c); +void ogre_bbs_setPoolSize(struct hg3dclass_struct * thisclass_c, long size_c); // -void ogre_bbs_getPoolSize(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_bbs_getPoolSize(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_bbs_clear(struct hg3dclass_struct * thisclass_c); // -void ogre_bbs_getBillboard(struct hg3dclass_struct * thisclass_c, unsigned int index_c, struct hg3dclass_struct * result_c); +void ogre_bbs_getBillboard(struct hg3dclass_struct * thisclass_c, unsigned long index_c, struct hg3dclass_struct * result_c); // -void ogre_bbs_removeBillboard(struct hg3dclass_struct * thisclass_c, unsigned int index_c); +void ogre_bbs_removeBillboard(struct hg3dclass_struct * thisclass_c, unsigned long index_c); // void ogre_bbs_removeBillboard2(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * pBill_c); @@ -114,7 +114,7 @@ void ogre_bbs_setMaterialName(struct hg3dclass_struct * thisclass_c, char * name void ogre_bbs_getMaterialName(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_bbs_beginBillboards(struct hg3dclass_struct * thisclass_c, int numBillboards_c); +void ogre_bbs_beginBillboards(struct hg3dclass_struct * thisclass_c, long numBillboards_c); // void ogre_bbs_injectBillboard(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * bb_c); @@ -132,10 +132,10 @@ void ogre_bbs_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedpt void ogre_bbs_setMaterial(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * material_c); // -void ogre_bbs_getCullIndividually(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getCullIndividually(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbs_setCullIndividually(struct hg3dclass_struct * thisclass_c, int cullIndividual_c); +void ogre_bbs_setCullIndividually(struct hg3dclass_struct * thisclass_c, long cullIndividual_c); // void ogre_bbs_setBillboardType(struct hg3dclass_struct * thisclass_c, enum EnumBillboardType bbt_c); @@ -156,10 +156,10 @@ void ogre_bbs_setCommonUpVector(struct hg3dclass_struct * thisclass_c, struct ve void ogre_bbs_getCommonUpVector(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); // -void ogre_bbs_setUseAccurateFacing(struct hg3dclass_struct * thisclass_c, int acc_c); +void ogre_bbs_setUseAccurateFacing(struct hg3dclass_struct * thisclass_c, long acc_c); // -void ogre_bbs_getUseAccurateFacing(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getUseAccurateFacing(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbs_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c); @@ -168,22 +168,22 @@ void ogre_bbs_getMovableType(struct hg3dclass_struct * thisclass_c, char * resul void ogre_bbs_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, float * result_c); // -void ogre_bbs_setBillboardsInWorldSpace(struct hg3dclass_struct * thisclass_c, int ws_c); +void ogre_bbs_setBillboardsInWorldSpace(struct hg3dclass_struct * thisclass_c, long ws_c); // -void ogre_bbs_setPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_bbs_setPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_bbs_isPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_isPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // Override to return specific type flag. -void ogre_bbs_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_bbs_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_bbs_setAutoUpdate(struct hg3dclass_struct * thisclass_c, int autoUpdate_c); +void ogre_bbs_setAutoUpdate(struct hg3dclass_struct * thisclass_c, long autoUpdate_c); // -void ogre_bbs_getAutoUpdate(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getAutoUpdate(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbs_notifyBillboardDataChanged(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/cBuild/include/ClassBone.h b/Bindings/Ogre/cBuild/include/ClassBone.h index 6fb1b53..29d87e4 100644 --- a/Bindings/Ogre/cBuild/include/ClassBone.h +++ b/Bindings/Ogre/cBuild/include/ClassBone.h @@ -45,12 +45,12 @@ void ogre_bn_setBindingPose(struct hg3dclass_struct * thisclass_c); void ogre_bn_reset(struct hg3dclass_struct * thisclass_c); // -void ogre_bn_setManuallyControlled(struct hg3dclass_struct * thisclass_c, int manuallyControlled_c); +void ogre_bn_setManuallyControlled(struct hg3dclass_struct * thisclass_c, long manuallyControlled_c); // -void ogre_bn_isManuallyControlled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bn_isManuallyControlled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bn_needUpdate(struct hg3dclass_struct * thisclass_c, int forceParentUpdate_c); +void ogre_bn_needUpdate(struct hg3dclass_struct * thisclass_c, long forceParentUpdate_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassCamera.h b/Bindings/Ogre/cBuild/include/ClassCamera.h index a6dc4b7..2ed7de9 100644 --- a/Bindings/Ogre/cBuild/include/ClassCamera.h +++ b/Bindings/Ogre/cBuild/include/ClassCamera.h @@ -96,7 +96,7 @@ void ogre_cam_rotate(struct hg3dclass_struct * thisclass_c, struct vector3_struc void ogre_cam_rotate2(struct hg3dclass_struct * thisclass_c, struct quaternion_struct * q_c); // -void ogre_cam_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, int useFixed_c, struct vector3_struct * fixedAxis_c); +void ogre_cam_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, long useFixed_c, struct vector3_struct * fixedAxis_c); // void ogre_cam_getOrientation(struct hg3dclass_struct * thisclass_c, struct quaternion_struct * result_c); @@ -156,7 +156,7 @@ void ogre_cam_setWindow(struct hg3dclass_struct * thisclass_c, float Left_c, flo void ogre_cam_resetWindow(struct hg3dclass_struct * thisclass_c); // Returns if a viewport window is being used. -void ogre_cam_isWindowSet(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_cam_isWindowSet(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_cam_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -171,10 +171,10 @@ void ogre_cam_getAutoTrackOffset(struct hg3dclass_struct * thisclass_c, struct v void ogre_cam_getViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_cam_setAutoAspectRatio(struct hg3dclass_struct * thisclass_c, int autoratio_c); +void ogre_cam_setAutoAspectRatio(struct hg3dclass_struct * thisclass_c, long autoratio_c); // -void ogre_cam_getAutoAspectRatio(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_cam_getAutoAspectRatio(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_cam_setCullingFrustum(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * frustum_c); @@ -183,7 +183,7 @@ void ogre_cam_setCullingFrustum(struct hg3dclass_struct * thisclass_c, struct hg void ogre_cam_getCullingFrustum(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_cam_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, int * result_c); +void ogre_cam_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, long * result_c); // void ogre_cam_getWorldSpaceCorners(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); @@ -195,10 +195,10 @@ void ogre_cam_getNearClipDistance(struct hg3dclass_struct * thisclass_c, float * void ogre_cam_getFarClipDistance(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_cam_setUseRenderingDistance(struct hg3dclass_struct * thisclass_c, int use_c); +void ogre_cam_setUseRenderingDistance(struct hg3dclass_struct * thisclass_c, long use_c); // -void ogre_cam_getUseRenderingDistance(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_cam_getUseRenderingDistance(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_cam_synchroniseBaseSettingsWith(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c); @@ -211,10 +211,10 @@ void ogre_cam_getOrientationForViewUpdate(struct hg3dclass_struct * thisclass_c, // Sets whether to use min display size calculations -void ogre_cam_setUseMinPixelSize(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_cam_setUseMinPixelSize(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_cam_getUseMinPixelSize(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_cam_getUseMinPixelSize(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_cam_getPixelDisplayRatio(struct hg3dclass_struct * thisclass_c, float * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassConfigFile.h b/Bindings/Ogre/cBuild/include/ClassConfigFile.h index e1cc466..113ae00 100644 --- a/Bindings/Ogre/cBuild/include/ClassConfigFile.h +++ b/Bindings/Ogre/cBuild/include/ClassConfigFile.h @@ -34,16 +34,16 @@ void ogre_cf_construct(struct hg3dclass_struct * result_c); void ogre_cf_destruct(struct hg3dclass_struct * thisclass_c); // load from a filename (not using resource group locations) -void ogre_cf_load(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, int trimWhitespace_c); +void ogre_cf_load(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, long trimWhitespace_c); // load from a filename (using resource group locations) -void ogre_cf_load2(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, int trimWhitespace_c); +void ogre_cf_load2(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, long trimWhitespace_c); // load from a filename (not using resource group locations) -void ogre_cf_loadDirect(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, int trimWhitespace_c); +void ogre_cf_loadDirect(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, long trimWhitespace_c); // load from a filename (using resource group locations) -void ogre_cf_loadFromResourceSystem(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, int trimWhitespace_c); +void ogre_cf_loadFromResourceSystem(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, long trimWhitespace_c); // void ogre_cf_getSetting(struct hg3dclass_struct * thisclass_c, char * key_c, char * section_c, char * defaultValue_c, char * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassEntity.h b/Bindings/Ogre/cBuild/include/ClassEntity.h index 57be3c3..23523f6 100644 --- a/Bindings/Ogre/cBuild/include/ClassEntity.h +++ b/Bindings/Ogre/cBuild/include/ClassEntity.h @@ -40,7 +40,7 @@ void ogre_ent_destruct(struct hg3dclass_struct * thisclass_c); void ogre_ent_getMesh(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); // -void ogre_ent_getNumSubEntities(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_ent_getNumSubEntities(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_ent_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, struct hg3dclass_struct * result_c); @@ -58,25 +58,25 @@ void ogre_ent_getMovableType(struct hg3dclass_struct * thisclass_c, char * resul void ogre_ent_getAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_ent_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_ent_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_ent_getAllAnimationStates(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_ent_setDisplaySkeleton(struct hg3dclass_struct * thisclass_c, int display_c); +void ogre_ent_setDisplaySkeleton(struct hg3dclass_struct * thisclass_c, long display_c); // -void ogre_ent_getDisplaySkeleton(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getDisplaySkeleton(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_getManualLodLevel(struct hg3dclass_struct * thisclass_c, int index_c, struct hg3dclass_struct * result_c); +void ogre_ent_getManualLodLevel(struct hg3dclass_struct * thisclass_c, long index_c, struct hg3dclass_struct * result_c); // -void ogre_ent_getNumManualLodLevels(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getNumManualLodLevels(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int PolygonModeOverrideable_c); +void ogre_ent_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long PolygonModeOverrideable_c); // void ogre_ent_detachObjectFromBone(struct hg3dclass_struct * thisclass_c, char * movableName_c, struct hg3dclass_struct * result_c); @@ -91,60 +91,60 @@ void ogre_ent_detachAllObjectsFromBone(struct hg3dclass_struct * thisclass_c); void ogre_ent_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_ent_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_hasSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_hasSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_isHardwareAnimationEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_isHardwareAnimationEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_getSoftwareAnimationRequests(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getSoftwareAnimationRequests(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_getSoftwareAnimationNormalsRequests(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getSoftwareAnimationNormalsRequests(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_addSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, int normalsAlso_c); +void ogre_ent_addSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, long normalsAlso_c); // -void ogre_ent_removeSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, int normalsAlso_c); +void ogre_ent_removeSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, long normalsAlso_c); // void ogre_ent_shareSkeletonInstanceWith(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * entity_c); // -void ogre_ent_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_ent_stopSharingSkeletonInstance(struct hg3dclass_struct * thisclass_c); // -void ogre_ent_sharesSkeletonInstance(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_sharesSkeletonInstance(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_ent_refreshAvailableAnimationState(struct hg3dclass_struct * thisclass_c); // Choose which vertex data to bind to the renderer. -void ogre_ent_chooseVertexDataForBinding(struct hg3dclass_struct * thisclass_c, int hasVertexAnim_c, enum EnumEntityVertexDataBindChoice * result_c); +void ogre_ent_chooseVertexDataForBinding(struct hg3dclass_struct * thisclass_c, long hasVertexAnim_c, enum EnumEntityVertexDataBindChoice * result_c); // -void ogre_ent_isInitialised(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_isInitialised(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_ent_backgroundLoadingComplete(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * res_c); // -void ogre_ent_setSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, int skip_c); +void ogre_ent_setSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, long skip_c); // -void ogre_ent_getSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_setAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, int update_c); +void ogre_ent_setAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, long update_c); // -void ogre_ent_getAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassException.h b/Bindings/Ogre/cBuild/include/ClassException.h index 812e3dc..abbe4c2 100644 --- a/Bindings/Ogre/cBuild/include/ClassException.h +++ b/Bindings/Ogre/cBuild/include/ClassException.h @@ -28,7 +28,7 @@ // -void ogre_exc_construct(int number_c, char * description_c, char * source_c, struct hg3dclass_struct * result_c); +void ogre_exc_construct(long number_c, char * description_c, char * source_c, struct hg3dclass_struct * result_c); // Needed for compatibility with std::exception. void ogre_exc_destruct(struct hg3dclass_struct * thisclass_c); @@ -37,7 +37,7 @@ void ogre_exc_destruct(struct hg3dclass_struct * thisclass_c); void ogre_exc_getFullDescription(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_exc_getNumber(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_exc_getNumber(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_exc_getSource(struct hg3dclass_struct * thisclass_c, char * result_c); @@ -46,7 +46,7 @@ void ogre_exc_getSource(struct hg3dclass_struct * thisclass_c, char * result_c); void ogre_exc_getFile(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_exc_getLine(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_exc_getLine(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_exc_getDescription(struct hg3dclass_struct * thisclass_c, char * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassFrustum.h b/Bindings/Ogre/cBuild/include/ClassFrustum.h index 383893f..53ca09b 100644 --- a/Bindings/Ogre/cBuild/include/ClassFrustum.h +++ b/Bindings/Ogre/cBuild/include/ClassFrustum.h @@ -91,16 +91,16 @@ void ogre_frst_resetFrustumExtents(struct hg3dclass_struct * thisclass_c); void ogre_frst_getFrustumExtents(struct hg3dclass_struct * thisclass_c, float * outleft_c, float * outright_c, float * outtop_c, float * outbottom_c); // Returns whether a custom view matrix is in use. -void ogre_frst_isCustomViewMatrixEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_frst_isCustomViewMatrixEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // Returns whether a custom projection matrix is in use. -void ogre_frst_isCustomProjectionMatrixEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_frst_isCustomProjectionMatrixEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_frst_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, int * result_c); +void ogre_frst_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, long * result_c); // Overridden from MovableObject::getTypeFlags -void ogre_frst_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_frst_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_frst_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -142,13 +142,13 @@ void ogre_frst_getOrthoWindowWidth(struct hg3dclass_struct * thisclass_c, float void ogre_frst_disableReflection(struct hg3dclass_struct * thisclass_c); // Returns whether this frustum is being reflected. -void ogre_frst_isReflected(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_frst_isReflected(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_frst_disableCustomNearClipPlane(struct hg3dclass_struct * thisclass_c); // -void ogre_frst_isCustomNearClipPlaneEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_frst_isCustomNearClipPlaneEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_frst_getPositionForViewUpdate(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassHG3DUtilities.h b/Bindings/Ogre/cBuild/include/ClassHG3DUtilities.h index 98a5eed..6195d1d 100644 --- a/Bindings/Ogre/cBuild/include/ClassHG3DUtilities.h +++ b/Bindings/Ogre/cBuild/include/ClassHG3DUtilities.h @@ -30,13 +30,13 @@ // -void ogre_hg3dutl_getWindowHandle(struct hg3dclass_struct * window_c, unsigned int * result_c); +void ogre_hg3dutl_getWindowHandle(struct hg3dclass_struct * window_c, unsigned long * result_c); // void ogre_hg3dutl_setupCloseEventHandler(struct hg3dclass_struct * window_c); // -void ogre_hg3dutl_checkQuitReceived(int * result_c); +void ogre_hg3dutl_checkQuitReceived(long * result_c); // void ogre_hg3dutl_buildTangentVectors(struct hg3dclass_struct * entity_c); diff --git a/Bindings/Ogre/cBuild/include/ClassLight.h b/Bindings/Ogre/cBuild/include/ClassLight.h index 1f6cd05..ec52197 100644 --- a/Bindings/Ogre/cBuild/include/ClassLight.h +++ b/Bindings/Ogre/cBuild/include/ClassLight.h @@ -131,19 +131,19 @@ void ogre_lgt_getPowerScale(struct hg3dclass_struct * thisclass_c, float * resul void ogre_lgt_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_lgt_getDerivedPosition(struct hg3dclass_struct * thisclass_c, int cameraRelativeIfSet_c, struct vector3_struct * result_c); +void ogre_lgt_getDerivedPosition(struct hg3dclass_struct * thisclass_c, long cameraRelativeIfSet_c, struct vector3_struct * result_c); // void ogre_lgt_getDerivedDirection(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); // -void ogre_lgt_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c); +void ogre_lgt_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c); // void ogre_lgt_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); // Override to return specific type flag. -void ogre_lgt_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_lgt_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_lgt_resetCustomShadowCameraSetup(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/cBuild/include/ClassLog.h b/Bindings/Ogre/cBuild/include/ClassLog.h index 1d4e84b..43e8dcc 100644 --- a/Bindings/Ogre/cBuild/include/ClassLog.h +++ b/Bindings/Ogre/cBuild/include/ClassLog.h @@ -36,25 +36,25 @@ void ogre_lg_destruct(struct hg3dclass_struct * thisclass_c); void ogre_lg_getName(struct hg3dclass_struct * thisclass_c, char * result_c); // Get whether debug output is enabled for this log. -void ogre_lg_isDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_lg_isDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // Get whether file output is suppressed for this log. -void ogre_lg_isFileOutputSuppressed(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_lg_isFileOutputSuppressed(struct hg3dclass_struct * thisclass_c, long * result_c); // Get whether time stamps are printed for this log. -void ogre_lg_isTimeStampEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_lg_isTimeStampEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_lg_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, int maskDebug_c); +void ogre_lg_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, long maskDebug_c); // -void ogre_lg_setDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, int debugOutput_c); +void ogre_lg_setDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, long debugOutput_c); // void ogre_lg_setLogDetail(struct hg3dclass_struct * thisclass_c, enum EnumLoggingLevel ll_c); // -void ogre_lg_setTimeStampEnabled(struct hg3dclass_struct * thisclass_c, int timeStamp_c); +void ogre_lg_setTimeStampEnabled(struct hg3dclass_struct * thisclass_c, long timeStamp_c); // void ogre_lg_getLogDetail(struct hg3dclass_struct * thisclass_c, enum EnumLoggingLevel * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassLogManager.h b/Bindings/Ogre/cBuild/include/ClassLogManager.h index e8e21f3..63f2bdd 100644 --- a/Bindings/Ogre/cBuild/include/ClassLogManager.h +++ b/Bindings/Ogre/cBuild/include/ClassLogManager.h @@ -34,7 +34,7 @@ void ogre_lmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_lmgr_createLog(struct hg3dclass_struct * thisclass_c, char * name_c, int defaultLog_c, int debuggerOutput_c, int suppressFileOutput_c, struct hg3dclass_struct * result_c); +void ogre_lmgr_createLog(struct hg3dclass_struct * thisclass_c, char * name_c, long defaultLog_c, long debuggerOutput_c, long suppressFileOutput_c, struct hg3dclass_struct * result_c); // void ogre_lmgr_getLog(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); @@ -52,10 +52,10 @@ void ogre_lmgr_destroyLog2(struct hg3dclass_struct * thisclass_c, struct hg3dcla void ogre_lmgr_setDefaultLog(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * newLog_c, struct hg3dclass_struct * result_c); // -void ogre_lmgr_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, int maskDebug_c); +void ogre_lmgr_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, long maskDebug_c); // -void ogre_lmgr_logMessage2(struct hg3dclass_struct * thisclass_c, enum EnumLogMessageLevel lml_c, char * message_c, int maskDebug_c); +void ogre_lmgr_logMessage2(struct hg3dclass_struct * thisclass_c, enum EnumLogMessageLevel lml_c, char * message_c, long maskDebug_c); // void ogre_lmgr_setLogDetail(struct hg3dclass_struct * thisclass_c, enum EnumLoggingLevel ll_c); diff --git a/Bindings/Ogre/cBuild/include/ClassManualObject.h b/Bindings/Ogre/cBuild/include/ClassManualObject.h index de8325f..d4c42d0 100644 --- a/Bindings/Ogre/cBuild/include/ClassManualObject.h +++ b/Bindings/Ogre/cBuild/include/ClassManualObject.h @@ -43,22 +43,22 @@ void ogre_mno_destruct(struct hg3dclass_struct * thisclass_c); void ogre_mno_clear(struct hg3dclass_struct * thisclass_c); // -void ogre_mno_estimateVertexCount(struct hg3dclass_struct * thisclass_c, int vcount_c); +void ogre_mno_estimateVertexCount(struct hg3dclass_struct * thisclass_c, long vcount_c); // -void ogre_mno_estimateIndexCount(struct hg3dclass_struct * thisclass_c, int icount_c); +void ogre_mno_estimateIndexCount(struct hg3dclass_struct * thisclass_c, long icount_c); // void ogre_mno_begin(struct hg3dclass_struct * thisclass_c, char * materialName_c, enum EnumRenderOperationOperationType opType_c, char * groupName_c); // -void ogre_mno_setDynamic(struct hg3dclass_struct * thisclass_c, int dyn_c); +void ogre_mno_setDynamic(struct hg3dclass_struct * thisclass_c, long dyn_c); // -void ogre_mno_getDynamic(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getDynamic(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mno_beginUpdate(struct hg3dclass_struct * thisclass_c, int sectionIndex_c); +void ogre_mno_beginUpdate(struct hg3dclass_struct * thisclass_c, long sectionIndex_c); // void ogre_mno_position(struct hg3dclass_struct * thisclass_c, struct vector3_struct * pos_c); @@ -103,60 +103,60 @@ void ogre_mno_colour(struct hg3dclass_struct * thisclass_c, struct colourvalue_s void ogre_mno_colour2(struct hg3dclass_struct * thisclass_c, float r_c, float g_c, float b_c, float a_c); // -void ogre_mno_index(struct hg3dclass_struct * thisclass_c, unsigned int idx_c); +void ogre_mno_index(struct hg3dclass_struct * thisclass_c, unsigned long idx_c); // -void ogre_mno_triangle(struct hg3dclass_struct * thisclass_c, unsigned int i1_c, unsigned int i2_c, unsigned int i3_c); +void ogre_mno_triangle(struct hg3dclass_struct * thisclass_c, unsigned long i1_c, unsigned long i2_c, unsigned long i3_c); // -void ogre_mno_quad(struct hg3dclass_struct * thisclass_c, unsigned int i1_c, unsigned int i2_c, unsigned int i3_c, unsigned int i4_c); +void ogre_mno_quad(struct hg3dclass_struct * thisclass_c, unsigned long i1_c, unsigned long i2_c, unsigned long i3_c, unsigned long i4_c); // Get the number of vertices in the section currently being defined (returns 0 if no section is in progress). -void ogre_mno_getCurrentVertexCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getCurrentVertexCount(struct hg3dclass_struct * thisclass_c, long * result_c); // Get the number of indices in the section currently being defined (returns 0 if no section is in progress). -void ogre_mno_getCurrentIndexCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getCurrentIndexCount(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mno_end(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_mno_setMaterialName(struct hg3dclass_struct * thisclass_c, int subindex_c, char * name_c, char * group_c); +void ogre_mno_setMaterialName(struct hg3dclass_struct * thisclass_c, long subindex_c, char * name_c, char * group_c); // void ogre_mno_convertToMesh(struct hg3dclass_struct * thisclass_c, char * meshName_c, char * groupName_c, struct sharedptr_struct * result_c); // -void ogre_mno_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int useIdentityProjection_c); +void ogre_mno_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long useIdentityProjection_c); // -void ogre_mno_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mno_setUseIdentityView(struct hg3dclass_struct * thisclass_c, int useIdentityView_c); +void ogre_mno_setUseIdentityView(struct hg3dclass_struct * thisclass_c, long useIdentityView_c); // -void ogre_mno_getUseIdentityView(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getUseIdentityView(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mno_getSection(struct hg3dclass_struct * thisclass_c, unsigned int index_c, struct hg3dclass_struct * result_c); +void ogre_mno_getSection(struct hg3dclass_struct * thisclass_c, unsigned long index_c, struct hg3dclass_struct * result_c); // -void ogre_mno_getNumSections(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mno_getNumSections(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mno_setKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, int keepOrder_c); +void ogre_mno_setKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, long keepOrder_c); // -void ogre_mno_getKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, long * result_c); -// . +// void ogre_mno_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c); -// . +// void ogre_mno_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_mno_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassManualObjectSection.h b/Bindings/Ogre/cBuild/include/ClassManualObjectSection.h index 133cb32..fc0316b 100644 --- a/Bindings/Ogre/cBuild/include/ClassManualObjectSection.h +++ b/Bindings/Ogre/cBuild/include/ClassManualObjectSection.h @@ -47,15 +47,15 @@ void ogre_mnos_getMaterialGroup(struct hg3dclass_struct * thisclass_c, char * re void ogre_mnos_setMaterialName(struct hg3dclass_struct * thisclass_c, char * name_c, char * groupName_c); // Set whether we need 32-bit indices. -void ogre_mnos_set32BitIndices(struct hg3dclass_struct * thisclass_c, int n32_c); +void ogre_mnos_set32BitIndices(struct hg3dclass_struct * thisclass_c, long n32_c); // Get whether we need 32-bit indices. -void ogre_mnos_get32BitIndices(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mnos_get32BitIndices(struct hg3dclass_struct * thisclass_c, long * result_c); -// . +// void ogre_mnos_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); -// . +// void ogre_mnos_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * _c, float * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassMaterial.h b/Bindings/Ogre/cBuild/include/ClassMaterial.h index 2f0efc4..95610cf 100644 --- a/Bindings/Ogre/cBuild/include/ClassMaterial.h +++ b/Bindings/Ogre/cBuild/include/ClassMaterial.h @@ -33,19 +33,19 @@ void ogre_mtrl_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_mtrl_isTransparent(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mtrl_isTransparent(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mtrl_setReceiveShadows(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setReceiveShadows(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_getReceiveShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mtrl_getReceiveShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mtrl_setTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_getTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mtrl_getTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mtrl_getNumTechniques(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); @@ -69,13 +69,13 @@ void ogre_mtrl_getNumLodLevels(struct hg3dclass_struct * thisclass_c, unsigned s void ogre_mtrl_getNumLodLevels2(struct hg3dclass_struct * thisclass_c, char * schemeName_c, unsigned short * result_c); // -void ogre_mtrl_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, int changeGroup_c, char * newGroup_c, struct sharedptr_struct * result_c); +void ogre_mtrl_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, long changeGroup_c, char * newGroup_c, struct sharedptr_struct * result_c); // void ogre_mtrl_copyDetailsTo(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * mat_c); // -void ogre_mtrl_compile(struct hg3dclass_struct * thisclass_c, int autoManageTextureUnits_c); +void ogre_mtrl_compile(struct hg3dclass_struct * thisclass_c, long autoManageTextureUnits_c); // void ogre_mtrl_setPointSize(struct hg3dclass_struct * thisclass_c, float ps_c); @@ -108,27 +108,27 @@ void ogre_mtrl_setSelfIllumination(struct hg3dclass_struct * thisclass_c, float void ogre_mtrl_setSelfIllumination2(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * selfIllum_c); // -void ogre_mtrl_setDepthCheckEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setDepthCheckEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_setDepthWriteEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setDepthWriteEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_setColourWriteEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setColourWriteEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_setLightingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setLightingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // void ogre_mtrl_setDepthBias(struct hg3dclass_struct * thisclass_c, float constantBias_c, float slopeScaleBias_c); // -void ogre_mtrl_setTextureAnisotropy(struct hg3dclass_struct * thisclass_c, int maxAniso_c); +void ogre_mtrl_setTextureAnisotropy(struct hg3dclass_struct * thisclass_c, long maxAniso_c); // void ogre_mtrl_touch(struct hg3dclass_struct * thisclass_c); // -void ogre_mtrl_getCompilationRequired(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mtrl_getCompilationRequired(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassMaterialManager.h b/Bindings/Ogre/cBuild/include/ClassMaterialManager.h index 41f337b..7bff113 100644 --- a/Bindings/Ogre/cBuild/include/ClassMaterialManager.h +++ b/Bindings/Ogre/cBuild/include/ClassMaterialManager.h @@ -38,10 +38,10 @@ void ogre_mtrlmgr_destruct(struct hg3dclass_struct * thisclass_c); void ogre_mtrlmgr_initialise(struct hg3dclass_struct * thisclass_c); // -void ogre_mtrlmgr_setDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned int maxAniso_c); +void ogre_mtrlmgr_setDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned long maxAniso_c); // Get the default maxAnisotropy. -void ogre_mtrlmgr_getDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mtrlmgr_getDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_mtrlmgr_getDefaultSettings(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassMesh.h b/Bindings/Ogre/cBuild/include/ClassMesh.h index 2c1aa45..9ad1a1a 100644 --- a/Bindings/Ogre/cBuild/include/ClassMesh.h +++ b/Bindings/Ogre/cBuild/include/ClassMesh.h @@ -55,10 +55,10 @@ void ogre_msh_getBoundingSphereRadius(struct hg3dclass_struct * thisclass_c, flo void ogre_msh_setSkeletonName(struct hg3dclass_struct * thisclass_c, char * skelName_c); // -void ogre_msh_hasSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_hasSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_msh_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_getSkeleton(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); @@ -73,16 +73,16 @@ void ogre_msh_clearBoneAssignments(struct hg3dclass_struct * thisclass_c); void ogre_msh_createManualLodLevel(struct hg3dclass_struct * thisclass_c, float value_c, char * meshName_c, char * groupName_c); // -void ogre_msh_isLodManual(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isLodManual(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_removeLodLevels(struct hg3dclass_struct * thisclass_c); // -void ogre_msh_isVertexBufferShadowed(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isVertexBufferShadowed(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_msh_isIndexBufferShadowed(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isIndexBufferShadowed(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_buildEdgeList(struct hg3dclass_struct * thisclass_c); @@ -94,22 +94,22 @@ void ogre_msh_freeEdgeList(struct hg3dclass_struct * thisclass_c); void ogre_msh_prepareForShadowVolume(struct hg3dclass_struct * thisclass_c); // -void ogre_msh_isPreparedForShadowVolumes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isPreparedForShadowVolumes(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_msh_isEdgeListBuilt(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isEdgeListBuilt(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_msh_setAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, int autobuild_c); +void ogre_msh_setAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, long autobuild_c); // -void ogre_msh_getAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_getAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_getSharedVertexDataAnimationType(struct hg3dclass_struct * thisclass_c, enum EnumVertexAnimationType * result_c); // Returns whether animation on shared vertex data includes normals. -void ogre_msh_getSharedVertexDataAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_getSharedVertexDataAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_createAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, float length_c, struct hg3dclass_struct * result_c); @@ -118,7 +118,7 @@ void ogre_msh_createAnimation(struct hg3dclass_struct * thisclass_c, char * name void ogre_msh_getAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_msh_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_msh_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_msh_removeAnimation(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -136,7 +136,7 @@ void ogre_msh_removeAllAnimations(struct hg3dclass_struct * thisclass_c); void ogre_msh_updateMaterialForAllSubMeshes(struct hg3dclass_struct * thisclass_c); // -void ogre_msh_getPoseCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_getPoseCount(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_removePose2(struct hg3dclass_struct * thisclass_c, char * name_c); diff --git a/Bindings/Ogre/cBuild/include/ClassMeshManager.h b/Bindings/Ogre/cBuild/include/ClassMeshManager.h index 89b6b74..2f49f18 100644 --- a/Bindings/Ogre/cBuild/include/ClassMeshManager.h +++ b/Bindings/Ogre/cBuild/include/ClassMeshManager.h @@ -35,10 +35,10 @@ void ogre_mshmgr_construct(struct hg3dclass_struct * result_c); void ogre_mshmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_mshmgr_setPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_mshmgr_setPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_mshmgr_getPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mshmgr_getPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mshmgr_getBoundsPaddingFactor(struct hg3dclass_struct * thisclass_c, float * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassMovableObject.h b/Bindings/Ogre/cBuild/include/ClassMovableObject.h index 731cd49..7a63c26 100644 --- a/Bindings/Ogre/cBuild/include/ClassMovableObject.h +++ b/Bindings/Ogre/cBuild/include/ClassMovableObject.h @@ -46,28 +46,28 @@ void ogre_mvo_getParentNode(struct hg3dclass_struct * thisclass_c, struct hg3dcl void ogre_mvo_getParentSceneNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // Gets whether the parent node is a TagPoint (or a SceneNode -void ogre_mvo_isParentTagPoint(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isParentTagPoint(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_isAttached(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isAttached(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mvo_detachFromParent(struct hg3dclass_struct * thisclass_c); // -void ogre_mvo_isInScene(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isInScene(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mvo_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_mvo_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c); +void ogre_mvo_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c); // -void ogre_mvo_getVisible(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_getVisible(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_isVisible(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isVisible(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mvo_setRenderingDistance(struct hg3dclass_struct * thisclass_c, float dist_c); @@ -82,69 +82,69 @@ void ogre_mvo_setRenderingMinPixelSize(struct hg3dclass_struct * thisclass_c, fl void ogre_mvo_getRenderingMinPixelSize(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_mvo_setQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_setQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // -void ogre_mvo_addQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_addQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // -void ogre_mvo_removeQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_removeQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // Returns the query flags relevant for this object. -void ogre_mvo_getQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvo_getQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mvo_setVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_setVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // -void ogre_mvo_addVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_addVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // -void ogre_mvo_removeVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_removeVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // Returns the visibility flags relevant for this object. -void ogre_mvo_getVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvo_getVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mvo_getLightMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvo_getLightMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mvo_setLightMask(struct hg3dclass_struct * thisclass_c, unsigned int lightMask_c); +void ogre_mvo_setLightMask(struct hg3dclass_struct * thisclass_c, unsigned long lightMask_c); // Define a default implementation of method from ShadowCaster which implements no shadows. -void ogre_mvo_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_setCastShadows(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mvo_setCastShadows(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mvo_getCastShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_getCastShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_getReceivesShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_getReceivesShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mvo_getPointExtrusionDistance(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * l_c, float * result_c); // -void ogre_mvo_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvo_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mvo_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mvo_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // Gets whether debug display of this object is enabled. -void ogre_mvo_isDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_setDefaultQueryFlags(unsigned int flags_c); +void ogre_mvo_setDefaultQueryFlags(unsigned long flags_c); // -void ogre_mvo_getDefaultQueryFlags(unsigned int * result_c); +void ogre_mvo_getDefaultQueryFlags(unsigned long * result_c); // -void ogre_mvo_setDefaultVisibilityFlags(unsigned int flags_c); +void ogre_mvo_setDefaultVisibilityFlags(unsigned long flags_c); // -void ogre_mvo_getDefaultVisibilityFlags(unsigned int * result_c); +void ogre_mvo_getDefaultVisibilityFlags(unsigned long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassMovableObjectFactory.h b/Bindings/Ogre/cBuild/include/ClassMovableObjectFactory.h index eb8bada..1415a36 100644 --- a/Bindings/Ogre/cBuild/include/ClassMovableObjectFactory.h +++ b/Bindings/Ogre/cBuild/include/ClassMovableObjectFactory.h @@ -38,9 +38,9 @@ void ogre_mvof_getType(struct hg3dclass_struct * thisclass_c, char * result_c); void ogre_mvof_destroyInstance(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * obj_c); // -void ogre_mvof_requestTypeFlags(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvof_requestTypeFlags(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvof_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvof_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassMultiRenderTarget.h b/Bindings/Ogre/cBuild/include/ClassMultiRenderTarget.h index 594a1fc..c034e0e 100644 --- a/Bindings/Ogre/cBuild/include/ClassMultiRenderTarget.h +++ b/Bindings/Ogre/cBuild/include/ClassMultiRenderTarget.h @@ -29,12 +29,12 @@ // -void ogre_mrt_bindSurface(struct hg3dclass_struct * thisclass_c, int attachment_c, struct hg3dclass_struct * target_c); +void ogre_mrt_bindSurface(struct hg3dclass_struct * thisclass_c, long attachment_c, struct hg3dclass_struct * target_c); // -void ogre_mrt_unbindSurface(struct hg3dclass_struct * thisclass_c, int attachment_c); +void ogre_mrt_unbindSurface(struct hg3dclass_struct * thisclass_c, long attachment_c); // -void ogre_mrt_getBoundSurface(struct hg3dclass_struct * thisclass_c, int index_c, struct hg3dclass_struct * result_c); +void ogre_mrt_getBoundSurface(struct hg3dclass_struct * thisclass_c, long index_c, struct hg3dclass_struct * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassNode.h b/Bindings/Ogre/cBuild/include/ClassNode.h index f60688c..06d4564 100644 --- a/Bindings/Ogre/cBuild/include/ClassNode.h +++ b/Bindings/Ogre/cBuild/include/ClassNode.h @@ -72,16 +72,16 @@ void ogre_nd_setScale2(struct hg3dclass_struct * thisclass_c, float x_c, float y void ogre_nd_getScale(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); // -void ogre_nd_setInheritOrientation(struct hg3dclass_struct * thisclass_c, int inherit_c); +void ogre_nd_setInheritOrientation(struct hg3dclass_struct * thisclass_c, long inherit_c); // -void ogre_nd_getInheritOrientation(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_nd_getInheritOrientation(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_nd_setInheritScale(struct hg3dclass_struct * thisclass_c, int inherit_c); +void ogre_nd_setInheritScale(struct hg3dclass_struct * thisclass_c, long inherit_c); // -void ogre_nd_getInheritScale(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_nd_getInheritScale(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_nd_scale(struct hg3dclass_struct * thisclass_c, struct vector3_struct * scale_c); @@ -171,10 +171,10 @@ void ogre_nd_getInitialScale(struct hg3dclass_struct * thisclass_c, struct vecto void ogre_nd_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, float * result_c); // -void ogre_nd_needUpdate(struct hg3dclass_struct * thisclass_c, int forceParentUpdate_c); +void ogre_nd_needUpdate(struct hg3dclass_struct * thisclass_c, long forceParentUpdate_c); // -void ogre_nd_requestUpdate(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * child_c, int forceParentUpdate_c); +void ogre_nd_requestUpdate(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * child_c, long forceParentUpdate_c); // void ogre_nd_cancelUpdate(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * child_c); diff --git a/Bindings/Ogre/cBuild/include/ClassNodeAnimationTrack.h b/Bindings/Ogre/cBuild/include/ClassNodeAnimationTrack.h index 3bd43a0..84b44cf 100644 --- a/Bindings/Ogre/cBuild/include/ClassNodeAnimationTrack.h +++ b/Bindings/Ogre/cBuild/include/ClassNodeAnimationTrack.h @@ -46,16 +46,16 @@ void ogre_noat_setAssociatedNode(struct hg3dclass_struct * thisclass_c, struct h void ogre_noat_applyToNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * node_c, struct hg3dclass_struct * timeIndex_c, float weight_c, float scale_c); // -void ogre_noat_setUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, int useShortestPath_c); +void ogre_noat_setUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, long useShortestPath_c); // -void ogre_noat_getUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_noat_getUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_noat_apply(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * timeIndex_c, float weight_c, float scale_c); // -void ogre_noat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_noat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_noat_optimise(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/cBuild/include/ClassRenderSystem.h b/Bindings/Ogre/cBuild/include/ClassRenderSystem.h index 2e54162..612d135 100644 --- a/Bindings/Ogre/cBuild/include/ClassRenderSystem.h +++ b/Bindings/Ogre/cBuild/include/ClassRenderSystem.h @@ -53,13 +53,13 @@ void ogre_rds_shutdown(struct hg3dclass_struct * thisclass_c); void ogre_rds_setAmbientLight(struct hg3dclass_struct * thisclass_c, float r_c, float g_c, float b_c); // -void ogre_rds_setLightingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_rds_setLightingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_rds_setWBufferEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_rds_setWBufferEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_rds_getWBufferEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_getWBufferEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rds_createMultiRenderTarget(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); @@ -83,34 +83,34 @@ void ogre_rds_getRenderTarget(struct hg3dclass_struct * thisclass_c, char * name void ogre_rds_detachRenderTarget(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_rds_getErrorDescription(struct hg3dclass_struct * thisclass_c, int errorNumber_c, char * result_c); +void ogre_rds_getErrorDescription(struct hg3dclass_struct * thisclass_c, long errorNumber_c, char * result_c); // -void ogre_rds_setWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_rds_setWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_rds_getWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_getWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rds_getGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_getGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rds_setGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, const int val_c); +void ogre_rds_setGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, const long val_c); // void ogre_rds_setDepthBufferFor(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * renderTarget_c); // -void ogre_rds_areFixedFunctionLightsInViewSpace(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_areFixedFunctionLightsInViewSpace(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rds_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned int * pDest_c); +void ogre_rds_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned long * pDest_c); // -void ogre_rds_setStencilCheckEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_rds_setStencilCheckEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_rds_setNormaliseNormals(struct hg3dclass_struct * thisclass_c, int normalise_c); +void ogre_rds_setNormaliseNormals(struct hg3dclass_struct * thisclass_c, long normalise_c); // void ogre_rds_bindGpuProgramPassIterationParameters(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c); @@ -119,7 +119,7 @@ void ogre_rds_bindGpuProgramPassIterationParameters(struct hg3dclass_struct * th void ogre_rds_unbindGpuProgram(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c); // -void ogre_rds_isGpuProgramBound(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c, int * result_c); +void ogre_rds_isGpuProgramBound(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c, long * result_c); // void ogre_rds_addClipPlane2(struct hg3dclass_struct * thisclass_c, float A_c, float B_c, float C_c, float D_c); @@ -128,16 +128,16 @@ void ogre_rds_addClipPlane2(struct hg3dclass_struct * thisclass_c, float A_c, fl void ogre_rds_resetClipPlanes(struct hg3dclass_struct * thisclass_c); // -void ogre_rds_setInvertVertexWinding(struct hg3dclass_struct * thisclass_c, int invert_c); +void ogre_rds_setInvertVertexWinding(struct hg3dclass_struct * thisclass_c, long invert_c); // -void ogre_rds_getInvertVertexWinding(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_getInvertVertexWinding(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rds_setScissorTest(struct hg3dclass_struct * thisclass_c, int enabled_c, int left_c, int top_c, int right_c, int bottom_c); +void ogre_rds_setScissorTest(struct hg3dclass_struct * thisclass_c, long enabled_c, long left_c, long top_c, long right_c, long bottom_c); // -void ogre_rds_clearFrameBuffer(struct hg3dclass_struct * thisclass_c, unsigned int buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c); +void ogre_rds_clearFrameBuffer(struct hg3dclass_struct * thisclass_c, unsigned long buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c); // void ogre_rds_getHorizontalTexelOffset(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -152,10 +152,10 @@ void ogre_rds_getMinimumDepthInputValue(struct hg3dclass_struct * thisclass_c, f void ogre_rds_getMaximumDepthInputValue(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_rds_setCurrentPassIterationCount(struct hg3dclass_struct * thisclass_c, const int count_c); +void ogre_rds_setCurrentPassIterationCount(struct hg3dclass_struct * thisclass_c, const long count_c); // -void ogre_rds_setDeriveDepthBias(struct hg3dclass_struct * thisclass_c, int derive_c, float baseValue_c, float multiplier_c, float slopeScale_c); +void ogre_rds_setDeriveDepthBias(struct hg3dclass_struct * thisclass_c, long derive_c, float baseValue_c, float multiplier_c, float slopeScale_c); // void ogre_rds_preExtraThreadsStarted(struct hg3dclass_struct * thisclass_c); @@ -170,7 +170,7 @@ void ogre_rds_registerThread(struct hg3dclass_struct * thisclass_c); void ogre_rds_unregisterThread(struct hg3dclass_struct * thisclass_c); // -void ogre_rds_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rds_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_rds_beginProfileEvent(struct hg3dclass_struct * thisclass_c, char * eventName_c); diff --git a/Bindings/Ogre/cBuild/include/ClassRenderTarget.h b/Bindings/Ogre/cBuild/include/ClassRenderTarget.h index 4d57cff..dd626a9 100644 --- a/Bindings/Ogre/cBuild/include/ClassRenderTarget.h +++ b/Bindings/Ogre/cBuild/include/ClassRenderTarget.h @@ -36,16 +36,16 @@ void ogre_rtgt_destruct(struct hg3dclass_struct * thisclass_c); void ogre_rtgt_getName(struct hg3dclass_struct * thisclass_c, char * result_c); // Retrieve information about the render target. -void ogre_rtgt_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned int * width_c, unsigned int * height_c, unsigned int * colourDepth_c); +void ogre_rtgt_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned long * width_c, unsigned long * height_c, unsigned long * colourDepth_c); // -void ogre_rtgt_getWidth(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rtgt_getWidth(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_rtgt_getHeight(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rtgt_getHeight(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_rtgt_getColourDepth(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rtgt_getColourDepth(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_rtgt_setDepthBufferPool(struct hg3dclass_struct * thisclass_c, unsigned short poolId_c); @@ -57,13 +57,13 @@ void ogre_rtgt_getDepthBufferPool(struct hg3dclass_struct * thisclass_c, unsigne void ogre_rtgt_detachDepthBuffer(struct hg3dclass_struct * thisclass_c); // -void ogre_rtgt_update(struct hg3dclass_struct * thisclass_c, int swapBuffers_c); +void ogre_rtgt_update(struct hg3dclass_struct * thisclass_c, long swapBuffers_c); // -void ogre_rtgt_swapBuffers(struct hg3dclass_struct * thisclass_c, int waitForVSync_c); +void ogre_rtgt_swapBuffers(struct hg3dclass_struct * thisclass_c, long waitForVSync_c); // -void ogre_rtgt_addViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, int ZOrder_c, float left_c, float top_c, float width_c, float height_c, struct hg3dclass_struct * result_c); +void ogre_rtgt_addViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, long ZOrder_c, float left_c, float top_c, float width_c, float height_c, struct hg3dclass_struct * result_c); // void ogre_rtgt_getNumViewports(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); @@ -72,13 +72,13 @@ void ogre_rtgt_getNumViewports(struct hg3dclass_struct * thisclass_c, unsigned s void ogre_rtgt_getViewport(struct hg3dclass_struct * thisclass_c, unsigned short index_c, struct hg3dclass_struct * result_c); // -void ogre_rtgt_getViewportByZOrder(struct hg3dclass_struct * thisclass_c, int ZOrder_c, struct hg3dclass_struct * result_c); +void ogre_rtgt_getViewportByZOrder(struct hg3dclass_struct * thisclass_c, long ZOrder_c, struct hg3dclass_struct * result_c); // -void ogre_rtgt_hasViewportWithZOrder(struct hg3dclass_struct * thisclass_c, int ZOrder_c, int * result_c); +void ogre_rtgt_hasViewportWithZOrder(struct hg3dclass_struct * thisclass_c, long ZOrder_c, long * result_c); // -void ogre_rtgt_removeViewport(struct hg3dclass_struct * thisclass_c, int ZOrder_c); +void ogre_rtgt_removeViewport(struct hg3dclass_struct * thisclass_c, long ZOrder_c); // void ogre_rtgt_removeAllViewports(struct hg3dclass_struct * thisclass_c); @@ -111,16 +111,16 @@ void ogre_rtgt_resetStatistics(struct hg3dclass_struct * thisclass_c); void ogre_rtgt_removeAllListeners(struct hg3dclass_struct * thisclass_c); // -void ogre_rtgt_isActive(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_isActive(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_setActive(struct hg3dclass_struct * thisclass_c, int state_c); +void ogre_rtgt_setActive(struct hg3dclass_struct * thisclass_c, long state_c); // -void ogre_rtgt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, int autoupdate_c); +void ogre_rtgt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, long autoupdate_c); // -void ogre_rtgt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rtgt_writeContentsToFile(struct hg3dclass_struct * thisclass_c, char * filename_c); @@ -129,22 +129,22 @@ void ogre_rtgt_writeContentsToFile(struct hg3dclass_struct * thisclass_c, char * void ogre_rtgt_writeContentsToTimestampedFile(struct hg3dclass_struct * thisclass_c, char * filenamePrefix_c, char * filenameSuffix_c, char * result_c); // -void ogre_rtgt_requiresTextureFlipping(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_requiresTextureFlipping(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_getTriangleCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_getTriangleCount(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_getBatchCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_getBatchCount(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_isPrimary(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_isPrimary(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_isHardwareGammaEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_isHardwareGammaEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_getFSAA(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rtgt_getFSAA(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_rtgt_getFSAAHint(struct hg3dclass_struct * thisclass_c, char * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassRenderWindow.h b/Bindings/Ogre/cBuild/include/ClassRenderWindow.h index 689b8af..936e5a6 100644 --- a/Bindings/Ogre/cBuild/include/ClassRenderWindow.h +++ b/Bindings/Ogre/cBuild/include/ClassRenderWindow.h @@ -28,63 +28,63 @@ // -void ogre_rw_setFullscreen(struct hg3dclass_struct * thisclass_c, int fullScreen_c, unsigned int width_c, unsigned int height_c); +void ogre_rw_setFullscreen(struct hg3dclass_struct * thisclass_c, long fullScreen_c, unsigned long width_c, unsigned long height_c); // void ogre_rw_destroy(struct hg3dclass_struct * thisclass_c); // -void ogre_rw_resize(struct hg3dclass_struct * thisclass_c, unsigned int width_c, unsigned int height_c); +void ogre_rw_resize(struct hg3dclass_struct * thisclass_c, unsigned long width_c, unsigned long height_c); // void ogre_rw_windowMovedOrResized(struct hg3dclass_struct * thisclass_c); // -void ogre_rw_reposition(struct hg3dclass_struct * thisclass_c, int left_c, int top_c); +void ogre_rw_reposition(struct hg3dclass_struct * thisclass_c, long left_c, long top_c); // -void ogre_rw_isVisible(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isVisible(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c); +void ogre_rw_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c); // -void ogre_rw_isHidden(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isHidden(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_setHidden(struct hg3dclass_struct * thisclass_c, int hidden_c); +void ogre_rw_setHidden(struct hg3dclass_struct * thisclass_c, long hidden_c); // -void ogre_rw_setVSyncEnabled(struct hg3dclass_struct * thisclass_c, int vsync_c); +void ogre_rw_setVSyncEnabled(struct hg3dclass_struct * thisclass_c, long vsync_c); // -void ogre_rw_isVSyncEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isVSyncEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_setVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned int interval_c); +void ogre_rw_setVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned long interval_c); // -void ogre_rw_getVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rw_getVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_rw_isActive(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isActive(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_isClosed(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isClosed(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_isPrimary(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isPrimary(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_isFullScreen(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isFullScreen(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned int * width_c, unsigned int * height_c, unsigned int * colourDepth_c, int * left_c, int * top_c); +void ogre_rw_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned long * width_c, unsigned long * height_c, unsigned long * colourDepth_c, long * left_c, long * top_c); // -void ogre_rw_isDeactivatedOnFocusChange(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isDeactivatedOnFocusChange(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_setDeactivateOnFocusChange(struct hg3dclass_struct * thisclass_c, int deactivate_c); +void ogre_rw_setDeactivateOnFocusChange(struct hg3dclass_struct * thisclass_c, long deactivate_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassRenderable.h b/Bindings/Ogre/cBuild/include/ClassRenderable.h index 3f5c02c..94a242a 100644 --- a/Bindings/Ogre/cBuild/include/ClassRenderable.h +++ b/Bindings/Ogre/cBuild/include/ClassRenderable.h @@ -38,7 +38,7 @@ void ogre_rndl_destruct(struct hg3dclass_struct * thisclass_c); void ogre_rndl_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); // -void ogre_rndl_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, int * result_c); +void ogre_rndl_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, long * result_c); // void ogre_rndl_postRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c); @@ -47,33 +47,33 @@ void ogre_rndl_postRender(struct hg3dclass_struct * thisclass_c, struct hg3dclas void ogre_rndl_getNumWorldTransforms(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); // -void ogre_rndl_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int useIdentityProjection_c); +void ogre_rndl_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long useIdentityProjection_c); // -void ogre_rndl_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rndl_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rndl_setUseIdentityView(struct hg3dclass_struct * thisclass_c, int useIdentityView_c); +void ogre_rndl_setUseIdentityView(struct hg3dclass_struct * thisclass_c, long useIdentityView_c); // -void ogre_rndl_getUseIdentityView(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rndl_getUseIdentityView(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rndl_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, float * result_c); // -void ogre_rndl_getCastsShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rndl_getCastsShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rndl_removeCustomParameter(struct hg3dclass_struct * thisclass_c, int index_c); +void ogre_rndl_removeCustomParameter(struct hg3dclass_struct * thisclass_c, long index_c); // -void ogre_rndl_hasCustomParameter(struct hg3dclass_struct * thisclass_c, int index_c, int * result_c); +void ogre_rndl_hasCustomParameter(struct hg3dclass_struct * thisclass_c, long index_c, long * result_c); // -void ogre_rndl_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int override_c); +void ogre_rndl_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long override_c); // -void ogre_rndl_getPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rndl_getPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassResource.h b/Bindings/Ogre/cBuild/include/ClassResource.h index af9b138..a72b7fb 100644 --- a/Bindings/Ogre/cBuild/include/ClassResource.h +++ b/Bindings/Ogre/cBuild/include/ClassResource.h @@ -32,25 +32,25 @@ void ogre_rsrc_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrc_prepare(struct hg3dclass_struct * thisclass_c, int backgroundThread_c); +void ogre_rsrc_prepare(struct hg3dclass_struct * thisclass_c, long backgroundThread_c); // -void ogre_rsrc_load(struct hg3dclass_struct * thisclass_c, int backgroundThread_c); +void ogre_rsrc_load(struct hg3dclass_struct * thisclass_c, long backgroundThread_c); // void ogre_rsrc_reload(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrc_isReloadable(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isReloadable(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_isManuallyLoaded(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isManuallyLoaded(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rsrc_unload(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrc_getSize(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_getSize(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rsrc_touch(struct hg3dclass_struct * thisclass_c); @@ -59,19 +59,19 @@ void ogre_rsrc_touch(struct hg3dclass_struct * thisclass_c); void ogre_rsrc_getName(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_rsrc_isPrepared(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isPrepared(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_isLoaded(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isLoaded(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_isLoading(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isLoading(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_isBackgroundLoaded(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isBackgroundLoaded(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_setBackgroundLoaded(struct hg3dclass_struct * thisclass_c, int bl_c); +void ogre_rsrc_setBackgroundLoaded(struct hg3dclass_struct * thisclass_c, long bl_c); // void ogre_rsrc_escalateLoading(struct hg3dclass_struct * thisclass_c); @@ -89,6 +89,6 @@ void ogre_rsrc_getCreator(struct hg3dclass_struct * thisclass_c, struct hg3dclas void ogre_rsrc_getOrigin(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_rsrc_getStateCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_getStateCount(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassResourceGroupManager.h b/Bindings/Ogre/cBuild/include/ClassResourceGroupManager.h index 6fe1403..89a18ab 100644 --- a/Bindings/Ogre/cBuild/include/ClassResourceGroupManager.h +++ b/Bindings/Ogre/cBuild/include/ClassResourceGroupManager.h @@ -35,7 +35,7 @@ void ogre_rgmgr_construct(struct hg3dclass_struct * result_c); void ogre_rgmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_rgmgr_createResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, const int inGlobalPool_c); +void ogre_rgmgr_createResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, const long inGlobalPool_c); // void ogre_rgmgr_initialiseResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -44,16 +44,16 @@ void ogre_rgmgr_initialiseResourceGroup(struct hg3dclass_struct * thisclass_c, c void ogre_rgmgr_initialiseAllResourceGroups(struct hg3dclass_struct * thisclass_c); // -void ogre_rgmgr_prepareResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int prepareMainResources_c, int prepareWorldGeom_c); +void ogre_rgmgr_prepareResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long prepareMainResources_c, long prepareWorldGeom_c); // -void ogre_rgmgr_loadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int loadMainResources_c, int loadWorldGeom_c); +void ogre_rgmgr_loadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long loadMainResources_c, long loadWorldGeom_c); // -void ogre_rgmgr_unloadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int reloadableOnly_c); +void ogre_rgmgr_unloadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long reloadableOnly_c); // -void ogre_rgmgr_unloadUnreferencedResourcesInGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int reloadableOnly_c); +void ogre_rgmgr_unloadUnreferencedResourcesInGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long reloadableOnly_c); // void ogre_rgmgr_clearResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -62,31 +62,31 @@ void ogre_rgmgr_clearResourceGroup(struct hg3dclass_struct * thisclass_c, char * void ogre_rgmgr_destroyResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c); // -void ogre_rgmgr_isResourceGroupInitialised(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rgmgr_isResourceGroupInitialised(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // -void ogre_rgmgr_isResourceGroupLoaded(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rgmgr_isResourceGroupLoaded(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // -void ogre_rgmgr_resourceGroupExists(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rgmgr_resourceGroupExists(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // -void ogre_rgmgr_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * resGroup_c, int recursive_c); +void ogre_rgmgr_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * resGroup_c, long recursive_c); // void ogre_rgmgr_removeResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * resGroup_c); // -void ogre_rgmgr_resourceLocationExists(struct hg3dclass_struct * thisclass_c, char * name_c, char * resGroup_c, int * result_c); +void ogre_rgmgr_resourceLocationExists(struct hg3dclass_struct * thisclass_c, char * name_c, char * resGroup_c, long * result_c); // void ogre_rgmgr_undeclareResource(struct hg3dclass_struct * thisclass_c, char * name_c, char * groupName_c); // -void ogre_rgmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * group_c, char * filename_c, int * result_c); +void ogre_rgmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * group_c, char * filename_c, long * result_c); // -void ogre_rgmgr_resourceExistsInAnyGroup(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c); +void ogre_rgmgr_resourceExistsInAnyGroup(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c); // void ogre_rgmgr_findGroupContainingResource(struct hg3dclass_struct * thisclass_c, char * filename_c, char * result_c); @@ -110,7 +110,7 @@ void ogre_rgmgr_linkWorldGeometryToResourceGroup(struct hg3dclass_struct * thisc void ogre_rgmgr_unlinkWorldGeometryFromResourceGroup(struct hg3dclass_struct * thisclass_c, char * group_c); // -void ogre_rgmgr_isResourceGroupInGlobalPool(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rgmgr_isResourceGroupInGlobalPool(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_rgmgr_shutdownAll(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/cBuild/include/ClassResourceManager.h b/Bindings/Ogre/cBuild/include/ClassResourceManager.h index 9ead609..461e339 100644 --- a/Bindings/Ogre/cBuild/include/ClassResourceManager.h +++ b/Bindings/Ogre/cBuild/include/ClassResourceManager.h @@ -31,28 +31,28 @@ void ogre_rsrcmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrcmgr_setMemoryBudget(struct hg3dclass_struct * thisclass_c, int bytes_c); +void ogre_rsrcmgr_setMemoryBudget(struct hg3dclass_struct * thisclass_c, long bytes_c); // -void ogre_rsrcmgr_getMemoryBudget(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrcmgr_getMemoryBudget(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrcmgr_getMemoryUsage(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrcmgr_getMemoryUsage(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rsrcmgr_unload(struct hg3dclass_struct * thisclass_c, char * name_c); // -void ogre_rsrcmgr_unloadAll(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_unloadAll(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // -void ogre_rsrcmgr_reloadAll(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_reloadAll(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // -void ogre_rsrcmgr_unloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_unloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // -void ogre_rsrcmgr_reloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_reloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // void ogre_rsrcmgr_remove2(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -61,10 +61,10 @@ void ogre_rsrcmgr_remove2(struct hg3dclass_struct * thisclass_c, char * name_c); void ogre_rsrcmgr_removeAll(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrcmgr_removeUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_removeUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // Returns whether the named resource exists in this manager. -void ogre_rsrcmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rsrcmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_rsrcmgr_getLoadingOrder(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -73,10 +73,10 @@ void ogre_rsrcmgr_getLoadingOrder(struct hg3dclass_struct * thisclass_c, float * void ogre_rsrcmgr_getResourceType(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_rsrcmgr_setVerbose(struct hg3dclass_struct * thisclass_c, int v_c); +void ogre_rsrcmgr_setVerbose(struct hg3dclass_struct * thisclass_c, long v_c); // -void ogre_rsrcmgr_getVerbose(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrcmgr_getVerbose(struct hg3dclass_struct * thisclass_c, long * result_c); // Destroy a resource pool. void ogre_rsrcmgr_destroyResourcePool2(struct hg3dclass_struct * thisclass_c, char * name_c); diff --git a/Bindings/Ogre/cBuild/include/ClassRoot.h b/Bindings/Ogre/cBuild/include/ClassRoot.h index 6c87e89..1a26187 100644 --- a/Bindings/Ogre/cBuild/include/ClassRoot.h +++ b/Bindings/Ogre/cBuild/include/ClassRoot.h @@ -46,10 +46,10 @@ void ogre_rt_destruct(struct hg3dclass_struct * thisclass_c); void ogre_rt_saveConfig(struct hg3dclass_struct * thisclass_c); // -void ogre_rt_restoreConfig(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_restoreConfig(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_showConfigDialog(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_showConfigDialog(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rt_addRenderSystem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * newRend_c); @@ -64,16 +64,16 @@ void ogre_rt_setRenderSystem(struct hg3dclass_struct * thisclass_c, struct hg3dc void ogre_rt_getRenderSystem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_rt_initialise(struct hg3dclass_struct * thisclass_c, int autoCreateWindow_c, char * windowTitle_c, char * customCapabilitiesConfig_c, struct hg3dclass_struct * result_c); +void ogre_rt_initialise(struct hg3dclass_struct * thisclass_c, long autoCreateWindow_c, char * windowTitle_c, char * customCapabilitiesConfig_c, struct hg3dclass_struct * result_c); // -void ogre_rt_isInitialised(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_isInitialised(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_getRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_getRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_setRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, int r_c); +void ogre_rt_setRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, long r_c); // void ogre_rt_addSceneManagerFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c); @@ -91,7 +91,7 @@ void ogre_rt_destroySceneManager(struct hg3dclass_struct * thisclass_c, struct h void ogre_rt_getSceneManager(struct hg3dclass_struct * thisclass_c, char * instanceName_c, struct hg3dclass_struct * result_c); // -void ogre_rt_hasSceneManager(struct hg3dclass_struct * thisclass_c, char * instanceName_c, int * result_c); +void ogre_rt_hasSceneManager(struct hg3dclass_struct * thisclass_c, char * instanceName_c, long * result_c); // void ogre_rt_getTextureManager(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -100,7 +100,7 @@ void ogre_rt_getTextureManager(struct hg3dclass_struct * thisclass_c, struct hg3 void ogre_rt_getMeshManager(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_rt_getErrorDescription(struct hg3dclass_struct * thisclass_c, int errorNumber_c, char * result_c); +void ogre_rt_getErrorDescription(struct hg3dclass_struct * thisclass_c, long errorNumber_c, char * result_c); // void ogre_rt_queueEndRendering(struct hg3dclass_struct * thisclass_c); @@ -109,22 +109,22 @@ void ogre_rt_queueEndRendering(struct hg3dclass_struct * thisclass_c); void ogre_rt_startRendering(struct hg3dclass_struct * thisclass_c); // -void ogre_rt_renderOneFrame(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_renderOneFrame(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_renderOneFrame2(struct hg3dclass_struct * thisclass_c, float timeSinceLastFrame_c, int * result_c); +void ogre_rt_renderOneFrame2(struct hg3dclass_struct * thisclass_c, float timeSinceLastFrame_c, long * result_c); // void ogre_rt_shutdown(struct hg3dclass_struct * thisclass_c); // -void ogre_rt_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * groupName_c, int recursive_c); +void ogre_rt_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * groupName_c, long recursive_c); // void ogre_rt_removeResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * groupName_c); // -void ogre_rt_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned int * pDest_c); +void ogre_rt_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned long * pDest_c); // void ogre_rt_getAutoCreatedWindow(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -150,6 +150,9 @@ void ogre_rt_loadPlugin(struct hg3dclass_struct * thisclass_c, char * pluginName // void ogre_rt_unloadPlugin(struct hg3dclass_struct * thisclass_c, char * pluginName_c); +// +void ogre_rt_getNextFrameNumber(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); + // void ogre_rt_destroyRenderQueueInvocationSequence(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -166,31 +169,31 @@ void ogre_rt_setFrameSmoothingPeriod(struct hg3dclass_struct * thisclass_c, floa void ogre_rt_getFrameSmoothingPeriod(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_rt_addMovableObjectFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c, int overrideExisting_c); +void ogre_rt_addMovableObjectFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c, long overrideExisting_c); // void ogre_rt_removeMovableObjectFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c); // Checks whether a factory is registered for a given MovableObject -void ogre_rt_hasMovableObjectFactory(struct hg3dclass_struct * thisclass_c, char * typeName_c, int * result_c); +void ogre_rt_hasMovableObjectFactory(struct hg3dclass_struct * thisclass_c, char * typeName_c, long * result_c); // Get a MovableObjectFactory void ogre_rt_getMovableObjectFactory(struct hg3dclass_struct * thisclass_c, char * typeName_c, struct hg3dclass_struct * result_c); // -void ogre_rt_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rt_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_rt_setBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, int redundant_c); +void ogre_rt_setBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, long redundant_c); // -void ogre_rt_isBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_isBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_setBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, int redundant_c); +void ogre_rt_setBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, long redundant_c); // -void ogre_rt_isBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_isBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rt_setDefaultMinPixelSize(struct hg3dclass_struct * thisclass_c, float pixelSize_c); diff --git a/Bindings/Ogre/cBuild/include/ClassSceneManager.h b/Bindings/Ogre/cBuild/include/ClassSceneManager.h index 1155fde..7238f1a 100644 --- a/Bindings/Ogre/cBuild/include/ClassSceneManager.h +++ b/Bindings/Ogre/cBuild/include/ClassSceneManager.h @@ -61,7 +61,7 @@ void ogre_scmgr_createCamera(struct hg3dclass_struct * thisclass_c, char * name_ void ogre_scmgr_getCamera(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasCamera(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasCamera(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyCamera(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c); @@ -82,7 +82,7 @@ void ogre_scmgr_createLight2(struct hg3dclass_struct * thisclass_c, struct hg3dc void ogre_scmgr_getLight(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasLight(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasLight(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyLight(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -112,7 +112,7 @@ void ogre_scmgr_getRootSceneNode(struct hg3dclass_struct * thisclass_c, struct h void ogre_scmgr_getSceneNode(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasSceneNode(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasSceneNode(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_createEntity(struct hg3dclass_struct * thisclass_c, char * entityName_c, char * meshName_c, char * groupName_c, struct hg3dclass_struct * result_c); @@ -136,7 +136,7 @@ void ogre_scmgr_createEntity6(struct hg3dclass_struct * thisclass_c, enum EnumSc void ogre_scmgr_getEntity(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasEntity(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasEntity(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyEntity(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * ent_c); @@ -157,7 +157,7 @@ void ogre_scmgr_createManualObject2(struct hg3dclass_struct * thisclass_c, struc void ogre_scmgr_getManualObject(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasManualObject(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasManualObject(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyManualObject(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * obj_c); @@ -178,7 +178,7 @@ void ogre_scmgr_createBillboardChain2(struct hg3dclass_struct * thisclass_c, str void ogre_scmgr_getBillboardChain(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasBillboardChain(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasBillboardChain(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyBillboardChain(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * obj_c); @@ -190,7 +190,7 @@ void ogre_scmgr_destroyBillboardChain2(struct hg3dclass_struct * thisclass_c, ch void ogre_scmgr_destroyAllBillboardChains(struct hg3dclass_struct * thisclass_c); // -void ogre_scmgr_hasRibbonTrail(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasRibbonTrail(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyRibbonTrail2(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -199,7 +199,7 @@ void ogre_scmgr_destroyRibbonTrail2(struct hg3dclass_struct * thisclass_c, char void ogre_scmgr_destroyAllRibbonTrails(struct hg3dclass_struct * thisclass_c); // -void ogre_scmgr_hasParticleSystem(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasParticleSystem(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyParticleSystem2(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -223,40 +223,40 @@ void ogre_scmgr_prepareWorldGeometry(struct hg3dclass_struct * thisclass_c, char void ogre_scmgr_setWorldGeometry(struct hg3dclass_struct * thisclass_c, char * filename_c); // -void ogre_scmgr_estimateWorldGeometry(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c); +void ogre_scmgr_estimateWorldGeometry(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c); // -void ogre_scmgr_hasOption(struct hg3dclass_struct * thisclass_c, char * strKey_c, int * result_c); +void ogre_scmgr_hasOption(struct hg3dclass_struct * thisclass_c, char * strKey_c, long * result_c); // -void ogre_scmgr_setSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_scmgr_setSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_scmgr_isSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_getSkyPlaneNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_setSkyBox(struct hg3dclass_struct * thisclass_c, int enable_c, char * materialName_c, float distance_c, int drawFirst_c, struct quaternion_struct * orientation_c, char * groupName_c); +void ogre_scmgr_setSkyBox(struct hg3dclass_struct * thisclass_c, long enable_c, char * materialName_c, float distance_c, long drawFirst_c, struct quaternion_struct * orientation_c, char * groupName_c); // -void ogre_scmgr_setSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_scmgr_setSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_scmgr_isSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_getSkyBoxNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_setSkyDome(struct hg3dclass_struct * thisclass_c, int enable_c, char * materialName_c, float curvature_c, float tiling_c, float distance_c, int drawFirst_c, struct quaternion_struct * orientation_c, int xsegments_c, int ysegments_c, int ysegments_keep_c, char * groupName_c); +void ogre_scmgr_setSkyDome(struct hg3dclass_struct * thisclass_c, long enable_c, char * materialName_c, float curvature_c, float tiling_c, float distance_c, long drawFirst_c, struct quaternion_struct * orientation_c, long xsegments_c, long ysegments_c, long ysegments_keep_c, char * groupName_c); // -void ogre_scmgr_setSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_scmgr_setSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_scmgr_isSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_getSkyDomeNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -274,16 +274,16 @@ void ogre_scmgr_getFogEnd(struct hg3dclass_struct * thisclass_c, float * result_ void ogre_scmgr_getFogDensity(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_scmgr_createBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, unsigned int poolSize_c, struct hg3dclass_struct * result_c); +void ogre_scmgr_createBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, unsigned long poolSize_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_createBillboardSet2(struct hg3dclass_struct * thisclass_c, unsigned int poolSize_c, struct hg3dclass_struct * result_c); +void ogre_scmgr_createBillboardSet2(struct hg3dclass_struct * thisclass_c, unsigned long poolSize_c, struct hg3dclass_struct * result_c); // void ogre_scmgr_getBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyBillboardSet(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * set_c); @@ -295,10 +295,10 @@ void ogre_scmgr_destroyBillboardSet2(struct hg3dclass_struct * thisclass_c, char void ogre_scmgr_destroyAllBillboardSets(struct hg3dclass_struct * thisclass_c); // -void ogre_scmgr_setDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, int display_c); +void ogre_scmgr_setDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, long display_c); // -void ogre_scmgr_getDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_createAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, float length_c, struct hg3dclass_struct * result_c); @@ -307,7 +307,7 @@ void ogre_scmgr_createAnimation(struct hg3dclass_struct * thisclass_c, char * na void ogre_scmgr_getAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyAnimation(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -322,7 +322,7 @@ void ogre_scmgr_createAnimationState(struct hg3dclass_struct * thisclass_c, char void ogre_scmgr_getAnimationState(struct hg3dclass_struct * thisclass_c, char * animName_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -340,16 +340,16 @@ void ogre_scmgr_setSpecialCaseRenderQueueMode(struct hg3dclass_struct * thisclas void ogre_scmgr_getSpecialCaseRenderQueueMode(struct hg3dclass_struct * thisclass_c, enum EnumSceneManagerSpecialCaseRenderQueueMode * result_c); // -void ogre_scmgr_showBoundingBoxes(struct hg3dclass_struct * thisclass_c, int bShow_c); +void ogre_scmgr_showBoundingBoxes(struct hg3dclass_struct * thisclass_c, long bShow_c); // -void ogre_scmgr_getShowBoundingBoxes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShowBoundingBoxes(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setShowDebugShadows(struct hg3dclass_struct * thisclass_c, int debug_c); +void ogre_scmgr_setShowDebugShadows(struct hg3dclass_struct * thisclass_c, long debug_c); // -void ogre_scmgr_getShowDebugShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShowDebugShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_setShadowColour(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c); @@ -373,10 +373,10 @@ void ogre_scmgr_getShadowFarDistance(struct hg3dclass_struct * thisclass_c, floa void ogre_scmgr_getShadowFarDistanceSquared(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_scmgr_setShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, int size_c); +void ogre_scmgr_setShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, long size_c); // Get the size of the shadow index buffer. -void ogre_scmgr_getShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_setShadowTextureSize(struct hg3dclass_struct * thisclass_c, unsigned short size_c); @@ -385,19 +385,19 @@ void ogre_scmgr_setShadowTextureSize(struct hg3dclass_struct * thisclass_c, unsi void ogre_scmgr_setShadowTextureFSAA(struct hg3dclass_struct * thisclass_c, unsigned short fsaa_c); // -void ogre_scmgr_setShadowTextureCount(struct hg3dclass_struct * thisclass_c, int count_c); +void ogre_scmgr_setShadowTextureCount(struct hg3dclass_struct * thisclass_c, long count_c); // Get the number of the textures allocated for texture based shadows. -void ogre_scmgr_getShadowTextureCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowTextureCount(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, int count_c); +void ogre_scmgr_setShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, long count_c); // Get the number of shadow textures is assigned for the given light type. -void ogre_scmgr_getShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, int * result_c); +void ogre_scmgr_getShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, long * result_c); // -void ogre_scmgr_getShadowTexture(struct hg3dclass_struct * thisclass_c, int shadowIndex_c, struct sharedptr_struct * result_c); +void ogre_scmgr_getShadowTexture(struct hg3dclass_struct * thisclass_c, long shadowIndex_c, struct sharedptr_struct * result_c); // void ogre_scmgr_setShadowDirLightTextureOffset(struct hg3dclass_struct * thisclass_c, float offset_c); @@ -412,10 +412,10 @@ void ogre_scmgr_setShadowTextureFadeStart(struct hg3dclass_struct * thisclass_c, void ogre_scmgr_setShadowTextureFadeEnd(struct hg3dclass_struct * thisclass_c, float fadeEnd_c); // -void ogre_scmgr_setShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, int selfShadow_c); +void ogre_scmgr_setShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, long selfShadow_c); // Gets whether or not texture shadows attempt to self-shadow. -void ogre_scmgr_getShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_setShadowTextureCasterMaterial(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -424,46 +424,46 @@ void ogre_scmgr_setShadowTextureCasterMaterial(struct hg3dclass_struct * thiscla void ogre_scmgr_setShadowTextureReceiverMaterial(struct hg3dclass_struct * thisclass_c, char * name_c); // -void ogre_scmgr_setShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, int bf_c); +void ogre_scmgr_setShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, long bf_c); // -void ogre_scmgr_getShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setShadowUseInfiniteFarPlane(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_scmgr_setShadowUseInfiniteFarPlane(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_scmgr_isShadowTechniqueStencilBased(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueStencilBased(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueTextureBased(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueTextureBased(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueModulative(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueModulative(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueAdditive(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueAdditive(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueIntegrated(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueIntegrated(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueInUse(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueInUse(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_scmgr_setShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_scmgr_getShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setLateMaterialResolving(struct hg3dclass_struct * thisclass_c, int isLate_c); +void ogre_scmgr_setLateMaterialResolving(struct hg3dclass_struct * thisclass_c, long isLate_c); // -void ogre_scmgr_isLateMaterialResolving(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isLateMaterialResolving(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_hasStaticGeometry(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasStaticGeometry(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyStaticGeometry2(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -478,7 +478,7 @@ void ogre_scmgr_destroyInstancedGeometry2(struct hg3dclass_struct * thisclass_c, void ogre_scmgr_destroyAllInstancedGeometry(struct hg3dclass_struct * thisclass_c); // -void ogre_scmgr_hasInstanceManager(struct hg3dclass_struct * thisclass_c, char * managerName_c, int * result_c); +void ogre_scmgr_hasInstanceManager(struct hg3dclass_struct * thisclass_c, char * managerName_c, long * result_c); // void ogre_scmgr_destroyInstanceManager(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -502,7 +502,7 @@ void ogre_scmgr_destroyAllMovableObjects(struct hg3dclass_struct * thisclass_c); void ogre_scmgr_getMovableObject(struct hg3dclass_struct * thisclass_c, char * name_c, char * typeName_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasMovableObject(struct hg3dclass_struct * thisclass_c, char * name_c, char * typeName_c, int * result_c); +void ogre_scmgr_hasMovableObject(struct hg3dclass_struct * thisclass_c, char * name_c, char * typeName_c, long * result_c); // void ogre_scmgr_injectMovableObject(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * m_c); @@ -517,28 +517,28 @@ void ogre_scmgr_extractMovableObject2(struct hg3dclass_struct * thisclass_c, str void ogre_scmgr_extractAllMovableObjectsByType(struct hg3dclass_struct * thisclass_c, char * typeName_c); // -void ogre_scmgr_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int vmask_c); +void ogre_scmgr_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long vmask_c); // -void ogre_scmgr_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_scmgr_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_scmgr_setFindVisibleObjects(struct hg3dclass_struct * thisclass_c, int find_c); +void ogre_scmgr_setFindVisibleObjects(struct hg3dclass_struct * thisclass_c, long find_c); // -void ogre_scmgr_getFindVisibleObjects(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getFindVisibleObjects(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, int n_c); +void ogre_scmgr_setNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, long n_c); // -void ogre_scmgr_getNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, int n_c); +void ogre_scmgr_setFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, long n_c); // -void ogre_scmgr_getFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_getDestinationRenderSystem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -547,9 +547,9 @@ void ogre_scmgr_getDestinationRenderSystem(struct hg3dclass_struct * thisclass_c void ogre_scmgr_getCurrentViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_setCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, int rel_c); +void ogre_scmgr_setCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, long rel_c); // -void ogre_scmgr_getCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassSceneNode.h b/Bindings/Ogre/cBuild/include/ClassSceneNode.h index e3c1459..9a05d58 100644 --- a/Bindings/Ogre/cBuild/include/ClassSceneNode.h +++ b/Bindings/Ogre/cBuild/include/ClassSceneNode.h @@ -59,7 +59,7 @@ void ogre_sn_detachObject3(struct hg3dclass_struct * thisclass_c, char * name_c, void ogre_sn_detachAllObjects(struct hg3dclass_struct * thisclass_c); // -void ogre_sn_isInSceneGraph(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_sn_isInSceneGraph(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_sn_getCreator(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -74,13 +74,13 @@ void ogre_sn_removeAndDestroyChild2(struct hg3dclass_struct * thisclass_c, unsig void ogre_sn_removeAndDestroyAllChildren(struct hg3dclass_struct * thisclass_c); // -void ogre_sn_showBoundingBox(struct hg3dclass_struct * thisclass_c, int bShow_c); +void ogre_sn_showBoundingBox(struct hg3dclass_struct * thisclass_c, long bShow_c); // -void ogre_sn_hideBoundingBox(struct hg3dclass_struct * thisclass_c, int bHide_c); +void ogre_sn_hideBoundingBox(struct hg3dclass_struct * thisclass_c, long bHide_c); // -void ogre_sn_getShowBoundingBox(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_sn_getShowBoundingBox(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_sn_createChildSceneNode(struct hg3dclass_struct * thisclass_c, struct vector3_struct * translate_c, struct quaternion_struct * rotate_c, struct hg3dclass_struct * result_c); @@ -89,7 +89,7 @@ void ogre_sn_createChildSceneNode(struct hg3dclass_struct * thisclass_c, struct void ogre_sn_createChildSceneNode2(struct hg3dclass_struct * thisclass_c, char * name_c, struct vector3_struct * translate_c, struct quaternion_struct * rotate_c, struct hg3dclass_struct * result_c); // -void ogre_sn_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, int useFixed_c, struct vector3_struct * fixedAxis_c); +void ogre_sn_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, long useFixed_c, struct vector3_struct * fixedAxis_c); // void ogre_sn_getAutoTrackTarget(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -104,12 +104,12 @@ void ogre_sn_getAutoTrackLocalDirection(struct hg3dclass_struct * thisclass_c, s void ogre_sn_getParentSceneNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_sn_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c, int cascade_c); +void ogre_sn_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c, long cascade_c); // -void ogre_sn_flipVisibility(struct hg3dclass_struct * thisclass_c, int cascade_c); +void ogre_sn_flipVisibility(struct hg3dclass_struct * thisclass_c, long cascade_c); // -void ogre_sn_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c, int cascade_c); +void ogre_sn_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c, long cascade_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassSkeleton.h b/Bindings/Ogre/cBuild/include/ClassSkeleton.h index 869684a..1501306 100644 --- a/Bindings/Ogre/cBuild/include/ClassSkeleton.h +++ b/Bindings/Ogre/cBuild/include/ClassSkeleton.h @@ -59,13 +59,13 @@ void ogre_skl_getBone(struct hg3dclass_struct * thisclass_c, unsigned short hand void ogre_skl_getBone2(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_skl_hasBone(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_skl_hasBone(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_skl_setBindingPose(struct hg3dclass_struct * thisclass_c); // -void ogre_skl_reset(struct hg3dclass_struct * thisclass_c, int resetManualBones_c); +void ogre_skl_reset(struct hg3dclass_struct * thisclass_c, long resetManualBones_c); // void ogre_skl_createAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, float length_c, struct hg3dclass_struct * result_c); @@ -74,7 +74,7 @@ void ogre_skl_createAnimation(struct hg3dclass_struct * thisclass_c, char * name void ogre_skl_getAnimation2(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_skl_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_skl_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_skl_removeAnimation(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -95,7 +95,7 @@ void ogre_skl_getBlendMode(struct hg3dclass_struct * thisclass_c, enum EnumSkele void ogre_skl_setBlendMode(struct hg3dclass_struct * thisclass_c, enum EnumSkeletonAnimationBlendMode state_c); // -void ogre_skl_optimiseAllAnimations(struct hg3dclass_struct * thisclass_c, int preservingIdentityNodeTracks_c); +void ogre_skl_optimiseAllAnimations(struct hg3dclass_struct * thisclass_c, long preservingIdentityNodeTracks_c); // void ogre_skl_addLinkedSkeletonAnimationSource(struct hg3dclass_struct * thisclass_c, char * skelName_c, float scale_c); @@ -104,9 +104,9 @@ void ogre_skl_addLinkedSkeletonAnimationSource(struct hg3dclass_struct * thiscla void ogre_skl_removeAllLinkedSkeletonAnimationSources(struct hg3dclass_struct * thisclass_c); // Have manual bones been modified since the skeleton was last updated? -void ogre_skl_getManualBonesDirty(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_skl_getManualBonesDirty(struct hg3dclass_struct * thisclass_c, long * result_c); // Are there any manually controlled bones? -void ogre_skl_hasManualBones(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_skl_hasManualBones(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassTextureManager.h b/Bindings/Ogre/cBuild/include/ClassTextureManager.h index ebf0ddf..98258ed 100644 --- a/Bindings/Ogre/cBuild/include/ClassTextureManager.h +++ b/Bindings/Ogre/cBuild/include/ClassTextureManager.h @@ -31,10 +31,10 @@ void ogre_txmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_txmgr_setDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, int num_c); +void ogre_txmgr_setDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, long num_c); // -void ogre_txmgr_getDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_txmgr_getDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_txmgr_getSingleton(struct hg3dclass_struct * result_c); diff --git a/Bindings/Ogre/cBuild/include/ClassTimeIndex.h b/Bindings/Ogre/cBuild/include/ClassTimeIndex.h index 539b087..b46eece 100644 --- a/Bindings/Ogre/cBuild/include/ClassTimeIndex.h +++ b/Bindings/Ogre/cBuild/include/ClassTimeIndex.h @@ -31,12 +31,12 @@ void ogre_tnx_construct(float timePos_c, struct hg3dclass_struct * result_c); // -void ogre_tnx_hasKeyIndex(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_tnx_hasKeyIndex(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_tnx_getTimePos(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_tnx_getKeyIndex(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_tnx_getKeyIndex(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); #endif diff --git a/Bindings/Ogre/cBuild/include/ClassVertexAnimationTrack.h b/Bindings/Ogre/cBuild/include/ClassVertexAnimationTrack.h index 0a58838..11e5fa4 100644 --- a/Bindings/Ogre/cBuild/include/ClassVertexAnimationTrack.h +++ b/Bindings/Ogre/cBuild/include/ClassVertexAnimationTrack.h @@ -38,7 +38,7 @@ void ogre_vat_construct(struct hg3dclass_struct * parent_c, unsigned short handl void ogre_vat_getAnimationType(struct hg3dclass_struct * thisclass_c, enum EnumVertexAnimationType * result_c); // -void ogre_vat_getVertexAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vat_getVertexAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vat_apply(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * timeIndex_c, float weight_c, float scale_c); @@ -50,7 +50,7 @@ void ogre_vat_setTargetMode(struct hg3dclass_struct * thisclass_c, enum EnumVert void ogre_vat_getTargetMode(struct hg3dclass_struct * thisclass_c, enum EnumVertexAnimationTrackTargetMode * result_c); // -void ogre_vat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vat_optimise(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/cBuild/include/ClassViewport.h b/Bindings/Ogre/cBuild/include/ClassViewport.h index 0e0b856..0fca961 100644 --- a/Bindings/Ogre/cBuild/include/ClassViewport.h +++ b/Bindings/Ogre/cBuild/include/ClassViewport.h @@ -33,7 +33,7 @@ // -void ogre_vprt_construct(struct hg3dclass_struct * camera_c, struct hg3dclass_struct * target_c, float left_c, float top_c, float width_c, float height_c, int ZOrder_c, struct hg3dclass_struct * result_c); +void ogre_vprt_construct(struct hg3dclass_struct * camera_c, struct hg3dclass_struct * target_c, float left_c, float top_c, float width_c, float height_c, long ZOrder_c, struct hg3dclass_struct * result_c); // void ogre_vprt_destruct(struct hg3dclass_struct * thisclass_c); @@ -42,7 +42,7 @@ void ogre_vprt_destruct(struct hg3dclass_struct * thisclass_c); void ogre_vprt_update(struct hg3dclass_struct * thisclass_c); // -void ogre_vprt_clear(struct hg3dclass_struct * thisclass_c, unsigned int buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c); +void ogre_vprt_clear(struct hg3dclass_struct * thisclass_c, unsigned long buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c); // void ogre_vprt_getTarget(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -54,7 +54,7 @@ void ogre_vprt_getCamera(struct hg3dclass_struct * thisclass_c, struct hg3dclass void ogre_vprt_setCamera(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c); // -void ogre_vprt_getZOrder(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getZOrder(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vprt_getLeft(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -69,22 +69,22 @@ void ogre_vprt_getWidth(struct hg3dclass_struct * thisclass_c, float * result_c) void ogre_vprt_getHeight(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_vprt_getActualLeft(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getActualLeft(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_getActualTop(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getActualTop(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_getActualWidth(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getActualWidth(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_getActualHeight(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getActualHeight(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vprt_setDimensions(struct hg3dclass_struct * thisclass_c, float left_c, float top_c, float width_c, float height_c); // -void ogre_vprt_setOrientationMode(struct hg3dclass_struct * thisclass_c, enum EnumOrientationMode orientationMode_c, int setDefault_c); +void ogre_vprt_setOrientationMode(struct hg3dclass_struct * thisclass_c, enum EnumOrientationMode orientationMode_c, long setDefault_c); // void ogre_vprt_getOrientationMode(struct hg3dclass_struct * thisclass_c, enum EnumOrientationMode * result_c); @@ -102,19 +102,19 @@ void ogre_vprt_setDepthClear(struct hg3dclass_struct * thisclass_c, float depth_ void ogre_vprt_getDepthClear(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_vprt_setClearEveryFrame(struct hg3dclass_struct * thisclass_c, int clear_c, unsigned int buffers_c); +void ogre_vprt_setClearEveryFrame(struct hg3dclass_struct * thisclass_c, long clear_c, unsigned long buffers_c); // -void ogre_vprt_getClearEveryFrame(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getClearEveryFrame(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_getClearBuffers(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_vprt_getClearBuffers(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_vprt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, int autoupdate_c); +void ogre_vprt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, long autoupdate_c); // -void ogre_vprt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vprt_setMaterialScheme(struct hg3dclass_struct * thisclass_c, char * schemeName_c); @@ -123,31 +123,31 @@ void ogre_vprt_setMaterialScheme(struct hg3dclass_struct * thisclass_c, char * s void ogre_vprt_getMaterialScheme(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_vprt_getActualDimensions(struct hg3dclass_struct * thisclass_c, int * left_c, int * top_c, int * width_c, int * height_c); +void ogre_vprt_getActualDimensions(struct hg3dclass_struct * thisclass_c, long * left_c, long * top_c, long * width_c, long * height_c); // -void ogre_vprt_setOverlaysEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_vprt_setOverlaysEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_vprt_getOverlaysEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getOverlaysEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_setSkiesEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_vprt_setSkiesEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_vprt_getSkiesEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getSkiesEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_setShadowsEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_vprt_setShadowsEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_vprt_getShadowsEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getShadowsEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int mask_c); +void ogre_vprt_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long mask_c); // -void ogre_vprt_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_vprt_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_vprt_setRenderQueueInvocationSequenceName(struct hg3dclass_struct * thisclass_c, char * sequenceName_c); @@ -156,10 +156,10 @@ void ogre_vprt_setRenderQueueInvocationSequenceName(struct hg3dclass_struct * th void ogre_vprt_getRenderQueueInvocationSequenceName(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_vprt_pointOrientedToScreen(struct hg3dclass_struct * thisclass_c, struct vector2_struct * v_c, int orientationMode_c, struct vector2_struct * outv_c); +void ogre_vprt_pointOrientedToScreen(struct hg3dclass_struct * thisclass_c, struct vector2_struct * v_c, long orientationMode_c, struct vector2_struct * outv_c); // -void ogre_vprt_pointOrientedToScreen2(struct hg3dclass_struct * thisclass_c, float orientedX_c, float orientedY_c, int orientationMode_c, float * screenX_c, float * screenY_c); +void ogre_vprt_pointOrientedToScreen2(struct hg3dclass_struct * thisclass_c, float orientedX_c, float orientedY_c, long orientationMode_c, float * screenX_c, float * screenY_c); // void ogre_vprt_setDefaultOrientationMode(enum EnumOrientationMode orientationMode_c); diff --git a/Bindings/Ogre/cBuild/include/HG3DUtilities.h b/Bindings/Ogre/cBuild/include/HG3DUtilities.h index 4374dcc..273cd61 100644 --- a/Bindings/Ogre/cBuild/include/HG3DUtilities.h +++ b/Bindings/Ogre/cBuild/include/HG3DUtilities.h @@ -23,7 +23,7 @@ limitations under the License. class HG3DUtilities { public: - static unsigned int getWindowHandle(Ogre::RenderWindow *window); + static unsigned long getWindowHandle(Ogre::RenderWindow *window); static void setupCloseEventHandler(Ogre::RenderWindow *window); static int checkQuitReceived(); static void buildTangentVectors(Ogre::Entity *entity); diff --git a/Bindings/Ogre/cBuild/include/OgreDllDefines.h b/Bindings/Ogre/cBuild/include/OgreDllDefines.h index 94d8c92..c4b79df 100644 --- a/Bindings/Ogre/cBuild/include/OgreDllDefines.h +++ b/Bindings/Ogre/cBuild/include/OgreDllDefines.h @@ -16,10 +16,10 @@ // OgreDllDefines.h -#ifndef _HGamer3DOgre032_DLLDEFINES_H_ -#define _HGamer3DOgre032_DLLDEFINES_H_ +#ifndef _HGamer3DOgre040_DLLDEFINES_H_ +#define _HGamer3DOgre040_DLLDEFINES_H_ -/* Cmake will define HGamer3DOgre032_EXPORTS on Windows when it +/* Cmake will define HGamer3DOgre040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DOgre032_EXPORTS) + #if defined(HGamer3DOgre040_EXPORTS) #define Ogre_LIB_EXPORT __declspec(dllexport) #else #define Ogre_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DOgre032_EXPORTS */ + #endif /* HGamer3DOgre040_EXPORTS */ #else /* defined (_WIN32) */ #define Ogre_LIB_EXPORT #endif -#endif /* _HGamer3DOgre032_DLLDEFINES_H_ */ +#endif /* _HGamer3DOgre040_DLLDEFINES_H_ */ diff --git a/Bindings/Ogre/hBuild/HGamer3D-Ogre-Binding.cabal b/Bindings/Ogre/hBuild/HGamer3D-Ogre-Binding.cabal index 9415035..099895b 100644 --- a/Bindings/Ogre/hBuild/HGamer3D-Ogre-Binding.cabal +++ b/Bindings/Ogre/hBuild/HGamer3D-Ogre-Binding.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-Ogre-Binding -Version: 0.3.2 +Version: 0.4.0 Synopsis: Ogre Binding for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,12 +18,12 @@ Build-Type: Simple Cabal-Version: >=1.4 Homepage: http://www.hgamer3d.org Category: Game Engine, Graphics -Extra-source-files: Setup.hs, include/EnumAnimationRotationInterpolationMode.h, include/WindowUtilsHG3D.h, include/ClassTimeIndex.h, include/EnumSceneManagerIlluminationRenderStage.h, include/ClassSkeleton.h, include/ClassArchive.h, include/StructHG3DClass.h, include/EnumRenderTargetFrameBuffer.h, include/ClassBillboardSet.h, include/EnumSkeletonAnimationBlendMode.h, include/StructDegrees.h, include/EnumSceneType.h, include/HG3DUtilities.h, include/EnumAxisAlignedBoxCorner.h, include/ClassBillboardSetFactory.h, include/ClassBillboardChainFactory.h, include/EnumOrientationMode.h, include/ClassManualObject.h, include/ClassVertexAnimationTrack.h, include/EnumRootFrameEventTimeType.h, include/quaternion_struct.h, include/EnumRenderOperationOperationType.h, include/ClassManualObjectSection.h, include/StructColour.h, include/ClassResourceGroupManager.h, include/ClassNumericAnimationTrack.h, include/StructVec3.h, include/ClassException.h, include/StructVec2.h, include/ClassTextureManager.h, include/ClassBillboardChain.h, include/EnumSceneManagerPrefabType.h, include/sharedptr_struct.h, include/ClassMaterialManager.h, include/EnumSceneManagerSpecialCaseRenderQueueMode.h, include/radian_struct.h, include/ClassLight.h, include/ClassAnimationState.h, include/ClassMovableObject.h, include/ClassBone.h, include/ClassAnimation.h, include/vector2_struct.h, include/ClassRenderTarget.h, include/ClassRenderTexture.h, include/EnumTexCoordCalcMethod.h, include/StructSharedPtr.h, include/ClassRenderSystem.h, include/EnumDataStreamAccessMode.h, include/EnumAnimationInterpolationMode.h, include/ClassMesh.h, include/ClassSceneManager.h, include/EnumGpuProgramType.h, include/ClassRenderable.h, include/ClassNode.h, include/ClassMultiRenderTarget.h, include/EnumLogMessageLevel.h, include/ClassEntityFactory.h, include/ClassAnimationStateSet.h, include/EnumNodeTransformSpace.h, include/ClassSceneManagerFactory.h, include/EnumBillboardRotationType.h, include/EnumProjectionType.h, include/ClassArchiveManager.h, include/EnumMathAngleUnit.h, include/ClassSkeletonManager.h, include/EnumFrustumPlane.h, include/EnumVertexAnimationType.h, include/EnumLoggingLevel.h, include/EnumStencilOperation.h, include/ClassSceneNode.h, include/ClassControllerManager.h, include/ClassManualObjectFactory.h, include/ClassResource.h, include/OgreDllDefines.h, include/ClassLightFactory.h, include/ClassBillboard.h, include/ClassResourceManager.h, include/EnumBillboardOrigin.h, include/StructQuaternion.h, include/ClassFrustum.h, include/ClassNodeAnimationTrack.h, include/EnumBillboardChainTexCoordDirection.h, include/EnumSceneManagerBoxPlane.h, include/ClassEntity.h, include/EnumAxisAlignedBoxExtent.h, include/ClassWindowEventUtilities.h, include/ClassConfigFile.h, include/EnumEntityVertexDataBindChoice.h, include/EnumRenderTargetStatFlags.h, include/vector4_struct.h, include/EnumBillboardType.h, include/ClassLogManager.h, include/ClassPtr.h, include/StructRadians.h, include/EnumVertexAnimationTrackTargetMode.h, include/ClassCamera.h, include/ClassHG3DUtilities.h, include/ClassRoot.h, include/hg3dstruct.h, include/vector3_struct.h, include/ClassMovableObjectFactory.h, include/EnumExceptionCode.h, include/colorvalue_struct.h, include/ClassViewport.h, include/ClassAnimationTrack.h, include/ClassRenderWindow.h, include/EnumMeshManagerMeshBuildType.h, include/ClassMaterial.h, include/ClassLog.h, include/EnumLightType.h, include/degree_struct.h, include/ClassMeshManager.h +Extra-source-files: Setup.hs, include/EnumFrustumPlane.h, include/colorvalue_struct.h, include/StructHG3DClass.h, include/EnumBillboardOrigin.h, include/EnumProjectionType.h, include/ClassTimeIndex.h, include/hg3dstruct.h, include/EnumSkeletonAnimationBlendMode.h, include/StructVec3.h, include/EnumStencilOperation.h, include/ClassEntityFactory.h, include/EnumRenderTargetFrameBuffer.h, include/WindowUtilsHG3D.h, include/vector4_struct.h, include/ClassMaterial.h, include/ClassAnimationTrack.h, include/ClassNode.h, include/ClassMultiRenderTarget.h, include/ClassAnimation.h, include/ClassResourceManager.h, include/ClassEntity.h, include/ClassNumericAnimationTrack.h, include/ClassNodeAnimationTrack.h, include/ClassLogManager.h, include/radian_struct.h, include/EnumMeshManagerMeshBuildType.h, include/EnumGpuProgramType.h, include/ClassSceneNode.h, include/ClassMeshManager.h, include/EnumSceneManagerBoxPlane.h, include/EnumTexCoordCalcMethod.h, include/ClassManualObjectFactory.h, include/EnumSceneType.h, include/ClassMesh.h, include/ClassLog.h, include/ClassManualObject.h, include/vector2_struct.h, include/EnumRootFrameEventTimeType.h, include/ClassControllerManager.h, include/EnumEntityVertexDataBindChoice.h, include/EnumLogMessageLevel.h, include/EnumAnimationInterpolationMode.h, include/EnumBillboardChainTexCoordDirection.h, include/StructRadians.h, include/StructVec2.h, include/ClassManualObjectSection.h, include/EnumExceptionCode.h, include/sharedptr_struct.h, include/EnumRenderTargetStatFlags.h, include/EnumSceneManagerIlluminationRenderStage.h, include/ClassBillboard.h, include/EnumNodeTransformSpace.h, include/ClassBillboardSetFactory.h, include/ClassBillboardChain.h, include/ClassAnimationStateSet.h, include/ClassFrustum.h, include/ClassHG3DUtilities.h, include/ClassViewport.h, include/ClassBone.h, include/ClassBillboardSet.h, include/ClassArchiveManager.h, include/ClassPtr.h, include/ClassRenderSystem.h, include/ClassVertexAnimationTrack.h, include/ClassRoot.h, include/EnumAxisAlignedBoxExtent.h, include/ClassMovableObjectFactory.h, include/EnumLightType.h, include/EnumRenderOperationOperationType.h, include/ClassResourceGroupManager.h, include/EnumBillboardRotationType.h, include/ClassMovableObject.h, include/ClassRenderWindow.h, include/StructColour.h, include/quaternion_struct.h, include/EnumVertexAnimationType.h, include/ClassLightFactory.h, include/EnumLoggingLevel.h, include/ClassSceneManager.h, include/EnumAxisAlignedBoxCorner.h, include/StructQuaternion.h, include/ClassMaterialManager.h, include/ClassAnimationState.h, include/ClassCamera.h, include/ClassArchive.h, include/ClassSkeleton.h, include/vector3_struct.h, include/EnumDataStreamAccessMode.h, include/ClassConfigFile.h, include/StructDegrees.h, include/ClassRenderTarget.h, include/ClassLight.h, include/ClassSceneManagerFactory.h, include/EnumOrientationMode.h, include/ClassResource.h, include/OgreDllDefines.h, include/EnumBillboardType.h, include/ClassWindowEventUtilities.h, include/StructSharedPtr.h, include/ClassRenderTexture.h, include/ClassTextureManager.h, include/ClassException.h, include/ClassBillboardChainFactory.h, include/EnumAnimationRotationInterpolationMode.h, include/EnumMathAngleUnit.h, include/ClassRenderable.h, include/degree_struct.h, include/EnumSceneManagerSpecialCaseRenderQueueMode.h, include/EnumSceneManagerPrefabType.h, include/HG3DUtilities.h, include/ClassSkeletonManager.h, include/EnumVertexAnimationTrackTargetMode.h Library Build-Depends: base >= 3 && < 5, transformers>=0.3.0,mtl, HGamer3D-Data >= 0.3.0 - Exposed-modules: HGamer3D.Bindings.Ogre.Utils, HGamer3D.Bindings.Ogre.StructHG3DClass, HGamer3D.Bindings.Ogre.ClassPtr, HGamer3D.Bindings.Ogre.EnumSceneType, HGamer3D.Bindings.Ogre.EnumProjectionType, HGamer3D.Bindings.Ogre.EnumEntityVertexDataBindChoice, HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType, HGamer3D.Bindings.Ogre.EnumAxisAlignedBoxCorner, HGamer3D.Bindings.Ogre.EnumMeshManagerMeshBuildType, HGamer3D.Bindings.Ogre.EnumAnimationInterpolationMode, HGamer3D.Bindings.Ogre.EnumSceneManagerBoxPlane, HGamer3D.Bindings.Ogre.EnumLogMessageLevel, HGamer3D.Bindings.Ogre.EnumAxisAlignedBoxExtent, HGamer3D.Bindings.Ogre.EnumSceneManagerIlluminationRenderStage, HGamer3D.Bindings.Ogre.EnumGpuProgramType, HGamer3D.Bindings.Ogre.EnumVertexAnimationType, HGamer3D.Bindings.Ogre.EnumBillboardType, HGamer3D.Bindings.Ogre.EnumStencilOperation, HGamer3D.Bindings.Ogre.EnumRenderTargetFrameBuffer, HGamer3D.Bindings.Ogre.EnumMathAngleUnit, HGamer3D.Bindings.Ogre.EnumLoggingLevel, HGamer3D.Bindings.Ogre.EnumSceneManagerSpecialCaseRenderQueueMode, HGamer3D.Bindings.Ogre.EnumSkeletonAnimationBlendMode, HGamer3D.Bindings.Ogre.EnumRootFrameEventTimeType, HGamer3D.Bindings.Ogre.EnumBillboardRotationType, HGamer3D.Bindings.Ogre.EnumAnimationRotationInterpolationMode, HGamer3D.Bindings.Ogre.EnumDataStreamAccessMode, HGamer3D.Bindings.Ogre.EnumRenderOperationOperationType, HGamer3D.Bindings.Ogre.EnumRenderTargetStatFlags, HGamer3D.Bindings.Ogre.EnumVertexAnimationTrackTargetMode, HGamer3D.Bindings.Ogre.EnumNodeTransformSpace, HGamer3D.Bindings.Ogre.EnumFrustumPlane, HGamer3D.Bindings.Ogre.EnumBillboardChainTexCoordDirection, HGamer3D.Bindings.Ogre.EnumTexCoordCalcMethod, HGamer3D.Bindings.Ogre.EnumBillboardOrigin, HGamer3D.Bindings.Ogre.EnumOrientationMode, HGamer3D.Bindings.Ogre.EnumExceptionCode, HGamer3D.Bindings.Ogre.EnumLightType, HGamer3D.Bindings.Ogre.StructVec2, HGamer3D.Bindings.Ogre.StructRadians, HGamer3D.Bindings.Ogre.StructDegrees, HGamer3D.Bindings.Ogre.StructSharedPtr, HGamer3D.Bindings.Ogre.StructVec3, HGamer3D.Bindings.Ogre.StructColour, HGamer3D.Bindings.Ogre.StructQuaternion, HGamer3D.Bindings.Ogre.ClassSceneManager, HGamer3D.Bindings.Ogre.ClassTimeIndex, HGamer3D.Bindings.Ogre.ClassMaterial, HGamer3D.Bindings.Ogre.ClassSkeleton, HGamer3D.Bindings.Ogre.ClassBillboard, HGamer3D.Bindings.Ogre.ClassMaterialManager, HGamer3D.Bindings.Ogre.ClassAnimationTrack, HGamer3D.Bindings.Ogre.ClassControllerManager, HGamer3D.Bindings.Ogre.ClassSkeletonManager, HGamer3D.Bindings.Ogre.ClassLog, HGamer3D.Bindings.Ogre.ClassArchive, HGamer3D.Bindings.Ogre.ClassBillboardChain, HGamer3D.Bindings.Ogre.ClassCamera, HGamer3D.Bindings.Ogre.ClassMultiRenderTarget, HGamer3D.Bindings.Ogre.ClassResourceGroupManager, HGamer3D.Bindings.Ogre.ClassNumericAnimationTrack, HGamer3D.Bindings.Ogre.ClassBone, HGamer3D.Bindings.Ogre.ClassViewport, HGamer3D.Bindings.Ogre.ClassSceneManagerFactory, HGamer3D.Bindings.Ogre.ClassResource, HGamer3D.Bindings.Ogre.ClassRenderTexture, HGamer3D.Bindings.Ogre.ClassLightFactory, HGamer3D.Bindings.Ogre.ClassRenderable, HGamer3D.Bindings.Ogre.ClassEntity, HGamer3D.Bindings.Ogre.ClassWindowEventUtilities, HGamer3D.Bindings.Ogre.ClassAnimationState, HGamer3D.Bindings.Ogre.ClassRenderSystem, HGamer3D.Bindings.Ogre.ClassRenderWindow, HGamer3D.Bindings.Ogre.ClassAnimationStateSet, HGamer3D.Bindings.Ogre.ClassSceneNode, HGamer3D.Bindings.Ogre.ClassResourceManager, HGamer3D.Bindings.Ogre.ClassMovableObject, HGamer3D.Bindings.Ogre.ClassConfigFile, HGamer3D.Bindings.Ogre.ClassTextureManager, HGamer3D.Bindings.Ogre.ClassRoot, HGamer3D.Bindings.Ogre.ClassManualObjectSection, HGamer3D.Bindings.Ogre.ClassRenderTarget, HGamer3D.Bindings.Ogre.ClassAnimation, HGamer3D.Bindings.Ogre.ClassVertexAnimationTrack, HGamer3D.Bindings.Ogre.ClassHG3DUtilities, HGamer3D.Bindings.Ogre.ClassLight, HGamer3D.Bindings.Ogre.ClassBillboardSetFactory, HGamer3D.Bindings.Ogre.ClassEntityFactory, HGamer3D.Bindings.Ogre.ClassBillboardChainFactory, HGamer3D.Bindings.Ogre.ClassException, HGamer3D.Bindings.Ogre.ClassArchiveManager, HGamer3D.Bindings.Ogre.ClassManualObjectFactory, HGamer3D.Bindings.Ogre.ClassManualObject, HGamer3D.Bindings.Ogre.ClassMesh, HGamer3D.Bindings.Ogre.ClassNodeAnimationTrack, HGamer3D.Bindings.Ogre.ClassBillboardSet, HGamer3D.Bindings.Ogre.ClassMeshManager, HGamer3D.Bindings.Ogre.ClassFrustum, HGamer3D.Bindings.Ogre.ClassMovableObjectFactory, HGamer3D.Bindings.Ogre.ClassNode, HGamer3D.Bindings.Ogre.ClassLogManager + Exposed-modules: HGamer3D.Bindings.Ogre.Utils, HGamer3D.Bindings.Ogre.StructHG3DClass, HGamer3D.Bindings.Ogre.ClassPtr, HGamer3D.Bindings.Ogre.EnumRootFrameEventTimeType, HGamer3D.Bindings.Ogre.EnumLoggingLevel, HGamer3D.Bindings.Ogre.EnumRenderTargetFrameBuffer, HGamer3D.Bindings.Ogre.EnumMathAngleUnit, HGamer3D.Bindings.Ogre.EnumSceneType, HGamer3D.Bindings.Ogre.EnumAnimationRotationInterpolationMode, HGamer3D.Bindings.Ogre.EnumSceneManagerSpecialCaseRenderQueueMode, HGamer3D.Bindings.Ogre.EnumTexCoordCalcMethod, HGamer3D.Bindings.Ogre.EnumNodeTransformSpace, HGamer3D.Bindings.Ogre.EnumLightType, HGamer3D.Bindings.Ogre.EnumBillboardOrigin, HGamer3D.Bindings.Ogre.EnumRenderOperationOperationType, HGamer3D.Bindings.Ogre.EnumBillboardRotationType, HGamer3D.Bindings.Ogre.EnumVertexAnimationTrackTargetMode, HGamer3D.Bindings.Ogre.EnumSceneManagerBoxPlane, HGamer3D.Bindings.Ogre.EnumSkeletonAnimationBlendMode, HGamer3D.Bindings.Ogre.EnumBillboardChainTexCoordDirection, HGamer3D.Bindings.Ogre.EnumFrustumPlane, HGamer3D.Bindings.Ogre.EnumDataStreamAccessMode, HGamer3D.Bindings.Ogre.EnumStencilOperation, HGamer3D.Bindings.Ogre.EnumProjectionType, HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType, HGamer3D.Bindings.Ogre.EnumBillboardType, HGamer3D.Bindings.Ogre.EnumLogMessageLevel, HGamer3D.Bindings.Ogre.EnumEntityVertexDataBindChoice, HGamer3D.Bindings.Ogre.EnumAxisAlignedBoxExtent, HGamer3D.Bindings.Ogre.EnumAxisAlignedBoxCorner, HGamer3D.Bindings.Ogre.EnumGpuProgramType, HGamer3D.Bindings.Ogre.EnumRenderTargetStatFlags, HGamer3D.Bindings.Ogre.EnumExceptionCode, HGamer3D.Bindings.Ogre.EnumMeshManagerMeshBuildType, HGamer3D.Bindings.Ogre.EnumSceneManagerIlluminationRenderStage, HGamer3D.Bindings.Ogre.EnumOrientationMode, HGamer3D.Bindings.Ogre.EnumVertexAnimationType, HGamer3D.Bindings.Ogre.EnumAnimationInterpolationMode, HGamer3D.Bindings.Ogre.StructVec3, HGamer3D.Bindings.Ogre.StructQuaternion, HGamer3D.Bindings.Ogre.StructDegrees, HGamer3D.Bindings.Ogre.StructColour, HGamer3D.Bindings.Ogre.StructRadians, HGamer3D.Bindings.Ogre.StructVec2, HGamer3D.Bindings.Ogre.StructSharedPtr, HGamer3D.Bindings.Ogre.ClassHG3DUtilities, HGamer3D.Bindings.Ogre.ClassBone, HGamer3D.Bindings.Ogre.ClassMesh, HGamer3D.Bindings.Ogre.ClassLightFactory, HGamer3D.Bindings.Ogre.ClassResourceGroupManager, HGamer3D.Bindings.Ogre.ClassConfigFile, HGamer3D.Bindings.Ogre.ClassMaterial, HGamer3D.Bindings.Ogre.ClassBillboardChain, HGamer3D.Bindings.Ogre.ClassEntityFactory, HGamer3D.Bindings.Ogre.ClassWindowEventUtilities, HGamer3D.Bindings.Ogre.ClassTextureManager, HGamer3D.Bindings.Ogre.ClassNode, HGamer3D.Bindings.Ogre.ClassSceneNode, HGamer3D.Bindings.Ogre.ClassMultiRenderTarget, HGamer3D.Bindings.Ogre.ClassLight, HGamer3D.Bindings.Ogre.ClassViewport, HGamer3D.Bindings.Ogre.ClassManualObjectFactory, HGamer3D.Bindings.Ogre.ClassMovableObjectFactory, HGamer3D.Bindings.Ogre.ClassLogManager, HGamer3D.Bindings.Ogre.ClassVertexAnimationTrack, HGamer3D.Bindings.Ogre.ClassSceneManager, HGamer3D.Bindings.Ogre.ClassEntity, HGamer3D.Bindings.Ogre.ClassSkeleton, HGamer3D.Bindings.Ogre.ClassResourceManager, HGamer3D.Bindings.Ogre.ClassManualObject, HGamer3D.Bindings.Ogre.ClassBillboardSet, HGamer3D.Bindings.Ogre.ClassArchiveManager, HGamer3D.Bindings.Ogre.ClassTimeIndex, HGamer3D.Bindings.Ogre.ClassAnimation, HGamer3D.Bindings.Ogre.ClassBillboardChainFactory, HGamer3D.Bindings.Ogre.ClassAnimationTrack, HGamer3D.Bindings.Ogre.ClassRenderTexture, HGamer3D.Bindings.Ogre.ClassAnimationStateSet, HGamer3D.Bindings.Ogre.ClassNodeAnimationTrack, HGamer3D.Bindings.Ogre.ClassException, HGamer3D.Bindings.Ogre.ClassBillboardSetFactory, HGamer3D.Bindings.Ogre.ClassRoot, HGamer3D.Bindings.Ogre.ClassManualObjectSection, HGamer3D.Bindings.Ogre.ClassArchive, HGamer3D.Bindings.Ogre.ClassFrustum, HGamer3D.Bindings.Ogre.ClassNumericAnimationTrack, HGamer3D.Bindings.Ogre.ClassMaterialManager, HGamer3D.Bindings.Ogre.ClassSceneManagerFactory, HGamer3D.Bindings.Ogre.ClassControllerManager, HGamer3D.Bindings.Ogre.ClassMovableObject, HGamer3D.Bindings.Ogre.ClassAnimationState, HGamer3D.Bindings.Ogre.ClassBillboard, HGamer3D.Bindings.Ogre.ClassRenderWindow, HGamer3D.Bindings.Ogre.ClassResource, HGamer3D.Bindings.Ogre.ClassLog, HGamer3D.Bindings.Ogre.ClassCamera, HGamer3D.Bindings.Ogre.ClassRenderable, HGamer3D.Bindings.Ogre.ClassMeshManager, HGamer3D.Bindings.Ogre.ClassRenderSystem, HGamer3D.Bindings.Ogre.ClassSkeletonManager, HGamer3D.Bindings.Ogre.ClassRenderTarget Other-modules: ghc-options: @@ -33,6 +33,6 @@ Library Build-tools: build-depends: if os(windows) - extra-libraries: hg3dogre032 + extra-libraries: hg3dogre040 else - extra-libraries: hg3dogre032,OgreMain,OgrePaging,OgreProperty,OgreRTShaderSystem,OgreTerrain + extra-libraries: hg3dogre040,OgreMain,OgrePaging,OgreProperty,OgreRTShaderSystem,OgreTerrain diff --git a/Bindings/Ogre/hBuild/HGamer3D/Bindings/Ogre/ClassAnimationStateSet.chs b/Bindings/Ogre/hBuild/HGamer3D/Bindings/Ogre/ClassAnimationStateSet.chs index 8e17b03..6485101 100644 --- a/Bindings/Ogre/hBuild/HGamer3D/Bindings/Ogre/ClassAnimationStateSet.chs +++ b/Bindings/Ogre/hBuild/HGamer3D/Bindings/Ogre/ClassAnimationStateSet.chs @@ -81,6 +81,11 @@ import HGamer3D.Data.Angle { withHG3DClass* `HG3DClass' , withHG3DClass* `HG3DClass' } -> `()' #} +{- function getDirtyFrameNumber -} +{#fun ogre_ass_getDirtyFrameNumber as getDirtyFrameNumber +{ withHG3DClass* `HG3DClass' , + alloca- `Int' peekIntConv*} -> `()' #} + {- function hasEnabledAnimationState -} {#fun ogre_ass_hasEnabledAnimationState as hasEnabledAnimationState { withHG3DClass* `HG3DClass' , diff --git a/Bindings/Ogre/hBuild/HGamer3D/Bindings/Ogre/ClassRoot.chs b/Bindings/Ogre/hBuild/HGamer3D/Bindings/Ogre/ClassRoot.chs index 040c994..f26055b 100644 --- a/Bindings/Ogre/hBuild/HGamer3D/Bindings/Ogre/ClassRoot.chs +++ b/Bindings/Ogre/hBuild/HGamer3D/Bindings/Ogre/ClassRoot.chs @@ -247,6 +247,11 @@ import HGamer3D.Data.Angle { withHG3DClass* `HG3DClass' , withCString* `String' } -> `()' #} +{- function getNextFrameNumber -} +{#fun ogre_rt_getNextFrameNumber as getNextFrameNumber +{ withHG3DClass* `HG3DClass' , + alloca- `Int' peekIntConv*} -> `()' #} + {- function destroyRenderQueueInvocationSequence -} {#fun ogre_rt_destroyRenderQueueInvocationSequence as destroyRenderQueueInvocationSequence { withHG3DClass* `HG3DClass' , diff --git a/Bindings/Ogre/hBuild/SConstruct b/Bindings/Ogre/hBuild/SConstruct index e122da5..694168b 100644 --- a/Bindings/Ogre/hBuild/SConstruct +++ b/Bindings/Ogre/hBuild/SConstruct @@ -19,12 +19,20 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/Ogre/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-GUI || true", +"ghc-pkg unregister HGamer3D-Graphics3D || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings/Ogre/hBuild/include/ClassAnimation.h b/Bindings/Ogre/hBuild/include/ClassAnimation.h index 200361c..37b1e87 100644 --- a/Bindings/Ogre/hBuild/include/ClassAnimation.h +++ b/Bindings/Ogre/hBuild/include/ClassAnimation.h @@ -67,7 +67,7 @@ void ogre_anm_getNumNodeTracks(struct hg3dclass_struct * thisclass_c, unsigned s void ogre_anm_getNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, struct hg3dclass_struct * result_c); // -void ogre_anm_hasNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c); +void ogre_anm_hasNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c); // void ogre_anm_getNumNumericTracks(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); @@ -76,7 +76,7 @@ void ogre_anm_getNumNumericTracks(struct hg3dclass_struct * thisclass_c, unsigne void ogre_anm_getNumericTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, struct hg3dclass_struct * result_c); // -void ogre_anm_hasNumericTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c); +void ogre_anm_hasNumericTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c); // void ogre_anm_getNumVertexTracks(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); @@ -85,7 +85,7 @@ void ogre_anm_getNumVertexTracks(struct hg3dclass_struct * thisclass_c, unsigned void ogre_anm_getVertexTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, struct hg3dclass_struct * result_c); // -void ogre_anm_hasVertexTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, int * result_c); +void ogre_anm_hasVertexTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c, long * result_c); // void ogre_anm_destroyNodeTrack(struct hg3dclass_struct * thisclass_c, unsigned short handle_c); @@ -118,7 +118,7 @@ void ogre_anm_applyToNode(struct hg3dclass_struct * thisclass_c, struct hg3dclas void ogre_anm_apply2(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * skeleton_c, float timePos_c, float weight_c, float scale_c); // -void ogre_anm_apply4(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * entity_c, float timePos_c, float weight_c, int software_c, int hardware_c); +void ogre_anm_apply4(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * entity_c, float timePos_c, float weight_c, long software_c, long hardware_c); // void ogre_anm_setInterpolationMode(struct hg3dclass_struct * thisclass_c, enum EnumAnimationInterpolationMode im_c); @@ -133,16 +133,16 @@ void ogre_anm_setRotationInterpolationMode(struct hg3dclass_struct * thisclass_c void ogre_anm_getRotationInterpolationMode(struct hg3dclass_struct * thisclass_c, enum EnumAnimationRotationInterpolationMode * result_c); // -void ogre_anm_optimise(struct hg3dclass_struct * thisclass_c, int discardIdentityNodeTracks_c); +void ogre_anm_optimise(struct hg3dclass_struct * thisclass_c, long discardIdentityNodeTracks_c); // void ogre_anm_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, struct hg3dclass_struct * result_c); // -void ogre_anm_setUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, int useBaseKeyFrame_c, float keyframeTime_c, char * baseAnimName_c); +void ogre_anm_setUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, long useBaseKeyFrame_c, float keyframeTime_c, char * baseAnimName_c); // -void ogre_anm_getUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anm_getUseBaseKeyFrame(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_anm_getBaseKeyFrameTime(struct hg3dclass_struct * thisclass_c, float * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassAnimationState.h b/Bindings/Ogre/hBuild/include/ClassAnimationState.h index a757f6f..d461037 100644 --- a/Bindings/Ogre/hBuild/include/ClassAnimationState.h +++ b/Bindings/Ogre/hBuild/include/ClassAnimationState.h @@ -29,7 +29,7 @@ // -void ogre_anms_construct(char * animName_c, struct hg3dclass_struct * parent_c, float timePos_c, float length_c, float weight_c, int enabled_c, struct hg3dclass_struct * result_c); +void ogre_anms_construct(char * animName_c, struct hg3dclass_struct * parent_c, float timePos_c, float length_c, float weight_c, long enabled_c, struct hg3dclass_struct * result_c); // void ogre_anms_destruct(struct hg3dclass_struct * thisclass_c); @@ -59,19 +59,19 @@ void ogre_anms_setWeight(struct hg3dclass_struct * thisclass_c, float weight_c); void ogre_anms_addTime(struct hg3dclass_struct * thisclass_c, float offset_c); // Returns true if the animation has reached the end and is not looping. -void ogre_anms_hasEnded(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anms_hasEnded(struct hg3dclass_struct * thisclass_c, long * result_c); // Returns true if this animation is currently enabled. -void ogre_anms_getEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anms_getEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // Sets whether this animation is enabled. -void ogre_anms_setEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_anms_setEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_anms_setLoop(struct hg3dclass_struct * thisclass_c, int loop_c); +void ogre_anms_setLoop(struct hg3dclass_struct * thisclass_c, long loop_c); // Gets whether or not this animation loops. -void ogre_anms_getLoop(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anms_getLoop(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_anms_copyStateFrom(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * animState_c); @@ -80,18 +80,18 @@ void ogre_anms_copyStateFrom(struct hg3dclass_struct * thisclass_c, struct hg3dc void ogre_anms_getParent(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // Create a new blend mask with the given number of entries. -void ogre_anms_createBlendMask(struct hg3dclass_struct * thisclass_c, int blendMaskSizeHint_c, float initialWeight_c); +void ogre_anms_createBlendMask(struct hg3dclass_struct * thisclass_c, long blendMaskSizeHint_c, float initialWeight_c); // Destroy the currently set blend mask. void ogre_anms_destroyBlendMask(struct hg3dclass_struct * thisclass_c); // Return whether there is currently a valid blend mask set. -void ogre_anms_hasBlendMask(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_anms_hasBlendMask(struct hg3dclass_struct * thisclass_c, long * result_c); // Set the weight for the bone identified by the given handle. -void ogre_anms_setBlendMaskEntry(struct hg3dclass_struct * thisclass_c, int boneHandle_c, float weight_c); +void ogre_anms_setBlendMaskEntry(struct hg3dclass_struct * thisclass_c, long boneHandle_c, float weight_c); // Get the weight for the bone identified by the given handle. -void ogre_anms_getBlendMaskEntry(struct hg3dclass_struct * thisclass_c, int boneHandle_c, float * result_c); +void ogre_anms_getBlendMaskEntry(struct hg3dclass_struct * thisclass_c, long boneHandle_c, float * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassAnimationStateSet.h b/Bindings/Ogre/hBuild/include/ClassAnimationStateSet.h index dd0e8cd..1e1762c 100644 --- a/Bindings/Ogre/hBuild/include/ClassAnimationStateSet.h +++ b/Bindings/Ogre/hBuild/include/ClassAnimationStateSet.h @@ -32,13 +32,13 @@ void ogre_ass_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_ass_createAnimationState(struct hg3dclass_struct * thisclass_c, char * animName_c, float timePos_c, float length_c, float weight_c, int enabled_c, struct hg3dclass_struct * result_c); +void ogre_ass_createAnimationState(struct hg3dclass_struct * thisclass_c, char * animName_c, float timePos_c, float length_c, float weight_c, long enabled_c, struct hg3dclass_struct * result_c); // Get an animation state by the name of the animation. void ogre_ass_getAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // Tests if state for the named animation is present. -void ogre_ass_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_ass_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // Remove animation state with the given name. void ogre_ass_removeAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -49,7 +49,10 @@ void ogre_ass_removeAllAnimationStates(struct hg3dclass_struct * thisclass_c); // Copy the state of any matching animation states from this to another. void ogre_ass_copyMatchingState(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * target_c); +// Get the latest animation state been altered frame number. +void ogre_ass_getDirtyFrameNumber(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); + // Tests if exists enabled animation state in this set. -void ogre_ass_hasEnabledAnimationState(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ass_hasEnabledAnimationState(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassAnimationTrack.h b/Bindings/Ogre/hBuild/include/ClassAnimationTrack.h index b42777f..3315937 100644 --- a/Bindings/Ogre/hBuild/include/ClassAnimationTrack.h +++ b/Bindings/Ogre/hBuild/include/ClassAnimationTrack.h @@ -48,7 +48,7 @@ void ogre_at_removeAllKeyFrames(struct hg3dclass_struct * thisclass_c); void ogre_at_apply(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * timeIndex_c, float weight_c, float scale_c); // -void ogre_at_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_at_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_at_optimise(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/hBuild/include/ClassArchive.h b/Bindings/Ogre/hBuild/include/ClassArchive.h index fd746d9..ce0e6b8 100644 --- a/Bindings/Ogre/hBuild/include/ClassArchive.h +++ b/Bindings/Ogre/hBuild/include/ClassArchive.h @@ -34,7 +34,7 @@ void ogre_arch_destruct(struct hg3dclass_struct * thisclass_c); void ogre_arch_getName(struct hg3dclass_struct * thisclass_c, char * result_c); // Returns whether this archive is case sensitive in the way it matches files. -void ogre_arch_isCaseSensitive(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_arch_isCaseSensitive(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_arch_load(struct hg3dclass_struct * thisclass_c); @@ -43,13 +43,13 @@ void ogre_arch_load(struct hg3dclass_struct * thisclass_c); void ogre_arch_unload(struct hg3dclass_struct * thisclass_c); // -void ogre_arch_isReadOnly(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_arch_isReadOnly(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_arch_remove(struct hg3dclass_struct * thisclass_c, char * filename_c); // -void ogre_arch_exists(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c); +void ogre_arch_exists(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c); // Return the type code of this Archive void ogre_arch_getType(struct hg3dclass_struct * thisclass_c, char * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassBillboard.h b/Bindings/Ogre/hBuild/include/ClassBillboard.h index f99d5bd..f1dd044 100644 --- a/Bindings/Ogre/hBuild/include/ClassBillboard.h +++ b/Bindings/Ogre/hBuild/include/ClassBillboard.h @@ -64,7 +64,7 @@ void ogre_bbd_setColour(struct hg3dclass_struct * thisclass_c, struct colourvalu void ogre_bbd_getColour(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * result_c); // -void ogre_bbd_hasOwnDimensions(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbd_hasOwnDimensions(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbd_getOwnWidth(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -73,7 +73,7 @@ void ogre_bbd_getOwnWidth(struct hg3dclass_struct * thisclass_c, float * result_ void ogre_bbd_getOwnHeight(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_bbd_isUseTexcoordRect(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbd_isUseTexcoordRect(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbd_setTexcoordIndex(struct hg3dclass_struct * thisclass_c, unsigned short texcoordIndex_c); diff --git a/Bindings/Ogre/hBuild/include/ClassBillboardChain.h b/Bindings/Ogre/hBuild/include/ClassBillboardChain.h index ed2d720..fa771a2 100644 --- a/Bindings/Ogre/hBuild/include/ClassBillboardChain.h +++ b/Bindings/Ogre/hBuild/include/ClassBillboardChain.h @@ -37,22 +37,22 @@ void ogre_bbdc_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_bbdc_setMaxChainElements(struct hg3dclass_struct * thisclass_c, int maxElements_c); +void ogre_bbdc_setMaxChainElements(struct hg3dclass_struct * thisclass_c, long maxElements_c); // -void ogre_bbdc_getMaxChainElements(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getMaxChainElements(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbdc_setNumberOfChains(struct hg3dclass_struct * thisclass_c, int numChains_c); +void ogre_bbdc_setNumberOfChains(struct hg3dclass_struct * thisclass_c, long numChains_c); // -void ogre_bbdc_getNumberOfChains(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getNumberOfChains(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbdc_setUseTextureCoords(struct hg3dclass_struct * thisclass_c, int use_c); +void ogre_bbdc_setUseTextureCoords(struct hg3dclass_struct * thisclass_c, long use_c); // -void ogre_bbdc_getUseTextureCoords(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getUseTextureCoords(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbdc_setTextureCoordDirection(struct hg3dclass_struct * thisclass_c, enum EnumBillboardChainTexCoordDirection dir_c); @@ -64,31 +64,31 @@ void ogre_bbdc_getTextureCoordDirection(struct hg3dclass_struct * thisclass_c, e void ogre_bbdc_setOtherTextureCoordRange(struct hg3dclass_struct * thisclass_c, float start_c, float end_c); // -void ogre_bbdc_setUseVertexColours(struct hg3dclass_struct * thisclass_c, int use_c); +void ogre_bbdc_setUseVertexColours(struct hg3dclass_struct * thisclass_c, long use_c); // -void ogre_bbdc_getUseVertexColours(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getUseVertexColours(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbdc_setDynamic(struct hg3dclass_struct * thisclass_c, int dyn_c); +void ogre_bbdc_setDynamic(struct hg3dclass_struct * thisclass_c, long dyn_c); // -void ogre_bbdc_getDynamic(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbdc_getDynamic(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbdc_removeChainElement(struct hg3dclass_struct * thisclass_c, int chainIndex_c); +void ogre_bbdc_removeChainElement(struct hg3dclass_struct * thisclass_c, long chainIndex_c); // -void ogre_bbdc_getNumChainElements(struct hg3dclass_struct * thisclass_c, int chainIndex_c, int * result_c); +void ogre_bbdc_getNumChainElements(struct hg3dclass_struct * thisclass_c, long chainIndex_c, long * result_c); // -void ogre_bbdc_clearChain(struct hg3dclass_struct * thisclass_c, int chainIndex_c); +void ogre_bbdc_clearChain(struct hg3dclass_struct * thisclass_c, long chainIndex_c); // void ogre_bbdc_clearAllChains(struct hg3dclass_struct * thisclass_c); // -void ogre_bbdc_setFaceCamera(struct hg3dclass_struct * thisclass_c, int faceCamera_c, struct vector3_struct * normalVector_c); +void ogre_bbdc_setFaceCamera(struct hg3dclass_struct * thisclass_c, long faceCamera_c, struct vector3_struct * normalVector_c); // Get the material name in use. void ogre_bbdc_getMaterialName(struct hg3dclass_struct * thisclass_c, char * result_c); @@ -109,6 +109,6 @@ void ogre_bbdc_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedp void ogre_bbdc_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_bbdc_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, int * result_c); +void ogre_bbdc_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassBillboardSet.h b/Bindings/Ogre/hBuild/include/ClassBillboardSet.h index 39ddebb..38c2b9c 100644 --- a/Bindings/Ogre/hBuild/include/ClassBillboardSet.h +++ b/Bindings/Ogre/hBuild/include/ClassBillboardSet.h @@ -36,7 +36,7 @@ // -void ogre_bbs_construct(char * name_c, unsigned int poolSize_c, int externalDataSource_c, struct hg3dclass_struct * result_c); +void ogre_bbs_construct(char * name_c, unsigned long poolSize_c, long externalDataSource_c, struct hg3dclass_struct * result_c); // void ogre_bbs_destruct(struct hg3dclass_struct * thisclass_c); @@ -48,34 +48,34 @@ void ogre_bbs_createBillboard(struct hg3dclass_struct * thisclass_c, struct vect void ogre_bbs_createBillboard2(struct hg3dclass_struct * thisclass_c, float x_c, float y_c, float z_c, struct colourvalue_struct * colour_c, struct hg3dclass_struct * result_c); // -void ogre_bbs_getNumBillboards(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getNumBillboards(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbs_setAutoextend(struct hg3dclass_struct * thisclass_c, int autoextend_c); +void ogre_bbs_setAutoextend(struct hg3dclass_struct * thisclass_c, long autoextend_c); // -void ogre_bbs_getAutoextend(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getAutoextend(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbs_setSortingEnabled(struct hg3dclass_struct * thisclass_c, int sortenable_c); +void ogre_bbs_setSortingEnabled(struct hg3dclass_struct * thisclass_c, long sortenable_c); // -void ogre_bbs_getSortingEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getSortingEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbs_setPoolSize(struct hg3dclass_struct * thisclass_c, int size_c); +void ogre_bbs_setPoolSize(struct hg3dclass_struct * thisclass_c, long size_c); // -void ogre_bbs_getPoolSize(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_bbs_getPoolSize(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_bbs_clear(struct hg3dclass_struct * thisclass_c); // -void ogre_bbs_getBillboard(struct hg3dclass_struct * thisclass_c, unsigned int index_c, struct hg3dclass_struct * result_c); +void ogre_bbs_getBillboard(struct hg3dclass_struct * thisclass_c, unsigned long index_c, struct hg3dclass_struct * result_c); // -void ogre_bbs_removeBillboard(struct hg3dclass_struct * thisclass_c, unsigned int index_c); +void ogre_bbs_removeBillboard(struct hg3dclass_struct * thisclass_c, unsigned long index_c); // void ogre_bbs_removeBillboard2(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * pBill_c); @@ -114,7 +114,7 @@ void ogre_bbs_setMaterialName(struct hg3dclass_struct * thisclass_c, char * name void ogre_bbs_getMaterialName(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_bbs_beginBillboards(struct hg3dclass_struct * thisclass_c, int numBillboards_c); +void ogre_bbs_beginBillboards(struct hg3dclass_struct * thisclass_c, long numBillboards_c); // void ogre_bbs_injectBillboard(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * bb_c); @@ -132,10 +132,10 @@ void ogre_bbs_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedpt void ogre_bbs_setMaterial(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * material_c); // -void ogre_bbs_getCullIndividually(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getCullIndividually(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bbs_setCullIndividually(struct hg3dclass_struct * thisclass_c, int cullIndividual_c); +void ogre_bbs_setCullIndividually(struct hg3dclass_struct * thisclass_c, long cullIndividual_c); // void ogre_bbs_setBillboardType(struct hg3dclass_struct * thisclass_c, enum EnumBillboardType bbt_c); @@ -156,10 +156,10 @@ void ogre_bbs_setCommonUpVector(struct hg3dclass_struct * thisclass_c, struct ve void ogre_bbs_getCommonUpVector(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); // -void ogre_bbs_setUseAccurateFacing(struct hg3dclass_struct * thisclass_c, int acc_c); +void ogre_bbs_setUseAccurateFacing(struct hg3dclass_struct * thisclass_c, long acc_c); // -void ogre_bbs_getUseAccurateFacing(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getUseAccurateFacing(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbs_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c); @@ -168,22 +168,22 @@ void ogre_bbs_getMovableType(struct hg3dclass_struct * thisclass_c, char * resul void ogre_bbs_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, float * result_c); // -void ogre_bbs_setBillboardsInWorldSpace(struct hg3dclass_struct * thisclass_c, int ws_c); +void ogre_bbs_setBillboardsInWorldSpace(struct hg3dclass_struct * thisclass_c, long ws_c); // -void ogre_bbs_setPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_bbs_setPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_bbs_isPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_isPointRenderingEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // Override to return specific type flag. -void ogre_bbs_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_bbs_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_bbs_setAutoUpdate(struct hg3dclass_struct * thisclass_c, int autoUpdate_c); +void ogre_bbs_setAutoUpdate(struct hg3dclass_struct * thisclass_c, long autoUpdate_c); // -void ogre_bbs_getAutoUpdate(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bbs_getAutoUpdate(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_bbs_notifyBillboardDataChanged(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/hBuild/include/ClassBone.h b/Bindings/Ogre/hBuild/include/ClassBone.h index 6fb1b53..29d87e4 100644 --- a/Bindings/Ogre/hBuild/include/ClassBone.h +++ b/Bindings/Ogre/hBuild/include/ClassBone.h @@ -45,12 +45,12 @@ void ogre_bn_setBindingPose(struct hg3dclass_struct * thisclass_c); void ogre_bn_reset(struct hg3dclass_struct * thisclass_c); // -void ogre_bn_setManuallyControlled(struct hg3dclass_struct * thisclass_c, int manuallyControlled_c); +void ogre_bn_setManuallyControlled(struct hg3dclass_struct * thisclass_c, long manuallyControlled_c); // -void ogre_bn_isManuallyControlled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_bn_isManuallyControlled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_bn_needUpdate(struct hg3dclass_struct * thisclass_c, int forceParentUpdate_c); +void ogre_bn_needUpdate(struct hg3dclass_struct * thisclass_c, long forceParentUpdate_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassCamera.h b/Bindings/Ogre/hBuild/include/ClassCamera.h index a6dc4b7..2ed7de9 100644 --- a/Bindings/Ogre/hBuild/include/ClassCamera.h +++ b/Bindings/Ogre/hBuild/include/ClassCamera.h @@ -96,7 +96,7 @@ void ogre_cam_rotate(struct hg3dclass_struct * thisclass_c, struct vector3_struc void ogre_cam_rotate2(struct hg3dclass_struct * thisclass_c, struct quaternion_struct * q_c); // -void ogre_cam_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, int useFixed_c, struct vector3_struct * fixedAxis_c); +void ogre_cam_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, long useFixed_c, struct vector3_struct * fixedAxis_c); // void ogre_cam_getOrientation(struct hg3dclass_struct * thisclass_c, struct quaternion_struct * result_c); @@ -156,7 +156,7 @@ void ogre_cam_setWindow(struct hg3dclass_struct * thisclass_c, float Left_c, flo void ogre_cam_resetWindow(struct hg3dclass_struct * thisclass_c); // Returns if a viewport window is being used. -void ogre_cam_isWindowSet(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_cam_isWindowSet(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_cam_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -171,10 +171,10 @@ void ogre_cam_getAutoTrackOffset(struct hg3dclass_struct * thisclass_c, struct v void ogre_cam_getViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_cam_setAutoAspectRatio(struct hg3dclass_struct * thisclass_c, int autoratio_c); +void ogre_cam_setAutoAspectRatio(struct hg3dclass_struct * thisclass_c, long autoratio_c); // -void ogre_cam_getAutoAspectRatio(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_cam_getAutoAspectRatio(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_cam_setCullingFrustum(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * frustum_c); @@ -183,7 +183,7 @@ void ogre_cam_setCullingFrustum(struct hg3dclass_struct * thisclass_c, struct hg void ogre_cam_getCullingFrustum(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_cam_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, int * result_c); +void ogre_cam_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, long * result_c); // void ogre_cam_getWorldSpaceCorners(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); @@ -195,10 +195,10 @@ void ogre_cam_getNearClipDistance(struct hg3dclass_struct * thisclass_c, float * void ogre_cam_getFarClipDistance(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_cam_setUseRenderingDistance(struct hg3dclass_struct * thisclass_c, int use_c); +void ogre_cam_setUseRenderingDistance(struct hg3dclass_struct * thisclass_c, long use_c); // -void ogre_cam_getUseRenderingDistance(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_cam_getUseRenderingDistance(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_cam_synchroniseBaseSettingsWith(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c); @@ -211,10 +211,10 @@ void ogre_cam_getOrientationForViewUpdate(struct hg3dclass_struct * thisclass_c, // Sets whether to use min display size calculations -void ogre_cam_setUseMinPixelSize(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_cam_setUseMinPixelSize(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_cam_getUseMinPixelSize(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_cam_getUseMinPixelSize(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_cam_getPixelDisplayRatio(struct hg3dclass_struct * thisclass_c, float * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassConfigFile.h b/Bindings/Ogre/hBuild/include/ClassConfigFile.h index e1cc466..113ae00 100644 --- a/Bindings/Ogre/hBuild/include/ClassConfigFile.h +++ b/Bindings/Ogre/hBuild/include/ClassConfigFile.h @@ -34,16 +34,16 @@ void ogre_cf_construct(struct hg3dclass_struct * result_c); void ogre_cf_destruct(struct hg3dclass_struct * thisclass_c); // load from a filename (not using resource group locations) -void ogre_cf_load(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, int trimWhitespace_c); +void ogre_cf_load(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, long trimWhitespace_c); // load from a filename (using resource group locations) -void ogre_cf_load2(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, int trimWhitespace_c); +void ogre_cf_load2(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, long trimWhitespace_c); // load from a filename (not using resource group locations) -void ogre_cf_loadDirect(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, int trimWhitespace_c); +void ogre_cf_loadDirect(struct hg3dclass_struct * thisclass_c, char * filename_c, char * separators_c, long trimWhitespace_c); // load from a filename (using resource group locations) -void ogre_cf_loadFromResourceSystem(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, int trimWhitespace_c); +void ogre_cf_loadFromResourceSystem(struct hg3dclass_struct * thisclass_c, char * filename_c, char * resourceGroup_c, char * separators_c, long trimWhitespace_c); // void ogre_cf_getSetting(struct hg3dclass_struct * thisclass_c, char * key_c, char * section_c, char * defaultValue_c, char * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassEntity.h b/Bindings/Ogre/hBuild/include/ClassEntity.h index 57be3c3..23523f6 100644 --- a/Bindings/Ogre/hBuild/include/ClassEntity.h +++ b/Bindings/Ogre/hBuild/include/ClassEntity.h @@ -40,7 +40,7 @@ void ogre_ent_destruct(struct hg3dclass_struct * thisclass_c); void ogre_ent_getMesh(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); // -void ogre_ent_getNumSubEntities(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_ent_getNumSubEntities(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_ent_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, struct hg3dclass_struct * result_c); @@ -58,25 +58,25 @@ void ogre_ent_getMovableType(struct hg3dclass_struct * thisclass_c, char * resul void ogre_ent_getAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_ent_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_ent_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_ent_getAllAnimationStates(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_ent_setDisplaySkeleton(struct hg3dclass_struct * thisclass_c, int display_c); +void ogre_ent_setDisplaySkeleton(struct hg3dclass_struct * thisclass_c, long display_c); // -void ogre_ent_getDisplaySkeleton(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getDisplaySkeleton(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_getManualLodLevel(struct hg3dclass_struct * thisclass_c, int index_c, struct hg3dclass_struct * result_c); +void ogre_ent_getManualLodLevel(struct hg3dclass_struct * thisclass_c, long index_c, struct hg3dclass_struct * result_c); // -void ogre_ent_getNumManualLodLevels(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getNumManualLodLevels(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int PolygonModeOverrideable_c); +void ogre_ent_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long PolygonModeOverrideable_c); // void ogre_ent_detachObjectFromBone(struct hg3dclass_struct * thisclass_c, char * movableName_c, struct hg3dclass_struct * result_c); @@ -91,60 +91,60 @@ void ogre_ent_detachAllObjectsFromBone(struct hg3dclass_struct * thisclass_c); void ogre_ent_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_ent_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_hasSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_hasSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_isHardwareAnimationEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_isHardwareAnimationEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_getSoftwareAnimationRequests(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getSoftwareAnimationRequests(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_getSoftwareAnimationNormalsRequests(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getSoftwareAnimationNormalsRequests(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_addSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, int normalsAlso_c); +void ogre_ent_addSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, long normalsAlso_c); // -void ogre_ent_removeSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, int normalsAlso_c); +void ogre_ent_removeSoftwareAnimationRequest(struct hg3dclass_struct * thisclass_c, long normalsAlso_c); // void ogre_ent_shareSkeletonInstanceWith(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * entity_c); // -void ogre_ent_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_ent_stopSharingSkeletonInstance(struct hg3dclass_struct * thisclass_c); // -void ogre_ent_sharesSkeletonInstance(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_sharesSkeletonInstance(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_ent_refreshAvailableAnimationState(struct hg3dclass_struct * thisclass_c); // Choose which vertex data to bind to the renderer. -void ogre_ent_chooseVertexDataForBinding(struct hg3dclass_struct * thisclass_c, int hasVertexAnim_c, enum EnumEntityVertexDataBindChoice * result_c); +void ogre_ent_chooseVertexDataForBinding(struct hg3dclass_struct * thisclass_c, long hasVertexAnim_c, enum EnumEntityVertexDataBindChoice * result_c); // -void ogre_ent_isInitialised(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_isInitialised(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_ent_backgroundLoadingComplete(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * res_c); // -void ogre_ent_setSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, int skip_c); +void ogre_ent_setSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, long skip_c); // -void ogre_ent_getSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getSkipAnimationStateUpdate(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_ent_setAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, int update_c); +void ogre_ent_setAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, long update_c); // -void ogre_ent_getAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_ent_getAlwaysUpdateMainSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassException.h b/Bindings/Ogre/hBuild/include/ClassException.h index 812e3dc..abbe4c2 100644 --- a/Bindings/Ogre/hBuild/include/ClassException.h +++ b/Bindings/Ogre/hBuild/include/ClassException.h @@ -28,7 +28,7 @@ // -void ogre_exc_construct(int number_c, char * description_c, char * source_c, struct hg3dclass_struct * result_c); +void ogre_exc_construct(long number_c, char * description_c, char * source_c, struct hg3dclass_struct * result_c); // Needed for compatibility with std::exception. void ogre_exc_destruct(struct hg3dclass_struct * thisclass_c); @@ -37,7 +37,7 @@ void ogre_exc_destruct(struct hg3dclass_struct * thisclass_c); void ogre_exc_getFullDescription(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_exc_getNumber(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_exc_getNumber(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_exc_getSource(struct hg3dclass_struct * thisclass_c, char * result_c); @@ -46,7 +46,7 @@ void ogre_exc_getSource(struct hg3dclass_struct * thisclass_c, char * result_c); void ogre_exc_getFile(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_exc_getLine(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_exc_getLine(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_exc_getDescription(struct hg3dclass_struct * thisclass_c, char * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassFrustum.h b/Bindings/Ogre/hBuild/include/ClassFrustum.h index 383893f..53ca09b 100644 --- a/Bindings/Ogre/hBuild/include/ClassFrustum.h +++ b/Bindings/Ogre/hBuild/include/ClassFrustum.h @@ -91,16 +91,16 @@ void ogre_frst_resetFrustumExtents(struct hg3dclass_struct * thisclass_c); void ogre_frst_getFrustumExtents(struct hg3dclass_struct * thisclass_c, float * outleft_c, float * outright_c, float * outtop_c, float * outbottom_c); // Returns whether a custom view matrix is in use. -void ogre_frst_isCustomViewMatrixEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_frst_isCustomViewMatrixEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // Returns whether a custom projection matrix is in use. -void ogre_frst_isCustomProjectionMatrixEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_frst_isCustomProjectionMatrixEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_frst_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, int * result_c); +void ogre_frst_isVisible3(struct hg3dclass_struct * thisclass_c, struct vector3_struct * vert_c, enum EnumFrustumPlane * culledBy_c, long * result_c); // Overridden from MovableObject::getTypeFlags -void ogre_frst_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_frst_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_frst_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -142,13 +142,13 @@ void ogre_frst_getOrthoWindowWidth(struct hg3dclass_struct * thisclass_c, float void ogre_frst_disableReflection(struct hg3dclass_struct * thisclass_c); // Returns whether this frustum is being reflected. -void ogre_frst_isReflected(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_frst_isReflected(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_frst_disableCustomNearClipPlane(struct hg3dclass_struct * thisclass_c); // -void ogre_frst_isCustomNearClipPlaneEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_frst_isCustomNearClipPlaneEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_frst_getPositionForViewUpdate(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassHG3DUtilities.h b/Bindings/Ogre/hBuild/include/ClassHG3DUtilities.h index 98a5eed..6195d1d 100644 --- a/Bindings/Ogre/hBuild/include/ClassHG3DUtilities.h +++ b/Bindings/Ogre/hBuild/include/ClassHG3DUtilities.h @@ -30,13 +30,13 @@ // -void ogre_hg3dutl_getWindowHandle(struct hg3dclass_struct * window_c, unsigned int * result_c); +void ogre_hg3dutl_getWindowHandle(struct hg3dclass_struct * window_c, unsigned long * result_c); // void ogre_hg3dutl_setupCloseEventHandler(struct hg3dclass_struct * window_c); // -void ogre_hg3dutl_checkQuitReceived(int * result_c); +void ogre_hg3dutl_checkQuitReceived(long * result_c); // void ogre_hg3dutl_buildTangentVectors(struct hg3dclass_struct * entity_c); diff --git a/Bindings/Ogre/hBuild/include/ClassLight.h b/Bindings/Ogre/hBuild/include/ClassLight.h index 1f6cd05..ec52197 100644 --- a/Bindings/Ogre/hBuild/include/ClassLight.h +++ b/Bindings/Ogre/hBuild/include/ClassLight.h @@ -131,19 +131,19 @@ void ogre_lgt_getPowerScale(struct hg3dclass_struct * thisclass_c, float * resul void ogre_lgt_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_lgt_getDerivedPosition(struct hg3dclass_struct * thisclass_c, int cameraRelativeIfSet_c, struct vector3_struct * result_c); +void ogre_lgt_getDerivedPosition(struct hg3dclass_struct * thisclass_c, long cameraRelativeIfSet_c, struct vector3_struct * result_c); // void ogre_lgt_getDerivedDirection(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); // -void ogre_lgt_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c); +void ogre_lgt_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c); // void ogre_lgt_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); // Override to return specific type flag. -void ogre_lgt_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_lgt_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_lgt_resetCustomShadowCameraSetup(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/hBuild/include/ClassLog.h b/Bindings/Ogre/hBuild/include/ClassLog.h index 1d4e84b..43e8dcc 100644 --- a/Bindings/Ogre/hBuild/include/ClassLog.h +++ b/Bindings/Ogre/hBuild/include/ClassLog.h @@ -36,25 +36,25 @@ void ogre_lg_destruct(struct hg3dclass_struct * thisclass_c); void ogre_lg_getName(struct hg3dclass_struct * thisclass_c, char * result_c); // Get whether debug output is enabled for this log. -void ogre_lg_isDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_lg_isDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // Get whether file output is suppressed for this log. -void ogre_lg_isFileOutputSuppressed(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_lg_isFileOutputSuppressed(struct hg3dclass_struct * thisclass_c, long * result_c); // Get whether time stamps are printed for this log. -void ogre_lg_isTimeStampEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_lg_isTimeStampEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_lg_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, int maskDebug_c); +void ogre_lg_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, long maskDebug_c); // -void ogre_lg_setDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, int debugOutput_c); +void ogre_lg_setDebugOutputEnabled(struct hg3dclass_struct * thisclass_c, long debugOutput_c); // void ogre_lg_setLogDetail(struct hg3dclass_struct * thisclass_c, enum EnumLoggingLevel ll_c); // -void ogre_lg_setTimeStampEnabled(struct hg3dclass_struct * thisclass_c, int timeStamp_c); +void ogre_lg_setTimeStampEnabled(struct hg3dclass_struct * thisclass_c, long timeStamp_c); // void ogre_lg_getLogDetail(struct hg3dclass_struct * thisclass_c, enum EnumLoggingLevel * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassLogManager.h b/Bindings/Ogre/hBuild/include/ClassLogManager.h index e8e21f3..63f2bdd 100644 --- a/Bindings/Ogre/hBuild/include/ClassLogManager.h +++ b/Bindings/Ogre/hBuild/include/ClassLogManager.h @@ -34,7 +34,7 @@ void ogre_lmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_lmgr_createLog(struct hg3dclass_struct * thisclass_c, char * name_c, int defaultLog_c, int debuggerOutput_c, int suppressFileOutput_c, struct hg3dclass_struct * result_c); +void ogre_lmgr_createLog(struct hg3dclass_struct * thisclass_c, char * name_c, long defaultLog_c, long debuggerOutput_c, long suppressFileOutput_c, struct hg3dclass_struct * result_c); // void ogre_lmgr_getLog(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); @@ -52,10 +52,10 @@ void ogre_lmgr_destroyLog2(struct hg3dclass_struct * thisclass_c, struct hg3dcla void ogre_lmgr_setDefaultLog(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * newLog_c, struct hg3dclass_struct * result_c); // -void ogre_lmgr_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, int maskDebug_c); +void ogre_lmgr_logMessage(struct hg3dclass_struct * thisclass_c, char * message_c, enum EnumLogMessageLevel lml_c, long maskDebug_c); // -void ogre_lmgr_logMessage2(struct hg3dclass_struct * thisclass_c, enum EnumLogMessageLevel lml_c, char * message_c, int maskDebug_c); +void ogre_lmgr_logMessage2(struct hg3dclass_struct * thisclass_c, enum EnumLogMessageLevel lml_c, char * message_c, long maskDebug_c); // void ogre_lmgr_setLogDetail(struct hg3dclass_struct * thisclass_c, enum EnumLoggingLevel ll_c); diff --git a/Bindings/Ogre/hBuild/include/ClassManualObject.h b/Bindings/Ogre/hBuild/include/ClassManualObject.h index de8325f..d4c42d0 100644 --- a/Bindings/Ogre/hBuild/include/ClassManualObject.h +++ b/Bindings/Ogre/hBuild/include/ClassManualObject.h @@ -43,22 +43,22 @@ void ogre_mno_destruct(struct hg3dclass_struct * thisclass_c); void ogre_mno_clear(struct hg3dclass_struct * thisclass_c); // -void ogre_mno_estimateVertexCount(struct hg3dclass_struct * thisclass_c, int vcount_c); +void ogre_mno_estimateVertexCount(struct hg3dclass_struct * thisclass_c, long vcount_c); // -void ogre_mno_estimateIndexCount(struct hg3dclass_struct * thisclass_c, int icount_c); +void ogre_mno_estimateIndexCount(struct hg3dclass_struct * thisclass_c, long icount_c); // void ogre_mno_begin(struct hg3dclass_struct * thisclass_c, char * materialName_c, enum EnumRenderOperationOperationType opType_c, char * groupName_c); // -void ogre_mno_setDynamic(struct hg3dclass_struct * thisclass_c, int dyn_c); +void ogre_mno_setDynamic(struct hg3dclass_struct * thisclass_c, long dyn_c); // -void ogre_mno_getDynamic(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getDynamic(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mno_beginUpdate(struct hg3dclass_struct * thisclass_c, int sectionIndex_c); +void ogre_mno_beginUpdate(struct hg3dclass_struct * thisclass_c, long sectionIndex_c); // void ogre_mno_position(struct hg3dclass_struct * thisclass_c, struct vector3_struct * pos_c); @@ -103,60 +103,60 @@ void ogre_mno_colour(struct hg3dclass_struct * thisclass_c, struct colourvalue_s void ogre_mno_colour2(struct hg3dclass_struct * thisclass_c, float r_c, float g_c, float b_c, float a_c); // -void ogre_mno_index(struct hg3dclass_struct * thisclass_c, unsigned int idx_c); +void ogre_mno_index(struct hg3dclass_struct * thisclass_c, unsigned long idx_c); // -void ogre_mno_triangle(struct hg3dclass_struct * thisclass_c, unsigned int i1_c, unsigned int i2_c, unsigned int i3_c); +void ogre_mno_triangle(struct hg3dclass_struct * thisclass_c, unsigned long i1_c, unsigned long i2_c, unsigned long i3_c); // -void ogre_mno_quad(struct hg3dclass_struct * thisclass_c, unsigned int i1_c, unsigned int i2_c, unsigned int i3_c, unsigned int i4_c); +void ogre_mno_quad(struct hg3dclass_struct * thisclass_c, unsigned long i1_c, unsigned long i2_c, unsigned long i3_c, unsigned long i4_c); // Get the number of vertices in the section currently being defined (returns 0 if no section is in progress). -void ogre_mno_getCurrentVertexCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getCurrentVertexCount(struct hg3dclass_struct * thisclass_c, long * result_c); // Get the number of indices in the section currently being defined (returns 0 if no section is in progress). -void ogre_mno_getCurrentIndexCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getCurrentIndexCount(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mno_end(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_mno_setMaterialName(struct hg3dclass_struct * thisclass_c, int subindex_c, char * name_c, char * group_c); +void ogre_mno_setMaterialName(struct hg3dclass_struct * thisclass_c, long subindex_c, char * name_c, char * group_c); // void ogre_mno_convertToMesh(struct hg3dclass_struct * thisclass_c, char * meshName_c, char * groupName_c, struct sharedptr_struct * result_c); // -void ogre_mno_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int useIdentityProjection_c); +void ogre_mno_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long useIdentityProjection_c); // -void ogre_mno_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mno_setUseIdentityView(struct hg3dclass_struct * thisclass_c, int useIdentityView_c); +void ogre_mno_setUseIdentityView(struct hg3dclass_struct * thisclass_c, long useIdentityView_c); // -void ogre_mno_getUseIdentityView(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getUseIdentityView(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mno_getSection(struct hg3dclass_struct * thisclass_c, unsigned int index_c, struct hg3dclass_struct * result_c); +void ogre_mno_getSection(struct hg3dclass_struct * thisclass_c, unsigned long index_c, struct hg3dclass_struct * result_c); // -void ogre_mno_getNumSections(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mno_getNumSections(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mno_setKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, int keepOrder_c); +void ogre_mno_setKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, long keepOrder_c); // -void ogre_mno_getKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_getKeepDeclarationOrder(struct hg3dclass_struct * thisclass_c, long * result_c); -// . +// void ogre_mno_getMovableType(struct hg3dclass_struct * thisclass_c, char * result_c); -// . +// void ogre_mno_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_mno_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mno_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassManualObjectSection.h b/Bindings/Ogre/hBuild/include/ClassManualObjectSection.h index 133cb32..fc0316b 100644 --- a/Bindings/Ogre/hBuild/include/ClassManualObjectSection.h +++ b/Bindings/Ogre/hBuild/include/ClassManualObjectSection.h @@ -47,15 +47,15 @@ void ogre_mnos_getMaterialGroup(struct hg3dclass_struct * thisclass_c, char * re void ogre_mnos_setMaterialName(struct hg3dclass_struct * thisclass_c, char * name_c, char * groupName_c); // Set whether we need 32-bit indices. -void ogre_mnos_set32BitIndices(struct hg3dclass_struct * thisclass_c, int n32_c); +void ogre_mnos_set32BitIndices(struct hg3dclass_struct * thisclass_c, long n32_c); // Get whether we need 32-bit indices. -void ogre_mnos_get32BitIndices(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mnos_get32BitIndices(struct hg3dclass_struct * thisclass_c, long * result_c); -// . +// void ogre_mnos_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); -// . +// void ogre_mnos_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * _c, float * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassMaterial.h b/Bindings/Ogre/hBuild/include/ClassMaterial.h index 2f0efc4..95610cf 100644 --- a/Bindings/Ogre/hBuild/include/ClassMaterial.h +++ b/Bindings/Ogre/hBuild/include/ClassMaterial.h @@ -33,19 +33,19 @@ void ogre_mtrl_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_mtrl_isTransparent(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mtrl_isTransparent(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mtrl_setReceiveShadows(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setReceiveShadows(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_getReceiveShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mtrl_getReceiveShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mtrl_setTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_getTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mtrl_getTransparencyCastsShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mtrl_getNumTechniques(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); @@ -69,13 +69,13 @@ void ogre_mtrl_getNumLodLevels(struct hg3dclass_struct * thisclass_c, unsigned s void ogre_mtrl_getNumLodLevels2(struct hg3dclass_struct * thisclass_c, char * schemeName_c, unsigned short * result_c); // -void ogre_mtrl_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, int changeGroup_c, char * newGroup_c, struct sharedptr_struct * result_c); +void ogre_mtrl_clone(struct hg3dclass_struct * thisclass_c, char * newName_c, long changeGroup_c, char * newGroup_c, struct sharedptr_struct * result_c); // void ogre_mtrl_copyDetailsTo(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * mat_c); // -void ogre_mtrl_compile(struct hg3dclass_struct * thisclass_c, int autoManageTextureUnits_c); +void ogre_mtrl_compile(struct hg3dclass_struct * thisclass_c, long autoManageTextureUnits_c); // void ogre_mtrl_setPointSize(struct hg3dclass_struct * thisclass_c, float ps_c); @@ -108,27 +108,27 @@ void ogre_mtrl_setSelfIllumination(struct hg3dclass_struct * thisclass_c, float void ogre_mtrl_setSelfIllumination2(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * selfIllum_c); // -void ogre_mtrl_setDepthCheckEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setDepthCheckEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_setDepthWriteEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setDepthWriteEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_setColourWriteEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setColourWriteEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mtrl_setLightingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mtrl_setLightingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // void ogre_mtrl_setDepthBias(struct hg3dclass_struct * thisclass_c, float constantBias_c, float slopeScaleBias_c); // -void ogre_mtrl_setTextureAnisotropy(struct hg3dclass_struct * thisclass_c, int maxAniso_c); +void ogre_mtrl_setTextureAnisotropy(struct hg3dclass_struct * thisclass_c, long maxAniso_c); // void ogre_mtrl_touch(struct hg3dclass_struct * thisclass_c); // -void ogre_mtrl_getCompilationRequired(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mtrl_getCompilationRequired(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassMaterialManager.h b/Bindings/Ogre/hBuild/include/ClassMaterialManager.h index 41f337b..7bff113 100644 --- a/Bindings/Ogre/hBuild/include/ClassMaterialManager.h +++ b/Bindings/Ogre/hBuild/include/ClassMaterialManager.h @@ -38,10 +38,10 @@ void ogre_mtrlmgr_destruct(struct hg3dclass_struct * thisclass_c); void ogre_mtrlmgr_initialise(struct hg3dclass_struct * thisclass_c); // -void ogre_mtrlmgr_setDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned int maxAniso_c); +void ogre_mtrlmgr_setDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned long maxAniso_c); // Get the default maxAnisotropy. -void ogre_mtrlmgr_getDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mtrlmgr_getDefaultAnisotropy(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_mtrlmgr_getDefaultSettings(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassMesh.h b/Bindings/Ogre/hBuild/include/ClassMesh.h index 2c1aa45..9ad1a1a 100644 --- a/Bindings/Ogre/hBuild/include/ClassMesh.h +++ b/Bindings/Ogre/hBuild/include/ClassMesh.h @@ -55,10 +55,10 @@ void ogre_msh_getBoundingSphereRadius(struct hg3dclass_struct * thisclass_c, flo void ogre_msh_setSkeletonName(struct hg3dclass_struct * thisclass_c, char * skelName_c); // -void ogre_msh_hasSkeleton(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_hasSkeleton(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_msh_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_hasVertexAnimation(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_getSkeleton(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); @@ -73,16 +73,16 @@ void ogre_msh_clearBoneAssignments(struct hg3dclass_struct * thisclass_c); void ogre_msh_createManualLodLevel(struct hg3dclass_struct * thisclass_c, float value_c, char * meshName_c, char * groupName_c); // -void ogre_msh_isLodManual(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isLodManual(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_removeLodLevels(struct hg3dclass_struct * thisclass_c); // -void ogre_msh_isVertexBufferShadowed(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isVertexBufferShadowed(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_msh_isIndexBufferShadowed(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isIndexBufferShadowed(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_buildEdgeList(struct hg3dclass_struct * thisclass_c); @@ -94,22 +94,22 @@ void ogre_msh_freeEdgeList(struct hg3dclass_struct * thisclass_c); void ogre_msh_prepareForShadowVolume(struct hg3dclass_struct * thisclass_c); // -void ogre_msh_isPreparedForShadowVolumes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isPreparedForShadowVolumes(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_msh_isEdgeListBuilt(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_isEdgeListBuilt(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_msh_setAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, int autobuild_c); +void ogre_msh_setAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, long autobuild_c); // -void ogre_msh_getAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_getAutoBuildEdgeLists(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_getSharedVertexDataAnimationType(struct hg3dclass_struct * thisclass_c, enum EnumVertexAnimationType * result_c); // Returns whether animation on shared vertex data includes normals. -void ogre_msh_getSharedVertexDataAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_getSharedVertexDataAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_createAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, float length_c, struct hg3dclass_struct * result_c); @@ -118,7 +118,7 @@ void ogre_msh_createAnimation(struct hg3dclass_struct * thisclass_c, char * name void ogre_msh_getAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_msh_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_msh_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_msh_removeAnimation(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -136,7 +136,7 @@ void ogre_msh_removeAllAnimations(struct hg3dclass_struct * thisclass_c); void ogre_msh_updateMaterialForAllSubMeshes(struct hg3dclass_struct * thisclass_c); // -void ogre_msh_getPoseCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_msh_getPoseCount(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_msh_removePose2(struct hg3dclass_struct * thisclass_c, char * name_c); diff --git a/Bindings/Ogre/hBuild/include/ClassMeshManager.h b/Bindings/Ogre/hBuild/include/ClassMeshManager.h index 89b6b74..2f49f18 100644 --- a/Bindings/Ogre/hBuild/include/ClassMeshManager.h +++ b/Bindings/Ogre/hBuild/include/ClassMeshManager.h @@ -35,10 +35,10 @@ void ogre_mshmgr_construct(struct hg3dclass_struct * result_c); void ogre_mshmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_mshmgr_setPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_mshmgr_setPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_mshmgr_getPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mshmgr_getPrepareAllMeshesForShadowVolumes(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mshmgr_getBoundsPaddingFactor(struct hg3dclass_struct * thisclass_c, float * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassMovableObject.h b/Bindings/Ogre/hBuild/include/ClassMovableObject.h index 731cd49..7a63c26 100644 --- a/Bindings/Ogre/hBuild/include/ClassMovableObject.h +++ b/Bindings/Ogre/hBuild/include/ClassMovableObject.h @@ -46,28 +46,28 @@ void ogre_mvo_getParentNode(struct hg3dclass_struct * thisclass_c, struct hg3dcl void ogre_mvo_getParentSceneNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // Gets whether the parent node is a TagPoint (or a SceneNode -void ogre_mvo_isParentTagPoint(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isParentTagPoint(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_isAttached(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isAttached(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mvo_detachFromParent(struct hg3dclass_struct * thisclass_c); // -void ogre_mvo_isInScene(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isInScene(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mvo_getBoundingRadius(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_mvo_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c); +void ogre_mvo_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c); // -void ogre_mvo_getVisible(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_getVisible(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_isVisible(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isVisible(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mvo_setRenderingDistance(struct hg3dclass_struct * thisclass_c, float dist_c); @@ -82,69 +82,69 @@ void ogre_mvo_setRenderingMinPixelSize(struct hg3dclass_struct * thisclass_c, fl void ogre_mvo_getRenderingMinPixelSize(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_mvo_setQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_setQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // -void ogre_mvo_addQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_addQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // -void ogre_mvo_removeQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_removeQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // Returns the query flags relevant for this object. -void ogre_mvo_getQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvo_getQueryFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mvo_setVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_setVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // -void ogre_mvo_addVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_addVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // -void ogre_mvo_removeVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int flags_c); +void ogre_mvo_removeVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long flags_c); // Returns the visibility flags relevant for this object. -void ogre_mvo_getVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvo_getVisibilityFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mvo_getLightMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvo_getLightMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mvo_setLightMask(struct hg3dclass_struct * thisclass_c, unsigned int lightMask_c); +void ogre_mvo_setLightMask(struct hg3dclass_struct * thisclass_c, unsigned long lightMask_c); // Define a default implementation of method from ShadowCaster which implements no shadows. -void ogre_mvo_hasEdgeList(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_hasEdgeList(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_setCastShadows(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mvo_setCastShadows(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_mvo_getCastShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_getCastShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_getReceivesShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_getReceivesShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_mvo_getPointExtrusionDistance(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * l_c, float * result_c); // -void ogre_mvo_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvo_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_mvo_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_mvo_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // Gets whether debug display of this object is enabled. -void ogre_mvo_isDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvo_isDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvo_setDefaultQueryFlags(unsigned int flags_c); +void ogre_mvo_setDefaultQueryFlags(unsigned long flags_c); // -void ogre_mvo_getDefaultQueryFlags(unsigned int * result_c); +void ogre_mvo_getDefaultQueryFlags(unsigned long * result_c); // -void ogre_mvo_setDefaultVisibilityFlags(unsigned int flags_c); +void ogre_mvo_setDefaultVisibilityFlags(unsigned long flags_c); // -void ogre_mvo_getDefaultVisibilityFlags(unsigned int * result_c); +void ogre_mvo_getDefaultVisibilityFlags(unsigned long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassMovableObjectFactory.h b/Bindings/Ogre/hBuild/include/ClassMovableObjectFactory.h index eb8bada..1415a36 100644 --- a/Bindings/Ogre/hBuild/include/ClassMovableObjectFactory.h +++ b/Bindings/Ogre/hBuild/include/ClassMovableObjectFactory.h @@ -38,9 +38,9 @@ void ogre_mvof_getType(struct hg3dclass_struct * thisclass_c, char * result_c); void ogre_mvof_destroyInstance(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * obj_c); // -void ogre_mvof_requestTypeFlags(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_mvof_requestTypeFlags(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_mvof_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_mvof_getTypeFlags(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassMultiRenderTarget.h b/Bindings/Ogre/hBuild/include/ClassMultiRenderTarget.h index 594a1fc..c034e0e 100644 --- a/Bindings/Ogre/hBuild/include/ClassMultiRenderTarget.h +++ b/Bindings/Ogre/hBuild/include/ClassMultiRenderTarget.h @@ -29,12 +29,12 @@ // -void ogre_mrt_bindSurface(struct hg3dclass_struct * thisclass_c, int attachment_c, struct hg3dclass_struct * target_c); +void ogre_mrt_bindSurface(struct hg3dclass_struct * thisclass_c, long attachment_c, struct hg3dclass_struct * target_c); // -void ogre_mrt_unbindSurface(struct hg3dclass_struct * thisclass_c, int attachment_c); +void ogre_mrt_unbindSurface(struct hg3dclass_struct * thisclass_c, long attachment_c); // -void ogre_mrt_getBoundSurface(struct hg3dclass_struct * thisclass_c, int index_c, struct hg3dclass_struct * result_c); +void ogre_mrt_getBoundSurface(struct hg3dclass_struct * thisclass_c, long index_c, struct hg3dclass_struct * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassNode.h b/Bindings/Ogre/hBuild/include/ClassNode.h index f60688c..06d4564 100644 --- a/Bindings/Ogre/hBuild/include/ClassNode.h +++ b/Bindings/Ogre/hBuild/include/ClassNode.h @@ -72,16 +72,16 @@ void ogre_nd_setScale2(struct hg3dclass_struct * thisclass_c, float x_c, float y void ogre_nd_getScale(struct hg3dclass_struct * thisclass_c, struct vector3_struct * result_c); // -void ogre_nd_setInheritOrientation(struct hg3dclass_struct * thisclass_c, int inherit_c); +void ogre_nd_setInheritOrientation(struct hg3dclass_struct * thisclass_c, long inherit_c); // -void ogre_nd_getInheritOrientation(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_nd_getInheritOrientation(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_nd_setInheritScale(struct hg3dclass_struct * thisclass_c, int inherit_c); +void ogre_nd_setInheritScale(struct hg3dclass_struct * thisclass_c, long inherit_c); // -void ogre_nd_getInheritScale(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_nd_getInheritScale(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_nd_scale(struct hg3dclass_struct * thisclass_c, struct vector3_struct * scale_c); @@ -171,10 +171,10 @@ void ogre_nd_getInitialScale(struct hg3dclass_struct * thisclass_c, struct vecto void ogre_nd_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, float * result_c); // -void ogre_nd_needUpdate(struct hg3dclass_struct * thisclass_c, int forceParentUpdate_c); +void ogre_nd_needUpdate(struct hg3dclass_struct * thisclass_c, long forceParentUpdate_c); // -void ogre_nd_requestUpdate(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * child_c, int forceParentUpdate_c); +void ogre_nd_requestUpdate(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * child_c, long forceParentUpdate_c); // void ogre_nd_cancelUpdate(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * child_c); diff --git a/Bindings/Ogre/hBuild/include/ClassNodeAnimationTrack.h b/Bindings/Ogre/hBuild/include/ClassNodeAnimationTrack.h index 3bd43a0..84b44cf 100644 --- a/Bindings/Ogre/hBuild/include/ClassNodeAnimationTrack.h +++ b/Bindings/Ogre/hBuild/include/ClassNodeAnimationTrack.h @@ -46,16 +46,16 @@ void ogre_noat_setAssociatedNode(struct hg3dclass_struct * thisclass_c, struct h void ogre_noat_applyToNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * node_c, struct hg3dclass_struct * timeIndex_c, float weight_c, float scale_c); // -void ogre_noat_setUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, int useShortestPath_c); +void ogre_noat_setUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, long useShortestPath_c); // -void ogre_noat_getUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_noat_getUseShortestRotationPath(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_noat_apply(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * timeIndex_c, float weight_c, float scale_c); // -void ogre_noat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_noat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_noat_optimise(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/hBuild/include/ClassRenderSystem.h b/Bindings/Ogre/hBuild/include/ClassRenderSystem.h index 2e54162..612d135 100644 --- a/Bindings/Ogre/hBuild/include/ClassRenderSystem.h +++ b/Bindings/Ogre/hBuild/include/ClassRenderSystem.h @@ -53,13 +53,13 @@ void ogre_rds_shutdown(struct hg3dclass_struct * thisclass_c); void ogre_rds_setAmbientLight(struct hg3dclass_struct * thisclass_c, float r_c, float g_c, float b_c); // -void ogre_rds_setLightingEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_rds_setLightingEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_rds_setWBufferEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_rds_setWBufferEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_rds_getWBufferEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_getWBufferEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rds_createMultiRenderTarget(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); @@ -83,34 +83,34 @@ void ogre_rds_getRenderTarget(struct hg3dclass_struct * thisclass_c, char * name void ogre_rds_detachRenderTarget(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_rds_getErrorDescription(struct hg3dclass_struct * thisclass_c, int errorNumber_c, char * result_c); +void ogre_rds_getErrorDescription(struct hg3dclass_struct * thisclass_c, long errorNumber_c, char * result_c); // -void ogre_rds_setWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_rds_setWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_rds_getWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_getWaitForVerticalBlank(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rds_getGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_getGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rds_setGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, const int val_c); +void ogre_rds_setGlobalNumberOfInstances(struct hg3dclass_struct * thisclass_c, const long val_c); // void ogre_rds_setDepthBufferFor(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * renderTarget_c); // -void ogre_rds_areFixedFunctionLightsInViewSpace(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_areFixedFunctionLightsInViewSpace(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rds_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned int * pDest_c); +void ogre_rds_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned long * pDest_c); // -void ogre_rds_setStencilCheckEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_rds_setStencilCheckEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_rds_setNormaliseNormals(struct hg3dclass_struct * thisclass_c, int normalise_c); +void ogre_rds_setNormaliseNormals(struct hg3dclass_struct * thisclass_c, long normalise_c); // void ogre_rds_bindGpuProgramPassIterationParameters(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c); @@ -119,7 +119,7 @@ void ogre_rds_bindGpuProgramPassIterationParameters(struct hg3dclass_struct * th void ogre_rds_unbindGpuProgram(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c); // -void ogre_rds_isGpuProgramBound(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c, int * result_c); +void ogre_rds_isGpuProgramBound(struct hg3dclass_struct * thisclass_c, enum EnumGpuProgramType gptype_c, long * result_c); // void ogre_rds_addClipPlane2(struct hg3dclass_struct * thisclass_c, float A_c, float B_c, float C_c, float D_c); @@ -128,16 +128,16 @@ void ogre_rds_addClipPlane2(struct hg3dclass_struct * thisclass_c, float A_c, fl void ogre_rds_resetClipPlanes(struct hg3dclass_struct * thisclass_c); // -void ogre_rds_setInvertVertexWinding(struct hg3dclass_struct * thisclass_c, int invert_c); +void ogre_rds_setInvertVertexWinding(struct hg3dclass_struct * thisclass_c, long invert_c); // -void ogre_rds_getInvertVertexWinding(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rds_getInvertVertexWinding(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rds_setScissorTest(struct hg3dclass_struct * thisclass_c, int enabled_c, int left_c, int top_c, int right_c, int bottom_c); +void ogre_rds_setScissorTest(struct hg3dclass_struct * thisclass_c, long enabled_c, long left_c, long top_c, long right_c, long bottom_c); // -void ogre_rds_clearFrameBuffer(struct hg3dclass_struct * thisclass_c, unsigned int buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c); +void ogre_rds_clearFrameBuffer(struct hg3dclass_struct * thisclass_c, unsigned long buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c); // void ogre_rds_getHorizontalTexelOffset(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -152,10 +152,10 @@ void ogre_rds_getMinimumDepthInputValue(struct hg3dclass_struct * thisclass_c, f void ogre_rds_getMaximumDepthInputValue(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_rds_setCurrentPassIterationCount(struct hg3dclass_struct * thisclass_c, const int count_c); +void ogre_rds_setCurrentPassIterationCount(struct hg3dclass_struct * thisclass_c, const long count_c); // -void ogre_rds_setDeriveDepthBias(struct hg3dclass_struct * thisclass_c, int derive_c, float baseValue_c, float multiplier_c, float slopeScale_c); +void ogre_rds_setDeriveDepthBias(struct hg3dclass_struct * thisclass_c, long derive_c, float baseValue_c, float multiplier_c, float slopeScale_c); // void ogre_rds_preExtraThreadsStarted(struct hg3dclass_struct * thisclass_c); @@ -170,7 +170,7 @@ void ogre_rds_registerThread(struct hg3dclass_struct * thisclass_c); void ogre_rds_unregisterThread(struct hg3dclass_struct * thisclass_c); // -void ogre_rds_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rds_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_rds_beginProfileEvent(struct hg3dclass_struct * thisclass_c, char * eventName_c); diff --git a/Bindings/Ogre/hBuild/include/ClassRenderTarget.h b/Bindings/Ogre/hBuild/include/ClassRenderTarget.h index 4d57cff..dd626a9 100644 --- a/Bindings/Ogre/hBuild/include/ClassRenderTarget.h +++ b/Bindings/Ogre/hBuild/include/ClassRenderTarget.h @@ -36,16 +36,16 @@ void ogre_rtgt_destruct(struct hg3dclass_struct * thisclass_c); void ogre_rtgt_getName(struct hg3dclass_struct * thisclass_c, char * result_c); // Retrieve information about the render target. -void ogre_rtgt_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned int * width_c, unsigned int * height_c, unsigned int * colourDepth_c); +void ogre_rtgt_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned long * width_c, unsigned long * height_c, unsigned long * colourDepth_c); // -void ogre_rtgt_getWidth(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rtgt_getWidth(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_rtgt_getHeight(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rtgt_getHeight(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_rtgt_getColourDepth(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rtgt_getColourDepth(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_rtgt_setDepthBufferPool(struct hg3dclass_struct * thisclass_c, unsigned short poolId_c); @@ -57,13 +57,13 @@ void ogre_rtgt_getDepthBufferPool(struct hg3dclass_struct * thisclass_c, unsigne void ogre_rtgt_detachDepthBuffer(struct hg3dclass_struct * thisclass_c); // -void ogre_rtgt_update(struct hg3dclass_struct * thisclass_c, int swapBuffers_c); +void ogre_rtgt_update(struct hg3dclass_struct * thisclass_c, long swapBuffers_c); // -void ogre_rtgt_swapBuffers(struct hg3dclass_struct * thisclass_c, int waitForVSync_c); +void ogre_rtgt_swapBuffers(struct hg3dclass_struct * thisclass_c, long waitForVSync_c); // -void ogre_rtgt_addViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, int ZOrder_c, float left_c, float top_c, float width_c, float height_c, struct hg3dclass_struct * result_c); +void ogre_rtgt_addViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, long ZOrder_c, float left_c, float top_c, float width_c, float height_c, struct hg3dclass_struct * result_c); // void ogre_rtgt_getNumViewports(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); @@ -72,13 +72,13 @@ void ogre_rtgt_getNumViewports(struct hg3dclass_struct * thisclass_c, unsigned s void ogre_rtgt_getViewport(struct hg3dclass_struct * thisclass_c, unsigned short index_c, struct hg3dclass_struct * result_c); // -void ogre_rtgt_getViewportByZOrder(struct hg3dclass_struct * thisclass_c, int ZOrder_c, struct hg3dclass_struct * result_c); +void ogre_rtgt_getViewportByZOrder(struct hg3dclass_struct * thisclass_c, long ZOrder_c, struct hg3dclass_struct * result_c); // -void ogre_rtgt_hasViewportWithZOrder(struct hg3dclass_struct * thisclass_c, int ZOrder_c, int * result_c); +void ogre_rtgt_hasViewportWithZOrder(struct hg3dclass_struct * thisclass_c, long ZOrder_c, long * result_c); // -void ogre_rtgt_removeViewport(struct hg3dclass_struct * thisclass_c, int ZOrder_c); +void ogre_rtgt_removeViewport(struct hg3dclass_struct * thisclass_c, long ZOrder_c); // void ogre_rtgt_removeAllViewports(struct hg3dclass_struct * thisclass_c); @@ -111,16 +111,16 @@ void ogre_rtgt_resetStatistics(struct hg3dclass_struct * thisclass_c); void ogre_rtgt_removeAllListeners(struct hg3dclass_struct * thisclass_c); // -void ogre_rtgt_isActive(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_isActive(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_setActive(struct hg3dclass_struct * thisclass_c, int state_c); +void ogre_rtgt_setActive(struct hg3dclass_struct * thisclass_c, long state_c); // -void ogre_rtgt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, int autoupdate_c); +void ogre_rtgt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, long autoupdate_c); // -void ogre_rtgt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rtgt_writeContentsToFile(struct hg3dclass_struct * thisclass_c, char * filename_c); @@ -129,22 +129,22 @@ void ogre_rtgt_writeContentsToFile(struct hg3dclass_struct * thisclass_c, char * void ogre_rtgt_writeContentsToTimestampedFile(struct hg3dclass_struct * thisclass_c, char * filenamePrefix_c, char * filenameSuffix_c, char * result_c); // -void ogre_rtgt_requiresTextureFlipping(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_requiresTextureFlipping(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_getTriangleCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_getTriangleCount(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_getBatchCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_getBatchCount(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_isPrimary(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_isPrimary(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_isHardwareGammaEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rtgt_isHardwareGammaEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rtgt_getFSAA(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rtgt_getFSAA(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_rtgt_getFSAAHint(struct hg3dclass_struct * thisclass_c, char * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassRenderWindow.h b/Bindings/Ogre/hBuild/include/ClassRenderWindow.h index 689b8af..936e5a6 100644 --- a/Bindings/Ogre/hBuild/include/ClassRenderWindow.h +++ b/Bindings/Ogre/hBuild/include/ClassRenderWindow.h @@ -28,63 +28,63 @@ // -void ogre_rw_setFullscreen(struct hg3dclass_struct * thisclass_c, int fullScreen_c, unsigned int width_c, unsigned int height_c); +void ogre_rw_setFullscreen(struct hg3dclass_struct * thisclass_c, long fullScreen_c, unsigned long width_c, unsigned long height_c); // void ogre_rw_destroy(struct hg3dclass_struct * thisclass_c); // -void ogre_rw_resize(struct hg3dclass_struct * thisclass_c, unsigned int width_c, unsigned int height_c); +void ogre_rw_resize(struct hg3dclass_struct * thisclass_c, unsigned long width_c, unsigned long height_c); // void ogre_rw_windowMovedOrResized(struct hg3dclass_struct * thisclass_c); // -void ogre_rw_reposition(struct hg3dclass_struct * thisclass_c, int left_c, int top_c); +void ogre_rw_reposition(struct hg3dclass_struct * thisclass_c, long left_c, long top_c); // -void ogre_rw_isVisible(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isVisible(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c); +void ogre_rw_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c); // -void ogre_rw_isHidden(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isHidden(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_setHidden(struct hg3dclass_struct * thisclass_c, int hidden_c); +void ogre_rw_setHidden(struct hg3dclass_struct * thisclass_c, long hidden_c); // -void ogre_rw_setVSyncEnabled(struct hg3dclass_struct * thisclass_c, int vsync_c); +void ogre_rw_setVSyncEnabled(struct hg3dclass_struct * thisclass_c, long vsync_c); // -void ogre_rw_isVSyncEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isVSyncEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_setVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned int interval_c); +void ogre_rw_setVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned long interval_c); // -void ogre_rw_getVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rw_getVSyncInterval(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_rw_isActive(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isActive(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_isClosed(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isClosed(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_isPrimary(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isPrimary(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_isFullScreen(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isFullScreen(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned int * width_c, unsigned int * height_c, unsigned int * colourDepth_c, int * left_c, int * top_c); +void ogre_rw_getMetrics(struct hg3dclass_struct * thisclass_c, unsigned long * width_c, unsigned long * height_c, unsigned long * colourDepth_c, long * left_c, long * top_c); // -void ogre_rw_isDeactivatedOnFocusChange(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rw_isDeactivatedOnFocusChange(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rw_setDeactivateOnFocusChange(struct hg3dclass_struct * thisclass_c, int deactivate_c); +void ogre_rw_setDeactivateOnFocusChange(struct hg3dclass_struct * thisclass_c, long deactivate_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassRenderable.h b/Bindings/Ogre/hBuild/include/ClassRenderable.h index 3f5c02c..94a242a 100644 --- a/Bindings/Ogre/hBuild/include/ClassRenderable.h +++ b/Bindings/Ogre/hBuild/include/ClassRenderable.h @@ -38,7 +38,7 @@ void ogre_rndl_destruct(struct hg3dclass_struct * thisclass_c); void ogre_rndl_getMaterial(struct hg3dclass_struct * thisclass_c, struct sharedptr_struct * result_c); // -void ogre_rndl_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, int * result_c); +void ogre_rndl_preRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c, long * result_c); // void ogre_rndl_postRender(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * sm_c, struct hg3dclass_struct * rsys_c); @@ -47,33 +47,33 @@ void ogre_rndl_postRender(struct hg3dclass_struct * thisclass_c, struct hg3dclas void ogre_rndl_getNumWorldTransforms(struct hg3dclass_struct * thisclass_c, unsigned short * result_c); // -void ogre_rndl_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int useIdentityProjection_c); +void ogre_rndl_setUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long useIdentityProjection_c); // -void ogre_rndl_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rndl_getUseIdentityProjection(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rndl_setUseIdentityView(struct hg3dclass_struct * thisclass_c, int useIdentityView_c); +void ogre_rndl_setUseIdentityView(struct hg3dclass_struct * thisclass_c, long useIdentityView_c); // -void ogre_rndl_getUseIdentityView(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rndl_getUseIdentityView(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rndl_getSquaredViewDepth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c, float * result_c); // -void ogre_rndl_getCastsShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rndl_getCastsShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rndl_removeCustomParameter(struct hg3dclass_struct * thisclass_c, int index_c); +void ogre_rndl_removeCustomParameter(struct hg3dclass_struct * thisclass_c, long index_c); // -void ogre_rndl_hasCustomParameter(struct hg3dclass_struct * thisclass_c, int index_c, int * result_c); +void ogre_rndl_hasCustomParameter(struct hg3dclass_struct * thisclass_c, long index_c, long * result_c); // -void ogre_rndl_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int override_c); +void ogre_rndl_setPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long override_c); // -void ogre_rndl_getPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rndl_getPolygonModeOverrideable(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassResource.h b/Bindings/Ogre/hBuild/include/ClassResource.h index af9b138..a72b7fb 100644 --- a/Bindings/Ogre/hBuild/include/ClassResource.h +++ b/Bindings/Ogre/hBuild/include/ClassResource.h @@ -32,25 +32,25 @@ void ogre_rsrc_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrc_prepare(struct hg3dclass_struct * thisclass_c, int backgroundThread_c); +void ogre_rsrc_prepare(struct hg3dclass_struct * thisclass_c, long backgroundThread_c); // -void ogre_rsrc_load(struct hg3dclass_struct * thisclass_c, int backgroundThread_c); +void ogre_rsrc_load(struct hg3dclass_struct * thisclass_c, long backgroundThread_c); // void ogre_rsrc_reload(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrc_isReloadable(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isReloadable(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_isManuallyLoaded(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isManuallyLoaded(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rsrc_unload(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrc_getSize(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_getSize(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rsrc_touch(struct hg3dclass_struct * thisclass_c); @@ -59,19 +59,19 @@ void ogre_rsrc_touch(struct hg3dclass_struct * thisclass_c); void ogre_rsrc_getName(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_rsrc_isPrepared(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isPrepared(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_isLoaded(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isLoaded(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_isLoading(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isLoading(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_isBackgroundLoaded(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_isBackgroundLoaded(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrc_setBackgroundLoaded(struct hg3dclass_struct * thisclass_c, int bl_c); +void ogre_rsrc_setBackgroundLoaded(struct hg3dclass_struct * thisclass_c, long bl_c); // void ogre_rsrc_escalateLoading(struct hg3dclass_struct * thisclass_c); @@ -89,6 +89,6 @@ void ogre_rsrc_getCreator(struct hg3dclass_struct * thisclass_c, struct hg3dclas void ogre_rsrc_getOrigin(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_rsrc_getStateCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrc_getStateCount(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassResourceGroupManager.h b/Bindings/Ogre/hBuild/include/ClassResourceGroupManager.h index 6fe1403..89a18ab 100644 --- a/Bindings/Ogre/hBuild/include/ClassResourceGroupManager.h +++ b/Bindings/Ogre/hBuild/include/ClassResourceGroupManager.h @@ -35,7 +35,7 @@ void ogre_rgmgr_construct(struct hg3dclass_struct * result_c); void ogre_rgmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_rgmgr_createResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, const int inGlobalPool_c); +void ogre_rgmgr_createResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, const long inGlobalPool_c); // void ogre_rgmgr_initialiseResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -44,16 +44,16 @@ void ogre_rgmgr_initialiseResourceGroup(struct hg3dclass_struct * thisclass_c, c void ogre_rgmgr_initialiseAllResourceGroups(struct hg3dclass_struct * thisclass_c); // -void ogre_rgmgr_prepareResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int prepareMainResources_c, int prepareWorldGeom_c); +void ogre_rgmgr_prepareResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long prepareMainResources_c, long prepareWorldGeom_c); // -void ogre_rgmgr_loadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int loadMainResources_c, int loadWorldGeom_c); +void ogre_rgmgr_loadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long loadMainResources_c, long loadWorldGeom_c); // -void ogre_rgmgr_unloadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int reloadableOnly_c); +void ogre_rgmgr_unloadResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long reloadableOnly_c); // -void ogre_rgmgr_unloadUnreferencedResourcesInGroup(struct hg3dclass_struct * thisclass_c, char * name_c, int reloadableOnly_c); +void ogre_rgmgr_unloadUnreferencedResourcesInGroup(struct hg3dclass_struct * thisclass_c, char * name_c, long reloadableOnly_c); // void ogre_rgmgr_clearResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -62,31 +62,31 @@ void ogre_rgmgr_clearResourceGroup(struct hg3dclass_struct * thisclass_c, char * void ogre_rgmgr_destroyResourceGroup(struct hg3dclass_struct * thisclass_c, char * name_c); // -void ogre_rgmgr_isResourceGroupInitialised(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rgmgr_isResourceGroupInitialised(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // -void ogre_rgmgr_isResourceGroupLoaded(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rgmgr_isResourceGroupLoaded(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // -void ogre_rgmgr_resourceGroupExists(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rgmgr_resourceGroupExists(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // -void ogre_rgmgr_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * resGroup_c, int recursive_c); +void ogre_rgmgr_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * resGroup_c, long recursive_c); // void ogre_rgmgr_removeResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * resGroup_c); // -void ogre_rgmgr_resourceLocationExists(struct hg3dclass_struct * thisclass_c, char * name_c, char * resGroup_c, int * result_c); +void ogre_rgmgr_resourceLocationExists(struct hg3dclass_struct * thisclass_c, char * name_c, char * resGroup_c, long * result_c); // void ogre_rgmgr_undeclareResource(struct hg3dclass_struct * thisclass_c, char * name_c, char * groupName_c); // -void ogre_rgmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * group_c, char * filename_c, int * result_c); +void ogre_rgmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * group_c, char * filename_c, long * result_c); // -void ogre_rgmgr_resourceExistsInAnyGroup(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c); +void ogre_rgmgr_resourceExistsInAnyGroup(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c); // void ogre_rgmgr_findGroupContainingResource(struct hg3dclass_struct * thisclass_c, char * filename_c, char * result_c); @@ -110,7 +110,7 @@ void ogre_rgmgr_linkWorldGeometryToResourceGroup(struct hg3dclass_struct * thisc void ogre_rgmgr_unlinkWorldGeometryFromResourceGroup(struct hg3dclass_struct * thisclass_c, char * group_c); // -void ogre_rgmgr_isResourceGroupInGlobalPool(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rgmgr_isResourceGroupInGlobalPool(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_rgmgr_shutdownAll(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/hBuild/include/ClassResourceManager.h b/Bindings/Ogre/hBuild/include/ClassResourceManager.h index 9ead609..461e339 100644 --- a/Bindings/Ogre/hBuild/include/ClassResourceManager.h +++ b/Bindings/Ogre/hBuild/include/ClassResourceManager.h @@ -31,28 +31,28 @@ void ogre_rsrcmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrcmgr_setMemoryBudget(struct hg3dclass_struct * thisclass_c, int bytes_c); +void ogre_rsrcmgr_setMemoryBudget(struct hg3dclass_struct * thisclass_c, long bytes_c); // -void ogre_rsrcmgr_getMemoryBudget(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrcmgr_getMemoryBudget(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rsrcmgr_getMemoryUsage(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrcmgr_getMemoryUsage(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rsrcmgr_unload(struct hg3dclass_struct * thisclass_c, char * name_c); // -void ogre_rsrcmgr_unloadAll(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_unloadAll(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // -void ogre_rsrcmgr_reloadAll(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_reloadAll(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // -void ogre_rsrcmgr_unloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_unloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // -void ogre_rsrcmgr_reloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_reloadUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // void ogre_rsrcmgr_remove2(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -61,10 +61,10 @@ void ogre_rsrcmgr_remove2(struct hg3dclass_struct * thisclass_c, char * name_c); void ogre_rsrcmgr_removeAll(struct hg3dclass_struct * thisclass_c); // -void ogre_rsrcmgr_removeUnreferencedResources(struct hg3dclass_struct * thisclass_c, int reloadableOnly_c); +void ogre_rsrcmgr_removeUnreferencedResources(struct hg3dclass_struct * thisclass_c, long reloadableOnly_c); // Returns whether the named resource exists in this manager. -void ogre_rsrcmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_rsrcmgr_resourceExists(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_rsrcmgr_getLoadingOrder(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -73,10 +73,10 @@ void ogre_rsrcmgr_getLoadingOrder(struct hg3dclass_struct * thisclass_c, float * void ogre_rsrcmgr_getResourceType(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_rsrcmgr_setVerbose(struct hg3dclass_struct * thisclass_c, int v_c); +void ogre_rsrcmgr_setVerbose(struct hg3dclass_struct * thisclass_c, long v_c); // -void ogre_rsrcmgr_getVerbose(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rsrcmgr_getVerbose(struct hg3dclass_struct * thisclass_c, long * result_c); // Destroy a resource pool. void ogre_rsrcmgr_destroyResourcePool2(struct hg3dclass_struct * thisclass_c, char * name_c); diff --git a/Bindings/Ogre/hBuild/include/ClassRoot.h b/Bindings/Ogre/hBuild/include/ClassRoot.h index 6c87e89..1a26187 100644 --- a/Bindings/Ogre/hBuild/include/ClassRoot.h +++ b/Bindings/Ogre/hBuild/include/ClassRoot.h @@ -46,10 +46,10 @@ void ogre_rt_destruct(struct hg3dclass_struct * thisclass_c); void ogre_rt_saveConfig(struct hg3dclass_struct * thisclass_c); // -void ogre_rt_restoreConfig(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_restoreConfig(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_showConfigDialog(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_showConfigDialog(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rt_addRenderSystem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * newRend_c); @@ -64,16 +64,16 @@ void ogre_rt_setRenderSystem(struct hg3dclass_struct * thisclass_c, struct hg3dc void ogre_rt_getRenderSystem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_rt_initialise(struct hg3dclass_struct * thisclass_c, int autoCreateWindow_c, char * windowTitle_c, char * customCapabilitiesConfig_c, struct hg3dclass_struct * result_c); +void ogre_rt_initialise(struct hg3dclass_struct * thisclass_c, long autoCreateWindow_c, char * windowTitle_c, char * customCapabilitiesConfig_c, struct hg3dclass_struct * result_c); // -void ogre_rt_isInitialised(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_isInitialised(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_getRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_getRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_setRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, int r_c); +void ogre_rt_setRemoveRenderQueueStructuresOnClear(struct hg3dclass_struct * thisclass_c, long r_c); // void ogre_rt_addSceneManagerFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c); @@ -91,7 +91,7 @@ void ogre_rt_destroySceneManager(struct hg3dclass_struct * thisclass_c, struct h void ogre_rt_getSceneManager(struct hg3dclass_struct * thisclass_c, char * instanceName_c, struct hg3dclass_struct * result_c); // -void ogre_rt_hasSceneManager(struct hg3dclass_struct * thisclass_c, char * instanceName_c, int * result_c); +void ogre_rt_hasSceneManager(struct hg3dclass_struct * thisclass_c, char * instanceName_c, long * result_c); // void ogre_rt_getTextureManager(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -100,7 +100,7 @@ void ogre_rt_getTextureManager(struct hg3dclass_struct * thisclass_c, struct hg3 void ogre_rt_getMeshManager(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_rt_getErrorDescription(struct hg3dclass_struct * thisclass_c, int errorNumber_c, char * result_c); +void ogre_rt_getErrorDescription(struct hg3dclass_struct * thisclass_c, long errorNumber_c, char * result_c); // void ogre_rt_queueEndRendering(struct hg3dclass_struct * thisclass_c); @@ -109,22 +109,22 @@ void ogre_rt_queueEndRendering(struct hg3dclass_struct * thisclass_c); void ogre_rt_startRendering(struct hg3dclass_struct * thisclass_c); // -void ogre_rt_renderOneFrame(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_renderOneFrame(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_renderOneFrame2(struct hg3dclass_struct * thisclass_c, float timeSinceLastFrame_c, int * result_c); +void ogre_rt_renderOneFrame2(struct hg3dclass_struct * thisclass_c, float timeSinceLastFrame_c, long * result_c); // void ogre_rt_shutdown(struct hg3dclass_struct * thisclass_c); // -void ogre_rt_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * groupName_c, int recursive_c); +void ogre_rt_addResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * locType_c, char * groupName_c, long recursive_c); // void ogre_rt_removeResourceLocation(struct hg3dclass_struct * thisclass_c, char * name_c, char * groupName_c); // -void ogre_rt_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned int * pDest_c); +void ogre_rt_convertColourValue(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c, unsigned long * pDest_c); // void ogre_rt_getAutoCreatedWindow(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -150,6 +150,9 @@ void ogre_rt_loadPlugin(struct hg3dclass_struct * thisclass_c, char * pluginName // void ogre_rt_unloadPlugin(struct hg3dclass_struct * thisclass_c, char * pluginName_c); +// +void ogre_rt_getNextFrameNumber(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); + // void ogre_rt_destroyRenderQueueInvocationSequence(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -166,31 +169,31 @@ void ogre_rt_setFrameSmoothingPeriod(struct hg3dclass_struct * thisclass_c, floa void ogre_rt_getFrameSmoothingPeriod(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_rt_addMovableObjectFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c, int overrideExisting_c); +void ogre_rt_addMovableObjectFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c, long overrideExisting_c); // void ogre_rt_removeMovableObjectFactory(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * fact_c); // Checks whether a factory is registered for a given MovableObject -void ogre_rt_hasMovableObjectFactory(struct hg3dclass_struct * thisclass_c, char * typeName_c, int * result_c); +void ogre_rt_hasMovableObjectFactory(struct hg3dclass_struct * thisclass_c, char * typeName_c, long * result_c); // Get a MovableObjectFactory void ogre_rt_getMovableObjectFactory(struct hg3dclass_struct * thisclass_c, char * typeName_c, struct hg3dclass_struct * result_c); // -void ogre_rt_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_rt_getDisplayMonitorCount(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_rt_setBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, int redundant_c); +void ogre_rt_setBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, long redundant_c); // -void ogre_rt_isBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_isBlendIndicesGpuRedundant(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_rt_setBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, int redundant_c); +void ogre_rt_setBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, long redundant_c); // -void ogre_rt_isBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_rt_isBlendWeightsGpuRedundant(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_rt_setDefaultMinPixelSize(struct hg3dclass_struct * thisclass_c, float pixelSize_c); diff --git a/Bindings/Ogre/hBuild/include/ClassSceneManager.h b/Bindings/Ogre/hBuild/include/ClassSceneManager.h index 1155fde..7238f1a 100644 --- a/Bindings/Ogre/hBuild/include/ClassSceneManager.h +++ b/Bindings/Ogre/hBuild/include/ClassSceneManager.h @@ -61,7 +61,7 @@ void ogre_scmgr_createCamera(struct hg3dclass_struct * thisclass_c, char * name_ void ogre_scmgr_getCamera(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasCamera(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasCamera(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyCamera(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c); @@ -82,7 +82,7 @@ void ogre_scmgr_createLight2(struct hg3dclass_struct * thisclass_c, struct hg3dc void ogre_scmgr_getLight(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasLight(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasLight(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyLight(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -112,7 +112,7 @@ void ogre_scmgr_getRootSceneNode(struct hg3dclass_struct * thisclass_c, struct h void ogre_scmgr_getSceneNode(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasSceneNode(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasSceneNode(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_createEntity(struct hg3dclass_struct * thisclass_c, char * entityName_c, char * meshName_c, char * groupName_c, struct hg3dclass_struct * result_c); @@ -136,7 +136,7 @@ void ogre_scmgr_createEntity6(struct hg3dclass_struct * thisclass_c, enum EnumSc void ogre_scmgr_getEntity(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasEntity(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasEntity(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyEntity(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * ent_c); @@ -157,7 +157,7 @@ void ogre_scmgr_createManualObject2(struct hg3dclass_struct * thisclass_c, struc void ogre_scmgr_getManualObject(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasManualObject(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasManualObject(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyManualObject(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * obj_c); @@ -178,7 +178,7 @@ void ogre_scmgr_createBillboardChain2(struct hg3dclass_struct * thisclass_c, str void ogre_scmgr_getBillboardChain(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasBillboardChain(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasBillboardChain(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyBillboardChain(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * obj_c); @@ -190,7 +190,7 @@ void ogre_scmgr_destroyBillboardChain2(struct hg3dclass_struct * thisclass_c, ch void ogre_scmgr_destroyAllBillboardChains(struct hg3dclass_struct * thisclass_c); // -void ogre_scmgr_hasRibbonTrail(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasRibbonTrail(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyRibbonTrail2(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -199,7 +199,7 @@ void ogre_scmgr_destroyRibbonTrail2(struct hg3dclass_struct * thisclass_c, char void ogre_scmgr_destroyAllRibbonTrails(struct hg3dclass_struct * thisclass_c); // -void ogre_scmgr_hasParticleSystem(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasParticleSystem(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyParticleSystem2(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -223,40 +223,40 @@ void ogre_scmgr_prepareWorldGeometry(struct hg3dclass_struct * thisclass_c, char void ogre_scmgr_setWorldGeometry(struct hg3dclass_struct * thisclass_c, char * filename_c); // -void ogre_scmgr_estimateWorldGeometry(struct hg3dclass_struct * thisclass_c, char * filename_c, int * result_c); +void ogre_scmgr_estimateWorldGeometry(struct hg3dclass_struct * thisclass_c, char * filename_c, long * result_c); // -void ogre_scmgr_hasOption(struct hg3dclass_struct * thisclass_c, char * strKey_c, int * result_c); +void ogre_scmgr_hasOption(struct hg3dclass_struct * thisclass_c, char * strKey_c, long * result_c); // -void ogre_scmgr_setSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_scmgr_setSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_scmgr_isSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isSkyPlaneEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_getSkyPlaneNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_setSkyBox(struct hg3dclass_struct * thisclass_c, int enable_c, char * materialName_c, float distance_c, int drawFirst_c, struct quaternion_struct * orientation_c, char * groupName_c); +void ogre_scmgr_setSkyBox(struct hg3dclass_struct * thisclass_c, long enable_c, char * materialName_c, float distance_c, long drawFirst_c, struct quaternion_struct * orientation_c, char * groupName_c); // -void ogre_scmgr_setSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_scmgr_setSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_scmgr_isSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isSkyBoxEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_getSkyBoxNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_setSkyDome(struct hg3dclass_struct * thisclass_c, int enable_c, char * materialName_c, float curvature_c, float tiling_c, float distance_c, int drawFirst_c, struct quaternion_struct * orientation_c, int xsegments_c, int ysegments_c, int ysegments_keep_c, char * groupName_c); +void ogre_scmgr_setSkyDome(struct hg3dclass_struct * thisclass_c, long enable_c, char * materialName_c, float curvature_c, float tiling_c, float distance_c, long drawFirst_c, struct quaternion_struct * orientation_c, long xsegments_c, long ysegments_c, long ysegments_keep_c, char * groupName_c); // -void ogre_scmgr_setSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_scmgr_setSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_scmgr_isSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isSkyDomeEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_getSkyDomeNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -274,16 +274,16 @@ void ogre_scmgr_getFogEnd(struct hg3dclass_struct * thisclass_c, float * result_ void ogre_scmgr_getFogDensity(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_scmgr_createBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, unsigned int poolSize_c, struct hg3dclass_struct * result_c); +void ogre_scmgr_createBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, unsigned long poolSize_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_createBillboardSet2(struct hg3dclass_struct * thisclass_c, unsigned int poolSize_c, struct hg3dclass_struct * result_c); +void ogre_scmgr_createBillboardSet2(struct hg3dclass_struct * thisclass_c, unsigned long poolSize_c, struct hg3dclass_struct * result_c); // void ogre_scmgr_getBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasBillboardSet(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyBillboardSet(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * set_c); @@ -295,10 +295,10 @@ void ogre_scmgr_destroyBillboardSet2(struct hg3dclass_struct * thisclass_c, char void ogre_scmgr_destroyAllBillboardSets(struct hg3dclass_struct * thisclass_c); // -void ogre_scmgr_setDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, int display_c); +void ogre_scmgr_setDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, long display_c); // -void ogre_scmgr_getDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getDisplaySceneNodes(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_createAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, float length_c, struct hg3dclass_struct * result_c); @@ -307,7 +307,7 @@ void ogre_scmgr_createAnimation(struct hg3dclass_struct * thisclass_c, char * na void ogre_scmgr_getAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyAnimation(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -322,7 +322,7 @@ void ogre_scmgr_createAnimationState(struct hg3dclass_struct * thisclass_c, char void ogre_scmgr_getAnimationState(struct hg3dclass_struct * thisclass_c, char * animName_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyAnimationState(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -340,16 +340,16 @@ void ogre_scmgr_setSpecialCaseRenderQueueMode(struct hg3dclass_struct * thisclas void ogre_scmgr_getSpecialCaseRenderQueueMode(struct hg3dclass_struct * thisclass_c, enum EnumSceneManagerSpecialCaseRenderQueueMode * result_c); // -void ogre_scmgr_showBoundingBoxes(struct hg3dclass_struct * thisclass_c, int bShow_c); +void ogre_scmgr_showBoundingBoxes(struct hg3dclass_struct * thisclass_c, long bShow_c); // -void ogre_scmgr_getShowBoundingBoxes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShowBoundingBoxes(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setShowDebugShadows(struct hg3dclass_struct * thisclass_c, int debug_c); +void ogre_scmgr_setShowDebugShadows(struct hg3dclass_struct * thisclass_c, long debug_c); // -void ogre_scmgr_getShowDebugShadows(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShowDebugShadows(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_setShadowColour(struct hg3dclass_struct * thisclass_c, struct colourvalue_struct * colour_c); @@ -373,10 +373,10 @@ void ogre_scmgr_getShadowFarDistance(struct hg3dclass_struct * thisclass_c, floa void ogre_scmgr_getShadowFarDistanceSquared(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_scmgr_setShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, int size_c); +void ogre_scmgr_setShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, long size_c); // Get the size of the shadow index buffer. -void ogre_scmgr_getShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowIndexBufferSize(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_setShadowTextureSize(struct hg3dclass_struct * thisclass_c, unsigned short size_c); @@ -385,19 +385,19 @@ void ogre_scmgr_setShadowTextureSize(struct hg3dclass_struct * thisclass_c, unsi void ogre_scmgr_setShadowTextureFSAA(struct hg3dclass_struct * thisclass_c, unsigned short fsaa_c); // -void ogre_scmgr_setShadowTextureCount(struct hg3dclass_struct * thisclass_c, int count_c); +void ogre_scmgr_setShadowTextureCount(struct hg3dclass_struct * thisclass_c, long count_c); // Get the number of the textures allocated for texture based shadows. -void ogre_scmgr_getShadowTextureCount(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowTextureCount(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, int count_c); +void ogre_scmgr_setShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, long count_c); // Get the number of shadow textures is assigned for the given light type. -void ogre_scmgr_getShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, int * result_c); +void ogre_scmgr_getShadowTextureCountPerLightType(struct hg3dclass_struct * thisclass_c, enum EnumLightType type_c, long * result_c); // -void ogre_scmgr_getShadowTexture(struct hg3dclass_struct * thisclass_c, int shadowIndex_c, struct sharedptr_struct * result_c); +void ogre_scmgr_getShadowTexture(struct hg3dclass_struct * thisclass_c, long shadowIndex_c, struct sharedptr_struct * result_c); // void ogre_scmgr_setShadowDirLightTextureOffset(struct hg3dclass_struct * thisclass_c, float offset_c); @@ -412,10 +412,10 @@ void ogre_scmgr_setShadowTextureFadeStart(struct hg3dclass_struct * thisclass_c, void ogre_scmgr_setShadowTextureFadeEnd(struct hg3dclass_struct * thisclass_c, float fadeEnd_c); // -void ogre_scmgr_setShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, int selfShadow_c); +void ogre_scmgr_setShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, long selfShadow_c); // Gets whether or not texture shadows attempt to self-shadow. -void ogre_scmgr_getShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowTextureSelfShadow(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_setShadowTextureCasterMaterial(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -424,46 +424,46 @@ void ogre_scmgr_setShadowTextureCasterMaterial(struct hg3dclass_struct * thiscla void ogre_scmgr_setShadowTextureReceiverMaterial(struct hg3dclass_struct * thisclass_c, char * name_c); // -void ogre_scmgr_setShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, int bf_c); +void ogre_scmgr_setShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, long bf_c); // -void ogre_scmgr_getShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowCasterRenderBackFaces(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setShadowUseInfiniteFarPlane(struct hg3dclass_struct * thisclass_c, int enable_c); +void ogre_scmgr_setShadowUseInfiniteFarPlane(struct hg3dclass_struct * thisclass_c, long enable_c); // -void ogre_scmgr_isShadowTechniqueStencilBased(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueStencilBased(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueTextureBased(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueTextureBased(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueModulative(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueModulative(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueAdditive(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueAdditive(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueIntegrated(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueIntegrated(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_isShadowTechniqueInUse(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isShadowTechniqueInUse(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_scmgr_setShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_scmgr_getShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getShadowUseLightClipPlanes(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setLateMaterialResolving(struct hg3dclass_struct * thisclass_c, int isLate_c); +void ogre_scmgr_setLateMaterialResolving(struct hg3dclass_struct * thisclass_c, long isLate_c); // -void ogre_scmgr_isLateMaterialResolving(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_isLateMaterialResolving(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_hasStaticGeometry(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_scmgr_hasStaticGeometry(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_scmgr_destroyStaticGeometry2(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -478,7 +478,7 @@ void ogre_scmgr_destroyInstancedGeometry2(struct hg3dclass_struct * thisclass_c, void ogre_scmgr_destroyAllInstancedGeometry(struct hg3dclass_struct * thisclass_c); // -void ogre_scmgr_hasInstanceManager(struct hg3dclass_struct * thisclass_c, char * managerName_c, int * result_c); +void ogre_scmgr_hasInstanceManager(struct hg3dclass_struct * thisclass_c, char * managerName_c, long * result_c); // void ogre_scmgr_destroyInstanceManager(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -502,7 +502,7 @@ void ogre_scmgr_destroyAllMovableObjects(struct hg3dclass_struct * thisclass_c); void ogre_scmgr_getMovableObject(struct hg3dclass_struct * thisclass_c, char * name_c, char * typeName_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_hasMovableObject(struct hg3dclass_struct * thisclass_c, char * name_c, char * typeName_c, int * result_c); +void ogre_scmgr_hasMovableObject(struct hg3dclass_struct * thisclass_c, char * name_c, char * typeName_c, long * result_c); // void ogre_scmgr_injectMovableObject(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * m_c); @@ -517,28 +517,28 @@ void ogre_scmgr_extractMovableObject2(struct hg3dclass_struct * thisclass_c, str void ogre_scmgr_extractAllMovableObjectsByType(struct hg3dclass_struct * thisclass_c, char * typeName_c); // -void ogre_scmgr_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int vmask_c); +void ogre_scmgr_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long vmask_c); // -void ogre_scmgr_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_scmgr_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_scmgr_setFindVisibleObjects(struct hg3dclass_struct * thisclass_c, int find_c); +void ogre_scmgr_setFindVisibleObjects(struct hg3dclass_struct * thisclass_c, long find_c); // -void ogre_scmgr_getFindVisibleObjects(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getFindVisibleObjects(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, int n_c); +void ogre_scmgr_setNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, long n_c); // -void ogre_scmgr_getNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getNormaliseNormalsOnScale(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_scmgr_setFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, int n_c); +void ogre_scmgr_setFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, long n_c); // -void ogre_scmgr_getFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getFlipCullingOnNegativeScale(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_scmgr_getDestinationRenderSystem(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -547,9 +547,9 @@ void ogre_scmgr_getDestinationRenderSystem(struct hg3dclass_struct * thisclass_c void ogre_scmgr_getCurrentViewport(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_scmgr_setCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, int rel_c); +void ogre_scmgr_setCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, long rel_c); // -void ogre_scmgr_getCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_scmgr_getCameraRelativeRendering(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassSceneNode.h b/Bindings/Ogre/hBuild/include/ClassSceneNode.h index e3c1459..9a05d58 100644 --- a/Bindings/Ogre/hBuild/include/ClassSceneNode.h +++ b/Bindings/Ogre/hBuild/include/ClassSceneNode.h @@ -59,7 +59,7 @@ void ogre_sn_detachObject3(struct hg3dclass_struct * thisclass_c, char * name_c, void ogre_sn_detachAllObjects(struct hg3dclass_struct * thisclass_c); // -void ogre_sn_isInSceneGraph(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_sn_isInSceneGraph(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_sn_getCreator(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -74,13 +74,13 @@ void ogre_sn_removeAndDestroyChild2(struct hg3dclass_struct * thisclass_c, unsig void ogre_sn_removeAndDestroyAllChildren(struct hg3dclass_struct * thisclass_c); // -void ogre_sn_showBoundingBox(struct hg3dclass_struct * thisclass_c, int bShow_c); +void ogre_sn_showBoundingBox(struct hg3dclass_struct * thisclass_c, long bShow_c); // -void ogre_sn_hideBoundingBox(struct hg3dclass_struct * thisclass_c, int bHide_c); +void ogre_sn_hideBoundingBox(struct hg3dclass_struct * thisclass_c, long bHide_c); // -void ogre_sn_getShowBoundingBox(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_sn_getShowBoundingBox(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_sn_createChildSceneNode(struct hg3dclass_struct * thisclass_c, struct vector3_struct * translate_c, struct quaternion_struct * rotate_c, struct hg3dclass_struct * result_c); @@ -89,7 +89,7 @@ void ogre_sn_createChildSceneNode(struct hg3dclass_struct * thisclass_c, struct void ogre_sn_createChildSceneNode2(struct hg3dclass_struct * thisclass_c, char * name_c, struct vector3_struct * translate_c, struct quaternion_struct * rotate_c, struct hg3dclass_struct * result_c); // -void ogre_sn_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, int useFixed_c, struct vector3_struct * fixedAxis_c); +void ogre_sn_setFixedYawAxis(struct hg3dclass_struct * thisclass_c, long useFixed_c, struct vector3_struct * fixedAxis_c); // void ogre_sn_getAutoTrackTarget(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -104,12 +104,12 @@ void ogre_sn_getAutoTrackLocalDirection(struct hg3dclass_struct * thisclass_c, s void ogre_sn_getParentSceneNode(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); // -void ogre_sn_setVisible(struct hg3dclass_struct * thisclass_c, int visible_c, int cascade_c); +void ogre_sn_setVisible(struct hg3dclass_struct * thisclass_c, long visible_c, long cascade_c); // -void ogre_sn_flipVisibility(struct hg3dclass_struct * thisclass_c, int cascade_c); +void ogre_sn_flipVisibility(struct hg3dclass_struct * thisclass_c, long cascade_c); // -void ogre_sn_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c, int cascade_c); +void ogre_sn_setDebugDisplayEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c, long cascade_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassSkeleton.h b/Bindings/Ogre/hBuild/include/ClassSkeleton.h index 869684a..1501306 100644 --- a/Bindings/Ogre/hBuild/include/ClassSkeleton.h +++ b/Bindings/Ogre/hBuild/include/ClassSkeleton.h @@ -59,13 +59,13 @@ void ogre_skl_getBone(struct hg3dclass_struct * thisclass_c, unsigned short hand void ogre_skl_getBone2(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_skl_hasBone(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_skl_hasBone(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_skl_setBindingPose(struct hg3dclass_struct * thisclass_c); // -void ogre_skl_reset(struct hg3dclass_struct * thisclass_c, int resetManualBones_c); +void ogre_skl_reset(struct hg3dclass_struct * thisclass_c, long resetManualBones_c); // void ogre_skl_createAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, float length_c, struct hg3dclass_struct * result_c); @@ -74,7 +74,7 @@ void ogre_skl_createAnimation(struct hg3dclass_struct * thisclass_c, char * name void ogre_skl_getAnimation2(struct hg3dclass_struct * thisclass_c, char * name_c, struct hg3dclass_struct * result_c); // -void ogre_skl_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, int * result_c); +void ogre_skl_hasAnimation(struct hg3dclass_struct * thisclass_c, char * name_c, long * result_c); // void ogre_skl_removeAnimation(struct hg3dclass_struct * thisclass_c, char * name_c); @@ -95,7 +95,7 @@ void ogre_skl_getBlendMode(struct hg3dclass_struct * thisclass_c, enum EnumSkele void ogre_skl_setBlendMode(struct hg3dclass_struct * thisclass_c, enum EnumSkeletonAnimationBlendMode state_c); // -void ogre_skl_optimiseAllAnimations(struct hg3dclass_struct * thisclass_c, int preservingIdentityNodeTracks_c); +void ogre_skl_optimiseAllAnimations(struct hg3dclass_struct * thisclass_c, long preservingIdentityNodeTracks_c); // void ogre_skl_addLinkedSkeletonAnimationSource(struct hg3dclass_struct * thisclass_c, char * skelName_c, float scale_c); @@ -104,9 +104,9 @@ void ogre_skl_addLinkedSkeletonAnimationSource(struct hg3dclass_struct * thiscla void ogre_skl_removeAllLinkedSkeletonAnimationSources(struct hg3dclass_struct * thisclass_c); // Have manual bones been modified since the skeleton was last updated? -void ogre_skl_getManualBonesDirty(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_skl_getManualBonesDirty(struct hg3dclass_struct * thisclass_c, long * result_c); // Are there any manually controlled bones? -void ogre_skl_hasManualBones(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_skl_hasManualBones(struct hg3dclass_struct * thisclass_c, long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassTextureManager.h b/Bindings/Ogre/hBuild/include/ClassTextureManager.h index ebf0ddf..98258ed 100644 --- a/Bindings/Ogre/hBuild/include/ClassTextureManager.h +++ b/Bindings/Ogre/hBuild/include/ClassTextureManager.h @@ -31,10 +31,10 @@ void ogre_txmgr_destruct(struct hg3dclass_struct * thisclass_c); // -void ogre_txmgr_setDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, int num_c); +void ogre_txmgr_setDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, long num_c); // -void ogre_txmgr_getDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_txmgr_getDefaultNumMipmaps(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_txmgr_getSingleton(struct hg3dclass_struct * result_c); diff --git a/Bindings/Ogre/hBuild/include/ClassTimeIndex.h b/Bindings/Ogre/hBuild/include/ClassTimeIndex.h index 539b087..b46eece 100644 --- a/Bindings/Ogre/hBuild/include/ClassTimeIndex.h +++ b/Bindings/Ogre/hBuild/include/ClassTimeIndex.h @@ -31,12 +31,12 @@ void ogre_tnx_construct(float timePos_c, struct hg3dclass_struct * result_c); // -void ogre_tnx_hasKeyIndex(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_tnx_hasKeyIndex(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_tnx_getTimePos(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_tnx_getKeyIndex(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_tnx_getKeyIndex(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); #endif diff --git a/Bindings/Ogre/hBuild/include/ClassVertexAnimationTrack.h b/Bindings/Ogre/hBuild/include/ClassVertexAnimationTrack.h index 0a58838..11e5fa4 100644 --- a/Bindings/Ogre/hBuild/include/ClassVertexAnimationTrack.h +++ b/Bindings/Ogre/hBuild/include/ClassVertexAnimationTrack.h @@ -38,7 +38,7 @@ void ogre_vat_construct(struct hg3dclass_struct * parent_c, unsigned short handl void ogre_vat_getAnimationType(struct hg3dclass_struct * thisclass_c, enum EnumVertexAnimationType * result_c); // -void ogre_vat_getVertexAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vat_getVertexAnimationIncludesNormals(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vat_apply(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * timeIndex_c, float weight_c, float scale_c); @@ -50,7 +50,7 @@ void ogre_vat_setTargetMode(struct hg3dclass_struct * thisclass_c, enum EnumVert void ogre_vat_getTargetMode(struct hg3dclass_struct * thisclass_c, enum EnumVertexAnimationTrackTargetMode * result_c); // -void ogre_vat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vat_hasNonZeroKeyFrames(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vat_optimise(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/Ogre/hBuild/include/ClassViewport.h b/Bindings/Ogre/hBuild/include/ClassViewport.h index 0e0b856..0fca961 100644 --- a/Bindings/Ogre/hBuild/include/ClassViewport.h +++ b/Bindings/Ogre/hBuild/include/ClassViewport.h @@ -33,7 +33,7 @@ // -void ogre_vprt_construct(struct hg3dclass_struct * camera_c, struct hg3dclass_struct * target_c, float left_c, float top_c, float width_c, float height_c, int ZOrder_c, struct hg3dclass_struct * result_c); +void ogre_vprt_construct(struct hg3dclass_struct * camera_c, struct hg3dclass_struct * target_c, float left_c, float top_c, float width_c, float height_c, long ZOrder_c, struct hg3dclass_struct * result_c); // void ogre_vprt_destruct(struct hg3dclass_struct * thisclass_c); @@ -42,7 +42,7 @@ void ogre_vprt_destruct(struct hg3dclass_struct * thisclass_c); void ogre_vprt_update(struct hg3dclass_struct * thisclass_c); // -void ogre_vprt_clear(struct hg3dclass_struct * thisclass_c, unsigned int buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c); +void ogre_vprt_clear(struct hg3dclass_struct * thisclass_c, unsigned long buffers_c, struct colourvalue_struct * colour_c, float depth_c, unsigned short stencil_c); // void ogre_vprt_getTarget(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); @@ -54,7 +54,7 @@ void ogre_vprt_getCamera(struct hg3dclass_struct * thisclass_c, struct hg3dclass void ogre_vprt_setCamera(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * cam_c); // -void ogre_vprt_getZOrder(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getZOrder(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vprt_getLeft(struct hg3dclass_struct * thisclass_c, float * result_c); @@ -69,22 +69,22 @@ void ogre_vprt_getWidth(struct hg3dclass_struct * thisclass_c, float * result_c) void ogre_vprt_getHeight(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_vprt_getActualLeft(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getActualLeft(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_getActualTop(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getActualTop(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_getActualWidth(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getActualWidth(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_getActualHeight(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getActualHeight(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vprt_setDimensions(struct hg3dclass_struct * thisclass_c, float left_c, float top_c, float width_c, float height_c); // -void ogre_vprt_setOrientationMode(struct hg3dclass_struct * thisclass_c, enum EnumOrientationMode orientationMode_c, int setDefault_c); +void ogre_vprt_setOrientationMode(struct hg3dclass_struct * thisclass_c, enum EnumOrientationMode orientationMode_c, long setDefault_c); // void ogre_vprt_getOrientationMode(struct hg3dclass_struct * thisclass_c, enum EnumOrientationMode * result_c); @@ -102,19 +102,19 @@ void ogre_vprt_setDepthClear(struct hg3dclass_struct * thisclass_c, float depth_ void ogre_vprt_getDepthClear(struct hg3dclass_struct * thisclass_c, float * result_c); // -void ogre_vprt_setClearEveryFrame(struct hg3dclass_struct * thisclass_c, int clear_c, unsigned int buffers_c); +void ogre_vprt_setClearEveryFrame(struct hg3dclass_struct * thisclass_c, long clear_c, unsigned long buffers_c); // -void ogre_vprt_getClearEveryFrame(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getClearEveryFrame(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_getClearBuffers(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_vprt_getClearBuffers(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // -void ogre_vprt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, int autoupdate_c); +void ogre_vprt_setAutoUpdated(struct hg3dclass_struct * thisclass_c, long autoupdate_c); // -void ogre_vprt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_isAutoUpdated(struct hg3dclass_struct * thisclass_c, long * result_c); // void ogre_vprt_setMaterialScheme(struct hg3dclass_struct * thisclass_c, char * schemeName_c); @@ -123,31 +123,31 @@ void ogre_vprt_setMaterialScheme(struct hg3dclass_struct * thisclass_c, char * s void ogre_vprt_getMaterialScheme(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_vprt_getActualDimensions(struct hg3dclass_struct * thisclass_c, int * left_c, int * top_c, int * width_c, int * height_c); +void ogre_vprt_getActualDimensions(struct hg3dclass_struct * thisclass_c, long * left_c, long * top_c, long * width_c, long * height_c); // -void ogre_vprt_setOverlaysEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_vprt_setOverlaysEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_vprt_getOverlaysEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getOverlaysEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_setSkiesEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_vprt_setSkiesEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_vprt_getSkiesEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getSkiesEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_setShadowsEnabled(struct hg3dclass_struct * thisclass_c, int enabled_c); +void ogre_vprt_setShadowsEnabled(struct hg3dclass_struct * thisclass_c, long enabled_c); // -void ogre_vprt_getShadowsEnabled(struct hg3dclass_struct * thisclass_c, int * result_c); +void ogre_vprt_getShadowsEnabled(struct hg3dclass_struct * thisclass_c, long * result_c); // -void ogre_vprt_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int mask_c); +void ogre_vprt_setVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long mask_c); // -void ogre_vprt_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned int * result_c); +void ogre_vprt_getVisibilityMask(struct hg3dclass_struct * thisclass_c, unsigned long * result_c); // void ogre_vprt_setRenderQueueInvocationSequenceName(struct hg3dclass_struct * thisclass_c, char * sequenceName_c); @@ -156,10 +156,10 @@ void ogre_vprt_setRenderQueueInvocationSequenceName(struct hg3dclass_struct * th void ogre_vprt_getRenderQueueInvocationSequenceName(struct hg3dclass_struct * thisclass_c, char * result_c); // -void ogre_vprt_pointOrientedToScreen(struct hg3dclass_struct * thisclass_c, struct vector2_struct * v_c, int orientationMode_c, struct vector2_struct * outv_c); +void ogre_vprt_pointOrientedToScreen(struct hg3dclass_struct * thisclass_c, struct vector2_struct * v_c, long orientationMode_c, struct vector2_struct * outv_c); // -void ogre_vprt_pointOrientedToScreen2(struct hg3dclass_struct * thisclass_c, float orientedX_c, float orientedY_c, int orientationMode_c, float * screenX_c, float * screenY_c); +void ogre_vprt_pointOrientedToScreen2(struct hg3dclass_struct * thisclass_c, float orientedX_c, float orientedY_c, long orientationMode_c, float * screenX_c, float * screenY_c); // void ogre_vprt_setDefaultOrientationMode(enum EnumOrientationMode orientationMode_c); diff --git a/Bindings/Ogre/hBuild/include/HG3DUtilities.h b/Bindings/Ogre/hBuild/include/HG3DUtilities.h index 4374dcc..273cd61 100644 --- a/Bindings/Ogre/hBuild/include/HG3DUtilities.h +++ b/Bindings/Ogre/hBuild/include/HG3DUtilities.h @@ -23,7 +23,7 @@ limitations under the License. class HG3DUtilities { public: - static unsigned int getWindowHandle(Ogre::RenderWindow *window); + static unsigned long getWindowHandle(Ogre::RenderWindow *window); static void setupCloseEventHandler(Ogre::RenderWindow *window); static int checkQuitReceived(); static void buildTangentVectors(Ogre::Entity *entity); diff --git a/Bindings/Ogre/hBuild/include/OgreDllDefines.h b/Bindings/Ogre/hBuild/include/OgreDllDefines.h index 94d8c92..c4b79df 100644 --- a/Bindings/Ogre/hBuild/include/OgreDllDefines.h +++ b/Bindings/Ogre/hBuild/include/OgreDllDefines.h @@ -16,10 +16,10 @@ // OgreDllDefines.h -#ifndef _HGamer3DOgre032_DLLDEFINES_H_ -#define _HGamer3DOgre032_DLLDEFINES_H_ +#ifndef _HGamer3DOgre040_DLLDEFINES_H_ +#define _HGamer3DOgre040_DLLDEFINES_H_ -/* Cmake will define HGamer3DOgre032_EXPORTS on Windows when it +/* Cmake will define HGamer3DOgre040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DOgre032_EXPORTS) + #if defined(HGamer3DOgre040_EXPORTS) #define Ogre_LIB_EXPORT __declspec(dllexport) #else #define Ogre_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DOgre032_EXPORTS */ + #endif /* HGamer3DOgre040_EXPORTS */ #else /* defined (_WIN32) */ #define Ogre_LIB_EXPORT #endif -#endif /* _HGamer3DOgre032_DLLDEFINES_H_ */ +#endif /* _HGamer3DOgre040_DLLDEFINES_H_ */ diff --git a/Bindings/SDL2/cBuild/SConstruct b/Bindings/SDL2/cBuild/SConstruct index bad888d..e976b87 100644 --- a/Bindings/SDL2/cBuild/SConstruct +++ b/Bindings/SDL2/cBuild/SConstruct @@ -14,7 +14,7 @@ # -# scons file to build HGamer3DSDL2 library, version 0.3.3 +# scons file to build HGamer3DSDL2 library, version 0.4.0 # set environment @@ -31,7 +31,7 @@ libpath = home + "/.HGamer3D/lib" if env["PLATFORM"] == "win32": # on windows, create new environment, which finds MS C-Compiler env = Environment(TARGET_ARCH="x86", MSVC_VERSION="10.0") - env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DSDL2033_EXPORTS /EHsc /MD"}) + env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DSDL2040_EXPORTS /EHsc /MD"}) # set other compile parameters ############################## @@ -40,15 +40,15 @@ if env["PLATFORM"] == "win32": env.Append(CPPPATH=["include","../Deps/include","../Deps/include","../Deps/lib/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3dsdl2033", ["HeaderSDL.cpp","ClassHG3DUtilities.cpp","HeaderSDLEvents.cpp","HeaderSDLKeyboard.cpp","HeaderSDLMouse.cpp","HeaderSDLVideo.cpp","ClassPtr.cpp","HG3DUtilities.cpp"], LIBS = ["SDL2.lib"]) + env.SharedLibrary("hg3dsdl2040", ["HeaderSDLVideo.cpp","HeaderSDLEvents.cpp","HeaderSDLKeyboard.cpp","ClassHG3DUtilities.cpp","HG3DUtilities.cpp","ClassPtr.cpp","HeaderSDLMouse.cpp","HeaderSDL.cpp"], LIBS = ["SDL2.lib"]) env.Alias('install', libpath) - env.Install(libpath, "hg3dsdl2033.dll") + env.Install(libpath, "hg3dsdl2040.dll") else: env.Append(CPPPATH=["include","../Deps/include","../Deps/include","../Deps/lib/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3dsdl2033", ["HeaderSDL.cpp","ClassHG3DUtilities.cpp","HeaderSDLEvents.cpp","HeaderSDLKeyboard.cpp","HeaderSDLMouse.cpp","HeaderSDLVideo.cpp","ClassPtr.cpp","HG3DUtilities.cpp"], LIBS = ["SDL2-2.0","X11"]) + env.SharedLibrary("hg3dsdl2040", ["HeaderSDLVideo.cpp","HeaderSDLEvents.cpp","HeaderSDLKeyboard.cpp","ClassHG3DUtilities.cpp","HG3DUtilities.cpp","ClassPtr.cpp","HeaderSDLMouse.cpp","HeaderSDL.cpp"], LIBS = ["SDL2-2.0","X11"]) env.Alias('install', libpath) - env.Install(libpath, "libhg3dsdl2033.so") + env.Install(libpath, "libhg3dsdl2040.so") diff --git a/Bindings/SDL2/cBuild/include/EnumSDLLogCategory.h b/Bindings/SDL2/cBuild/include/EnumSDLLogCategory.h new file mode 100644 index 0000000..16630dc --- /dev/null +++ b/Bindings/SDL2/cBuild/include/EnumSDLLogCategory.h @@ -0,0 +1,51 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// EnumSDLLogCategory.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_EnumSDLLogCategory +#define _DEFINED_HG3D_EnumSDLLogCategory + + +enum EnumSDLLogCategory +{ + SDL_LOG_CATEGORY_APPLICATION, // + SDL_LOG_CATEGORY_ERROR, // + SDL_LOG_CATEGORY_ASSERT, // + SDL_LOG_CATEGORY_SYSTEM, // + SDL_LOG_CATEGORY_AUDIO, // + SDL_LOG_CATEGORY_VIDEO, // + SDL_LOG_CATEGORY_RENDER, // + SDL_LOG_CATEGORY_INPUT, // + SDL_LOG_CATEGORY_TEST, // + SDL_LOG_CATEGORY_RESERVED1, // + SDL_LOG_CATEGORY_RESERVED2, // + SDL_LOG_CATEGORY_RESERVED3, // + SDL_LOG_CATEGORY_RESERVED4, // + SDL_LOG_CATEGORY_RESERVED5, // + SDL_LOG_CATEGORY_RESERVED6, // + SDL_LOG_CATEGORY_RESERVED7, // + SDL_LOG_CATEGORY_RESERVED8, // + SDL_LOG_CATEGORY_RESERVED9, // + SDL_LOG_CATEGORY_RESERVED10, // + SDL_LOG_CATEGORY_CUSTOM // +}; +#endif diff --git a/Bindings/SDL2/cBuild/include/EnumSDLPacketLayout.h b/Bindings/SDL2/cBuild/include/EnumSDLPacketLayout.h new file mode 100644 index 0000000..12359bd --- /dev/null +++ b/Bindings/SDL2/cBuild/include/EnumSDLPacketLayout.h @@ -0,0 +1,38 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// EnumSDLPacketLayout.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_EnumSDLPacketLayout +#define _DEFINED_HG3D_EnumSDLPacketLayout + + +enum EnumSDLPacketLayout +{ + SDL_ARRAYORDER_NONE, // + SDL_ARRAYORDER_RGB, // + SDL_ARRAYORDER_RGBA, // + SDL_ARRAYORDER_ARGB, // + SDL_ARRAYORDER_BGR, // + SDL_ARRAYORDER_BGRA, // + SDL_ARRAYORDER_ABGR // +}; +#endif diff --git a/Bindings/SDL2/cBuild/include/EnumSDLPixelFormat.h b/Bindings/SDL2/cBuild/include/EnumSDLPixelFormat.h new file mode 100644 index 0000000..ee2e7c8 --- /dev/null +++ b/Bindings/SDL2/cBuild/include/EnumSDLPixelFormat.h @@ -0,0 +1,40 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// EnumSDLPixelFormat.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_EnumSDLPixelFormat +#define _DEFINED_HG3D_EnumSDLPixelFormat + + +enum EnumSDLPixelFormat +{ + SDL_PACKEDLAYOUT_NONE, // + SDL_PACKEDLAYOUT_332, // + SDL_PACKEDLAYOUT_4444, // + SDL_PACKEDLAYOUT_1555, // + SDL_PACKEDLAYOUT_5551, // + SDL_PACKEDLAYOUT_565, // + SDL_PACKEDLAYOUT_8888, // + SDL_PACKEDLAYOUT_2101010, // + SDL_PACKEDLAYOUT_1010102 // +}; +#endif diff --git a/Bindings/SDL2/cBuild/include/SDL2DllDefines.h b/Bindings/SDL2/cBuild/include/SDL2DllDefines.h index 763b818..2d89f4b 100644 --- a/Bindings/SDL2/cBuild/include/SDL2DllDefines.h +++ b/Bindings/SDL2/cBuild/include/SDL2DllDefines.h @@ -16,10 +16,10 @@ // SDL2DllDefines.h -#ifndef _HGamer3DSDL2033_DLLDEFINES_H_ -#define _HGamer3DSDL2033_DLLDEFINES_H_ +#ifndef _HGamer3DSDL2040_DLLDEFINES_H_ +#define _HGamer3DSDL2040_DLLDEFINES_H_ -/* Cmake will define HGamer3DSDL2033_EXPORTS on Windows when it +/* Cmake will define HGamer3DSDL2040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DSDL2033_EXPORTS) + #if defined(HGamer3DSDL2040_EXPORTS) #define SDL2_LIB_EXPORT __declspec(dllexport) #else #define SDL2_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DSDL2033_EXPORTS */ + #endif /* HGamer3DSDL2040_EXPORTS */ #else /* defined (_WIN32) */ #define SDL2_LIB_EXPORT #endif -#endif /* _HGamer3DSDL2033_DLLDEFINES_H_ */ +#endif /* _HGamer3DSDL2040_DLLDEFINES_H_ */ diff --git a/Bindings/SDL2/hBuild/HGamer3D-SDL2-Binding.cabal b/Bindings/SDL2/hBuild/HGamer3D-SDL2-Binding.cabal index ce8575a..f1da652 100644 --- a/Bindings/SDL2/hBuild/HGamer3D-SDL2-Binding.cabal +++ b/Bindings/SDL2/hBuild/HGamer3D-SDL2-Binding.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-SDL2-Binding -Version: 0.3.3 +Version: 0.4.0 Synopsis: SDL2 Binding for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,12 +18,12 @@ Build-Type: Simple Cabal-Version: >=1.4 Homepage: http://www.hgamer3d.org Category: Game Engine -Extra-source-files: Setup.hs, include/HeaderSDLEvents.h, include/EnumSDLRendererFlags.h, include/StructHG3DClass.h, include/EnumSDLLogPriority.h, include/EnumSDLWindowShapeMode.h, include/HG3DUtilities.h, include/StructSDLEvent.h, include/HeaderSDL.h, include/EnumSDLMessageBoxColorType.h, include/EnumSDLThreadPriority.h, include/sdlevent_struct.h, include/HeaderSDLVideo.h, include/EnumSDLBlendMode.h, include/EnumSDLEventType.h, include/EnumSDLKeycode.h, include/EnumSDLHintPriority.h, include/EnumSDLGLAttr.h, include/EnumSDLWindowEventID.h, include/EnumSDLTextureAccess.h, include/EnumSDLRendererFlip.h, include/EnumSDLMessageBoxFlags.h, include/SDL2DllDefines.h, include/EnumSDLPowerState.h, include/EnumSDLSystemCursor.h, include/EnumSDLGameControllerButton.h, include/EnumSDLTextureModulate.h, include/HeaderSDLKeyboard.h, include/EnumSDLKeymod.h, include/EnumSDLGameControllerAxis.h, include/EnumSDLScancode.h, include/EnumSDLGLProfile.h, include/EnumSDLWindowFlags.h, include/EnumSDLGlContextFlag.h, include/EnumSDLSysWMType.h, include/ClassPtr.h, include/ClassHG3DUtilities.h, include/hg3dstruct.h, include/EnumSDLMessageBoxButtonFlags.h, include/EnumSDLGameControllerBindType.h, include/HeaderSDLMouse.h +Extra-source-files: Setup.hs, include/StructHG3DClass.h, include/HeaderSDL.h, include/EnumSDLSystemCursor.h, include/hg3dstruct.h, include/EnumSDLMessageBoxFlags.h, include/HeaderSDLMouse.h, include/EnumSDLWindowShapeMode.h, include/EnumSDLWindowFlags.h, include/EnumSDLScancode.h, include/EnumSDLGLAttr.h, include/EnumSDLGameControllerAxis.h, include/EnumSDLBlendMode.h, include/EnumSDLMessageBoxColorType.h, include/EnumSDLLogPriority.h, include/EnumSDLGlContextFlag.h, include/EnumSDLPixelFormat.h, include/EnumSDLGLProfile.h, include/EnumSDLTextureAccess.h, include/EnumSDLTextureModulate.h, include/HeaderSDLEvents.h, include/EnumSDLRendererFlags.h, include/ClassHG3DUtilities.h, include/EnumSDLPowerState.h, include/EnumSDLWindowEventID.h, include/EnumSDLKeymod.h, include/ClassPtr.h, include/EnumSDLLogCategory.h, include/EnumSDLRendererFlip.h, include/SDL2DllDefines.h, include/EnumSDLThreadPriority.h, include/EnumSDLPacketLayout.h, include/EnumSDLMessageBoxButtonFlags.h, include/EnumSDLGameControllerButton.h, include/HeaderSDLKeyboard.h, include/HeaderSDLVideo.h, include/sdlevent_struct.h, include/EnumSDLEventType.h, include/EnumSDLGameControllerBindType.h, include/EnumSDLHintPriority.h, include/EnumSDLKeycode.h, include/EnumSDLSysWMType.h, include/StructSDLEvent.h, include/HG3DUtilities.h Library - Build-Depends: base >= 3 && < 5, utf8-string, bytestring, HGamer3D-Data >= 0.3.0 + Build-Depends: base >= 3 && < 5, utf8-string, bytestring, HGamer3D-Data >= 0.4.0 - Exposed-modules: HGamer3D.Bindings.SDL2.Utils, HGamer3D.Bindings.SDL2.StructHG3DClass, HGamer3D.Bindings.SDL2.ClassPtr, HGamer3D.Bindings.SDL2.EnumSDLSysWMType, HGamer3D.Bindings.SDL2.EnumSDLMessageBoxFlags, HGamer3D.Bindings.SDL2.EnumSDLWindowFlags, HGamer3D.Bindings.SDL2.EnumSDLTextureModulate, HGamer3D.Bindings.SDL2.EnumSDLGLProfile, HGamer3D.Bindings.SDL2.EnumSDLLogPriority, HGamer3D.Bindings.SDL2.EnumSDLPowerState, HGamer3D.Bindings.SDL2.EnumSDLGlContextFlag, HGamer3D.Bindings.SDL2.EnumSDLGameControllerButton, HGamer3D.Bindings.SDL2.EnumSDLScancode, HGamer3D.Bindings.SDL2.EnumSDLBlendMode, HGamer3D.Bindings.SDL2.EnumSDLKeymod, HGamer3D.Bindings.SDL2.EnumSDLWindowEventID, HGamer3D.Bindings.SDL2.EnumSDLGLAttr, HGamer3D.Bindings.SDL2.EnumSDLWindowShapeMode, HGamer3D.Bindings.SDL2.EnumSDLMessageBoxColorType, HGamer3D.Bindings.SDL2.EnumSDLHintPriority, HGamer3D.Bindings.SDL2.EnumSDLRendererFlags, HGamer3D.Bindings.SDL2.EnumSDLSystemCursor, HGamer3D.Bindings.SDL2.EnumSDLEventType, HGamer3D.Bindings.SDL2.EnumSDLMessageBoxButtonFlags, HGamer3D.Bindings.SDL2.EnumSDLGameControllerAxis, HGamer3D.Bindings.SDL2.EnumSDLThreadPriority, HGamer3D.Bindings.SDL2.EnumSDLGameControllerBindType, HGamer3D.Bindings.SDL2.EnumSDLTextureAccess, HGamer3D.Bindings.SDL2.EnumSDLRendererFlip, HGamer3D.Bindings.SDL2.StructSDLEvent, HGamer3D.Bindings.SDL2.HeaderSDLEvents, HGamer3D.Bindings.SDL2.HeaderSDL, HGamer3D.Bindings.SDL2.HeaderSDLVideo, HGamer3D.Bindings.SDL2.HeaderSDLKeyboard, HGamer3D.Bindings.SDL2.HeaderSDLMouse, HGamer3D.Bindings.SDL2.ClassHG3DUtilities + Exposed-modules: HGamer3D.Bindings.SDL2.Utils, HGamer3D.Bindings.SDL2.StructHG3DClass, HGamer3D.Bindings.SDL2.ClassPtr, HGamer3D.Bindings.SDL2.EnumSDLMessageBoxButtonFlags, HGamer3D.Bindings.SDL2.EnumSDLGLProfile, HGamer3D.Bindings.SDL2.EnumSDLRendererFlags, HGamer3D.Bindings.SDL2.EnumSDLScancode, HGamer3D.Bindings.SDL2.EnumSDLWindowEventID, HGamer3D.Bindings.SDL2.EnumSDLThreadPriority, HGamer3D.Bindings.SDL2.EnumSDLSystemCursor, HGamer3D.Bindings.SDL2.EnumSDLGameControllerAxis, HGamer3D.Bindings.SDL2.EnumSDLMessageBoxFlags, HGamer3D.Bindings.SDL2.EnumSDLWindowFlags, HGamer3D.Bindings.SDL2.EnumSDLGameControllerButton, HGamer3D.Bindings.SDL2.EnumSDLKeymod, HGamer3D.Bindings.SDL2.EnumSDLHintPriority, HGamer3D.Bindings.SDL2.EnumSDLLogCategory, HGamer3D.Bindings.SDL2.EnumSDLRendererFlip, HGamer3D.Bindings.SDL2.EnumSDLTextureModulate, HGamer3D.Bindings.SDL2.EnumSDLPacketLayout, HGamer3D.Bindings.SDL2.EnumSDLEventType, HGamer3D.Bindings.SDL2.EnumSDLTextureAccess, HGamer3D.Bindings.SDL2.EnumSDLLogPriority, HGamer3D.Bindings.SDL2.EnumSDLGameControllerBindType, HGamer3D.Bindings.SDL2.EnumSDLWindowShapeMode, HGamer3D.Bindings.SDL2.EnumSDLBlendMode, HGamer3D.Bindings.SDL2.EnumSDLPixelFormat, HGamer3D.Bindings.SDL2.EnumSDLGLAttr, HGamer3D.Bindings.SDL2.EnumSDLSysWMType, HGamer3D.Bindings.SDL2.EnumSDLGlContextFlag, HGamer3D.Bindings.SDL2.EnumSDLMessageBoxColorType, HGamer3D.Bindings.SDL2.EnumSDLPowerState, HGamer3D.Bindings.SDL2.StructSDLEvent, HGamer3D.Bindings.SDL2.ClassHG3DUtilities, HGamer3D.Bindings.SDL2.HeaderSDLMouse, HGamer3D.Bindings.SDL2.HeaderSDLEvents, HGamer3D.Bindings.SDL2.HeaderSDLVideo, HGamer3D.Bindings.SDL2.HeaderSDL, HGamer3D.Bindings.SDL2.HeaderSDLKeyboard Other-modules: ghc-options: @@ -33,6 +33,6 @@ Library Build-tools: build-depends: if os(windows) - extra-libraries: hg3dsdl2033 + extra-libraries: hg3dsdl2040 else - extra-libraries: hg3dsdl2033,SDL2-2.0,X11 + extra-libraries: hg3dsdl2040,SDL2-2.0,X11 diff --git a/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLLogCategory.chs b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLLogCategory.chs new file mode 100644 index 0000000..2bfe6b2 --- /dev/null +++ b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLLogCategory.chs @@ -0,0 +1,41 @@ +{-# LANGUAGE ForeignFunctionInterface #-} +{-# LANGUAGE TypeSynonymInstances #-} + +-- This source file is part of HGamer3D, a project to enable 3D game development +-- in Haskell. For the latest info, see http://www.hgamer3d.org . +-- + +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + + +-- EnumSDLLogCategory.chs + +-- + +module HGamer3D.Bindings.SDL2.EnumSDLLogCategory where + +import Foreign +import Foreign.Ptr +import Foreign.C + +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Vector +import HGamer3D.Data.Colour +import HGamer3D.Data.Angle + + +#include "EnumSDLLogCategory.h" +{#enum EnumSDLLogCategory {} deriving (Eq)#} \ No newline at end of file diff --git a/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLPacketLayout.chs b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLPacketLayout.chs new file mode 100644 index 0000000..2b8088b --- /dev/null +++ b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLPacketLayout.chs @@ -0,0 +1,41 @@ +{-# LANGUAGE ForeignFunctionInterface #-} +{-# LANGUAGE TypeSynonymInstances #-} + +-- This source file is part of HGamer3D, a project to enable 3D game development +-- in Haskell. For the latest info, see http://www.hgamer3d.org . +-- + +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + + +-- EnumSDLPacketLayout.chs + +-- + +module HGamer3D.Bindings.SDL2.EnumSDLPacketLayout where + +import Foreign +import Foreign.Ptr +import Foreign.C + +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Vector +import HGamer3D.Data.Colour +import HGamer3D.Data.Angle + + +#include "EnumSDLPacketLayout.h" +{#enum EnumSDLPacketLayout {} deriving (Eq)#} \ No newline at end of file diff --git a/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLPixelFormat.chs b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLPixelFormat.chs new file mode 100644 index 0000000..7d1fddc --- /dev/null +++ b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/EnumSDLPixelFormat.chs @@ -0,0 +1,41 @@ +{-# LANGUAGE ForeignFunctionInterface #-} +{-# LANGUAGE TypeSynonymInstances #-} + +-- This source file is part of HGamer3D, a project to enable 3D game development +-- in Haskell. For the latest info, see http://www.hgamer3d.org . +-- + +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + + +-- EnumSDLPixelFormat.chs + +-- + +module HGamer3D.Bindings.SDL2.EnumSDLPixelFormat where + +import Foreign +import Foreign.Ptr +import Foreign.C + +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Vector +import HGamer3D.Data.Colour +import HGamer3D.Data.Angle + + +#include "EnumSDLPixelFormat.h" +{#enum EnumSDLPixelFormat {} deriving (Eq)#} \ No newline at end of file diff --git a/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/StructSDLEvent.chs b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/StructSDLEvent.chs index 1d8cecf..910a337 100644 --- a/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/StructSDLEvent.chs +++ b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/StructSDLEvent.chs @@ -40,6 +40,7 @@ import HGamer3D.Data.Angle #include "StructSDLEvent.h" import HGamer3D.Data +import HGamer3D.Data.Window import HGamer3D.Bindings.SDL2.EnumSDLEventType import HGamer3D.Bindings.SDL2.EnumSDLKeymod diff --git a/Bindings/SDL2/hBuild/SConstruct b/Bindings/SDL2/hBuild/SConstruct index 4966a0d..184230c 100644 --- a/Bindings/SDL2/hBuild/SConstruct +++ b/Bindings/SDL2/hBuild/SConstruct @@ -19,12 +19,20 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/SDL2/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-GUI || true", +"ghc-pkg unregister HGamer3D-WinEvent || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings/SDL2/hBuild/include/EnumSDLLogCategory.h b/Bindings/SDL2/hBuild/include/EnumSDLLogCategory.h new file mode 100644 index 0000000..16630dc --- /dev/null +++ b/Bindings/SDL2/hBuild/include/EnumSDLLogCategory.h @@ -0,0 +1,51 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// EnumSDLLogCategory.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_EnumSDLLogCategory +#define _DEFINED_HG3D_EnumSDLLogCategory + + +enum EnumSDLLogCategory +{ + SDL_LOG_CATEGORY_APPLICATION, // + SDL_LOG_CATEGORY_ERROR, // + SDL_LOG_CATEGORY_ASSERT, // + SDL_LOG_CATEGORY_SYSTEM, // + SDL_LOG_CATEGORY_AUDIO, // + SDL_LOG_CATEGORY_VIDEO, // + SDL_LOG_CATEGORY_RENDER, // + SDL_LOG_CATEGORY_INPUT, // + SDL_LOG_CATEGORY_TEST, // + SDL_LOG_CATEGORY_RESERVED1, // + SDL_LOG_CATEGORY_RESERVED2, // + SDL_LOG_CATEGORY_RESERVED3, // + SDL_LOG_CATEGORY_RESERVED4, // + SDL_LOG_CATEGORY_RESERVED5, // + SDL_LOG_CATEGORY_RESERVED6, // + SDL_LOG_CATEGORY_RESERVED7, // + SDL_LOG_CATEGORY_RESERVED8, // + SDL_LOG_CATEGORY_RESERVED9, // + SDL_LOG_CATEGORY_RESERVED10, // + SDL_LOG_CATEGORY_CUSTOM // +}; +#endif diff --git a/Bindings/SDL2/hBuild/include/EnumSDLPacketLayout.h b/Bindings/SDL2/hBuild/include/EnumSDLPacketLayout.h new file mode 100644 index 0000000..12359bd --- /dev/null +++ b/Bindings/SDL2/hBuild/include/EnumSDLPacketLayout.h @@ -0,0 +1,38 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// EnumSDLPacketLayout.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_EnumSDLPacketLayout +#define _DEFINED_HG3D_EnumSDLPacketLayout + + +enum EnumSDLPacketLayout +{ + SDL_ARRAYORDER_NONE, // + SDL_ARRAYORDER_RGB, // + SDL_ARRAYORDER_RGBA, // + SDL_ARRAYORDER_ARGB, // + SDL_ARRAYORDER_BGR, // + SDL_ARRAYORDER_BGRA, // + SDL_ARRAYORDER_ABGR // +}; +#endif diff --git a/Bindings/SDL2/hBuild/include/EnumSDLPixelFormat.h b/Bindings/SDL2/hBuild/include/EnumSDLPixelFormat.h new file mode 100644 index 0000000..ee2e7c8 --- /dev/null +++ b/Bindings/SDL2/hBuild/include/EnumSDLPixelFormat.h @@ -0,0 +1,40 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// EnumSDLPixelFormat.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_EnumSDLPixelFormat +#define _DEFINED_HG3D_EnumSDLPixelFormat + + +enum EnumSDLPixelFormat +{ + SDL_PACKEDLAYOUT_NONE, // + SDL_PACKEDLAYOUT_332, // + SDL_PACKEDLAYOUT_4444, // + SDL_PACKEDLAYOUT_1555, // + SDL_PACKEDLAYOUT_5551, // + SDL_PACKEDLAYOUT_565, // + SDL_PACKEDLAYOUT_8888, // + SDL_PACKEDLAYOUT_2101010, // + SDL_PACKEDLAYOUT_1010102 // +}; +#endif diff --git a/Bindings/SDL2/hBuild/include/SDL2DllDefines.h b/Bindings/SDL2/hBuild/include/SDL2DllDefines.h index 763b818..2d89f4b 100644 --- a/Bindings/SDL2/hBuild/include/SDL2DllDefines.h +++ b/Bindings/SDL2/hBuild/include/SDL2DllDefines.h @@ -16,10 +16,10 @@ // SDL2DllDefines.h -#ifndef _HGamer3DSDL2033_DLLDEFINES_H_ -#define _HGamer3DSDL2033_DLLDEFINES_H_ +#ifndef _HGamer3DSDL2040_DLLDEFINES_H_ +#define _HGamer3DSDL2040_DLLDEFINES_H_ -/* Cmake will define HGamer3DSDL2033_EXPORTS on Windows when it +/* Cmake will define HGamer3DSDL2040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DSDL2033_EXPORTS) + #if defined(HGamer3DSDL2040_EXPORTS) #define SDL2_LIB_EXPORT __declspec(dllexport) #else #define SDL2_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DSDL2033_EXPORTS */ + #endif /* HGamer3DSDL2040_EXPORTS */ #else /* defined (_WIN32) */ #define SDL2_LIB_EXPORT #endif -#endif /* _HGamer3DSDL2033_DLLDEFINES_H_ */ +#endif /* _HGamer3DSDL2040_DLLDEFINES_H_ */ diff --git a/Bindings/SFML/cBuild/SConstruct b/Bindings/SFML/cBuild/SConstruct index b6f8d24..662b26d 100644 --- a/Bindings/SFML/cBuild/SConstruct +++ b/Bindings/SFML/cBuild/SConstruct @@ -14,7 +14,7 @@ # -# scons file to build HGamer3DSFML library, version 0.3.2 +# scons file to build HGamer3DSFML library, version 0.4.0 # set environment @@ -31,7 +31,7 @@ libpath = home + "/.HGamer3D/lib" if env["PLATFORM"] == "win32": # on windows, create new environment, which finds MS C-Compiler env = Environment(TARGET_ARCH="x86", MSVC_VERSION="10.0") - env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DSFML032_EXPORTS /EHsc /MD"}) + env.MergeFlags({"CCFLAGS" : "/DWIN32 /D_WIN32 /DHGamer3DSFML040_EXPORTS /EHsc /MD"}) # set other compile parameters ############################## @@ -40,15 +40,15 @@ if env["PLATFORM"] == "win32": env.Append(CPPPATH=["include","../Deps/include","../Deps/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3dsfml032", ["ClassMusic.cpp","ClassSoundSource.cpp","ClassSoundStream.cpp","ClassSound.cpp","ClassListener.cpp","ClassSoundBuffer.cpp","ClassJoystick.cpp","ClassMouseHG3D.cpp","ClassKeyboard.cpp","ClassMouse.cpp","ClassPtr.cpp"], LIBS = ["sfml-audio.lib","sfml-system.lib","sfml-window.lib"]) + env.SharedLibrary("hg3dsfml040", ["ClassSoundBuffer.cpp","ClassMusic.cpp","ClassSound.cpp","ClassSoundSource.cpp","ClassSoundStream.cpp","ClassMouseHG3D.cpp","ClassJoystick.cpp","ClassListener.cpp","ClassMouse.cpp","ClassPtr.cpp","ClassKeyboard.cpp"], LIBS = ["sfml-audio.lib","sfml-system.lib","sfml-window.lib"]) env.Alias('install', libpath) - env.Install(libpath, "hg3dsfml032.dll") + env.Install(libpath, "hg3dsfml040.dll") else: env.Append(CPPPATH=["include","../Deps/include","../Deps/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3dsfml032", ["ClassMusic.cpp","ClassSoundSource.cpp","ClassSoundStream.cpp","ClassSound.cpp","ClassListener.cpp","ClassSoundBuffer.cpp","ClassJoystick.cpp","ClassMouseHG3D.cpp","ClassKeyboard.cpp","ClassMouse.cpp","ClassPtr.cpp"], LIBS = ["sfml-audio","sfml-system","sfml-window","sfml-network"]) + env.SharedLibrary("hg3dsfml040", ["ClassSoundBuffer.cpp","ClassMusic.cpp","ClassSound.cpp","ClassSoundSource.cpp","ClassSoundStream.cpp","ClassMouseHG3D.cpp","ClassJoystick.cpp","ClassListener.cpp","ClassMouse.cpp","ClassPtr.cpp","ClassKeyboard.cpp"], LIBS = ["sfml-audio","sfml-system","sfml-window","sfml-network"]) env.Alias('install', libpath) - env.Install(libpath, "libhg3dsfml032.so") + env.Install(libpath, "libhg3dsfml040.so") diff --git a/Bindings/SFML/cBuild/include/SFMLDllDefines.h b/Bindings/SFML/cBuild/include/SFMLDllDefines.h index 662ce33..298f4f9 100644 --- a/Bindings/SFML/cBuild/include/SFMLDllDefines.h +++ b/Bindings/SFML/cBuild/include/SFMLDllDefines.h @@ -16,10 +16,10 @@ // SFMLDllDefines.h -#ifndef _HGamer3DSFML032_DLLDEFINES_H_ -#define _HGamer3DSFML032_DLLDEFINES_H_ +#ifndef _HGamer3DSFML040_DLLDEFINES_H_ +#define _HGamer3DSFML040_DLLDEFINES_H_ -/* Cmake will define HGamer3DSFML032_EXPORTS on Windows when it +/* Cmake will define HGamer3DSFML040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DSFML032_EXPORTS) + #if defined(HGamer3DSFML040_EXPORTS) #define SFML_LIB_EXPORT __declspec(dllexport) #else #define SFML_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DSFML032_EXPORTS */ + #endif /* HGamer3DSFML040_EXPORTS */ #else /* defined (_WIN32) */ #define SFML_LIB_EXPORT #endif -#endif /* _HGamer3DSFML032_DLLDEFINES_H_ */ +#endif /* _HGamer3DSFML040_DLLDEFINES_H_ */ diff --git a/Bindings/SFML/hBuild/HGamer3D-SFML-Binding.cabal b/Bindings/SFML/hBuild/HGamer3D-SFML-Binding.cabal index f6ecf78..85b12fb 100644 --- a/Bindings/SFML/hBuild/HGamer3D-SFML-Binding.cabal +++ b/Bindings/SFML/hBuild/HGamer3D-SFML-Binding.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-SFML-Binding -Version: 0.3.2 +Version: 0.4.0 Synopsis: SFML Binding for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,12 +18,12 @@ Build-Type: Simple Cabal-Version: >=1.4 Homepage: http://www.hgamer3d.org Category: Game Engine, Audio, Graphics -Extra-source-files: Setup.hs, include/EnumMouseButton.h, include/vector2istruct.h, include/StructHG3DClass.h, include/ClassMusic.h, include/ClassSoundStream.h, include/StructVec3.h, include/vector2fstruct.h, include/ClassSound.h, include/ClassSoundBuffer.h, include/EnumKey.h, include/ClassListener.h, include/ClassMouseHG3D.h, include/EnumJoystickAxis.h, include/MouseHG3D.h, include/ClassKeyboard.h, include/ClassSoundSource.h, include/ClassJoystick.h, include/vector3istruct.h, include/SFMLDllDefines.h, include/ClassMouse.h, include/ClassPtr.h, include/hg3dstruct.h, include/EnumSoundSourceStatus.h, include/vector3fstruct.h +Extra-source-files: Setup.hs, include/ClassSoundSource.h, include/StructHG3DClass.h, include/hg3dstruct.h, include/StructVec3.h, include/vector3istruct.h, include/ClassKeyboard.h, include/EnumKey.h, include/vector3fstruct.h, include/SFMLDllDefines.h, include/ClassMouse.h, include/EnumMouseButton.h, include/ClassPtr.h, include/vector2istruct.h, include/ClassMouseHG3D.h, include/ClassSoundBuffer.h, include/vector2fstruct.h, include/ClassMusic.h, include/ClassJoystick.h, include/MouseHG3D.h, include/ClassSound.h, include/ClassSoundStream.h, include/ClassListener.h, include/EnumJoystickAxis.h, include/EnumSoundSourceStatus.h Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.3.0 + Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 - Exposed-modules: HGamer3D.Bindings.SFML.Utils, HGamer3D.Bindings.SFML.StructHG3DClass, HGamer3D.Bindings.SFML.ClassPtr, HGamer3D.Bindings.SFML.EnumJoystickAxis, HGamer3D.Bindings.SFML.EnumKey, HGamer3D.Bindings.SFML.EnumSoundSourceStatus, HGamer3D.Bindings.SFML.EnumMouseButton, HGamer3D.Bindings.SFML.StructVec3, HGamer3D.Bindings.SFML.ClassListener, HGamer3D.Bindings.SFML.ClassJoystick, HGamer3D.Bindings.SFML.ClassMouseHG3D, HGamer3D.Bindings.SFML.ClassSoundStream, HGamer3D.Bindings.SFML.ClassSoundBuffer, HGamer3D.Bindings.SFML.ClassSoundSource, HGamer3D.Bindings.SFML.ClassKeyboard, HGamer3D.Bindings.SFML.ClassMouse, HGamer3D.Bindings.SFML.ClassSound, HGamer3D.Bindings.SFML.ClassMusic + Exposed-modules: HGamer3D.Bindings.SFML.Utils, HGamer3D.Bindings.SFML.StructHG3DClass, HGamer3D.Bindings.SFML.ClassPtr, HGamer3D.Bindings.SFML.EnumMouseButton, HGamer3D.Bindings.SFML.EnumJoystickAxis, HGamer3D.Bindings.SFML.EnumSoundSourceStatus, HGamer3D.Bindings.SFML.EnumKey, HGamer3D.Bindings.SFML.StructVec3, HGamer3D.Bindings.SFML.ClassJoystick, HGamer3D.Bindings.SFML.ClassSound, HGamer3D.Bindings.SFML.ClassMouseHG3D, HGamer3D.Bindings.SFML.ClassListener, HGamer3D.Bindings.SFML.ClassMusic, HGamer3D.Bindings.SFML.ClassSoundStream, HGamer3D.Bindings.SFML.ClassSoundBuffer, HGamer3D.Bindings.SFML.ClassKeyboard, HGamer3D.Bindings.SFML.ClassSoundSource, HGamer3D.Bindings.SFML.ClassMouse Other-modules: ghc-options: @@ -33,6 +33,6 @@ Library Build-tools: build-depends: if os(windows) - extra-libraries: hg3dsfml032 + extra-libraries: hg3dsfml040 else - extra-libraries: hg3dsfml032,sfml-audio,sfml-system,sfml-window,sfml-network + extra-libraries: hg3dsfml040,sfml-audio,sfml-system,sfml-window,sfml-network diff --git a/Bindings/SFML/hBuild/SConstruct b/Bindings/SFML/hBuild/SConstruct index a5d6a45..97b444f 100644 --- a/Bindings/SFML/hBuild/SConstruct +++ b/Bindings/SFML/hBuild/SConstruct @@ -19,12 +19,20 @@ env.AppendENVPath('PATH', home + os.sep + '.cabal' + os.sep + 'bin') dependsOn = [ Glob("HGamer3D/Bindings/SFML/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../../../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-Audio || true", +"ghc-pkg unregister HGamer3D-InputSystem || true", + "cabal configure --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", "cabal build", "cabal haddock", diff --git a/Bindings/SFML/hBuild/include/SFMLDllDefines.h b/Bindings/SFML/hBuild/include/SFMLDllDefines.h index 662ce33..298f4f9 100644 --- a/Bindings/SFML/hBuild/include/SFMLDllDefines.h +++ b/Bindings/SFML/hBuild/include/SFMLDllDefines.h @@ -16,10 +16,10 @@ // SFMLDllDefines.h -#ifndef _HGamer3DSFML032_DLLDEFINES_H_ -#define _HGamer3DSFML032_DLLDEFINES_H_ +#ifndef _HGamer3DSFML040_DLLDEFINES_H_ +#define _HGamer3DSFML040_DLLDEFINES_H_ -/* Cmake will define HGamer3DSFML032_EXPORTS on Windows when it +/* Cmake will define HGamer3DSFML040_EXPORTS on Windows when it configures to build a shared library. If you are going to use another build system on windows or create the visual studio projects by hand you need to define MyLibrary_EXPORTS when @@ -29,13 +29,13 @@ building a DLL on windows. // We are using the Visual Studio Compiler and building Shared libraries #if (defined (_WIN32)) && !(defined (__GNUC__)) - #if defined(HGamer3DSFML032_EXPORTS) + #if defined(HGamer3DSFML040_EXPORTS) #define SFML_LIB_EXPORT __declspec(dllexport) #else #define SFML_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DSFML032_EXPORTS */ + #endif /* HGamer3DSFML040_EXPORTS */ #else /* defined (_WIN32) */ #define SFML_LIB_EXPORT #endif -#endif /* _HGamer3DSFML032_DLLDEFINES_H_ */ +#endif /* _HGamer3DSFML040_DLLDEFINES_H_ */ diff --git a/Data/HGamer3D-Data.cabal b/Data/HGamer3D-Data.cabal index cef4e34..f6621cf 100644 --- a/Data/HGamer3D-Data.cabal +++ b/Data/HGamer3D-Data.cabal @@ -1,5 +1,6 @@ Name: HGamer3D-Data Version: 0.4.0 +tch and new HG3DClass Synopsis: Game Engine for the Haskell Programmer - Data Definitions and Utilities Description: HGamer3D is a game engine for developing 3D games in the programming diff --git a/Data/HGamer3D/Data.hs b/Data/HGamer3D/Data.hs index c31c891..f6c4b78 100644 --- a/Data/HGamer3D/Data.hs +++ b/Data/HGamer3D/Data.hs @@ -23,19 +23,17 @@ module HGamer3D.Data ( - module HGamer3D.Data.HG3DClass, module HGamer3D.Data.Angle, module HGamer3D.Data.Colour, module HGamer3D.Data.Transform3D, module HGamer3D.Data.TimeMS, module HGamer3D.Data.Vector, module HGamer3D.Data.Geometry2D, - module HGamer3D.Data.Window + Window, ) where -import HGamer3D.Data.HG3DClass import HGamer3D.Data.Angle import HGamer3D.Data.Colour import HGamer3D.Data.Transform3D diff --git a/Data/HGamer3D/Data/HG3DClass.hs b/Data/HGamer3D/Data/HG3DClass.hs index 2b41e65..0cd80cc 100644 --- a/Data/HGamer3D/Data/HG3DClass.hs +++ b/Data/HGamer3D/Data/HG3DClass.hs @@ -29,6 +29,7 @@ module HGamer3D.Data.HG3DClass where import Foreign import Foreign.Ptr import Foreign.C +import Foreign.Storable import Data.Bits @@ -40,17 +41,17 @@ data HG3DClass = HG3DClass { instance Storable HG3DClass where alignment _ = alignment (undefined :: CDouble) - sizeOf _ = 8 + sizeOf _ = 2 * (sizeOf nullPtr) peek p = do ptr <- (\ptr -> do {peekByteOff ptr 0 ::IO (Ptr ())}) p - fptr <- (\ptr -> do {peekByteOff ptr 4 ::IO (Ptr ())}) p + fptr <- (\ptr -> do {peekByteOff ptr (sizeOf nullPtr) ::IO (Ptr ())}) p let hc = HG3DClass (ptr) (fptr) return hc poke p (HG3DClass ptr fptr) = do (\ptr val -> do {pokeByteOff ptr 0 (val::(Ptr ()))}) p (ptr) - (\ptr val -> do {pokeByteOff ptr 4 (val::(Ptr ()))}) p (fptr) + (\ptr val -> do {pokeByteOff ptr (sizeOf nullPtr) (val::(Ptr ()))}) p (fptr) diff --git a/Data/SConstruct b/Data/SConstruct index 8ef9272..6e145e5 100644 --- a/Data/SConstruct +++ b/Data/SConstruct @@ -25,6 +25,25 @@ dependsOn = [ target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Schema || true", +"ghc-pkg unregister HGamer3D-Wire || true", + +"ghc-pkg unregister HGamer3D-GUI || true", +"ghc-pkg unregister HGamer3D-WinEvent || true", +"ghc-pkg unregister HGamer3D-Graphics3D || true", + +"ghc-pkg unregister HGamer3D-InputSystem || true", +"ghc-pkg unregister HGamer3D-Network || true", +"ghc-pkg unregister HGamer3D-Audio || true", + +"ghc-pkg unregister HGamer3D-CEGUI-Binding || true", +"ghc-pkg unregister HGamer3D-Ogre-Binding || true", +"ghc-pkg unregister HGamer3D-Enet-Binding || true", +"ghc-pkg unregister HGamer3D-SDL2-Binding || true", +"ghc-pkg unregister HGamer3D-SFML-Binding || true", + "cabal configure --user", "cabal build", "cabal haddock", diff --git a/Examples/Audio/Audio.hs b/Examples/Audio/Audio.hs index 47925d0..f43082c 100644 --- a/Examples/Audio/Audio.hs +++ b/Examples/Audio/Audio.hs @@ -27,7 +27,7 @@ import HGamer3D.Audio import Control.Monad playM = do - mu <- createMusic "orchestral.ogg" + mu <- musicAudioSource "orchestral.ogg" case mu of Just audio -> do playAudioSource audio @@ -36,7 +36,7 @@ playM = do return Nothing playS = do - mu <- createSound "canary.wav" + mu <- soundAudioSource "canary.wav" case mu of Just audio -> do playAudioSource audio @@ -48,7 +48,7 @@ delAudio mu = do case mu of Nothing -> return () Just audio -> do - deleteAudioSource audio + freeAudioSource audio return () diff --git a/Examples/GUI/GUI-Widgets.hs b/Examples/GUI/GUI-Widgets.hs index 9f9d1b7..7acb603 100644 --- a/Examples/GUI/GUI-Widgets.hs +++ b/Examples/GUI/GUI-Widgets.hs @@ -21,11 +21,13 @@ module Main where -import HGamer3D -- this import HGamer3D with GUI and Graphics3d and WinEvents +-- import HGamer3D -- this import HGamer3D with GUI and Graphics3d and WinEvents +import HGamer3D.BaseAPI + import Control.Monad.Trans import Data.Maybe -printEvent :: GUIElement -> GUIEvent -> IO () +printEvent :: GUIElement a -> GUIEvent -> IO () printEvent outbox event = do case event of GUIEvent tag sender window -> do @@ -54,14 +56,17 @@ printEvent outbox event = do sel <- getGuiElProperty window "CurrentValue" return (sel) "ListboxWidget" -> do - sel <- listboxGetSelectedText window + mlb <- toListBox window + sel <- case mlb of + Just lb -> listboxGetSelectedText lb + Nothing -> return [""] let sel' = if length sel>0 then foldl (\s1 s2 -> (s1 ++ "\n " ++ s2)) [] sel else "" return (sel') "ComboboxWidget" -> do sel <- getGuiElProperty window "Text" return (sel) "ButtonWidget" -> do - return "clicked" + return "Button clicked" _ -> return "no details" let oldtext' = if length oldtext > 250 then drop 50 oldtext else oldtext @@ -71,7 +76,7 @@ printEvent outbox event = do checkEvents outtext g3ds guis = do - (evt, qFlag) <- loopHGamer3D g3ds guis + (evt, qFlag) <- stepHGamer3D g3ds guis if qFlag then return False else @@ -84,8 +89,8 @@ checkEvents outtext g3ds guis = do renderLoop cube outtext g3ds guis = do -- rotate - yaw3D cube (Rad 0.005) - roll3D cube (Rad 0.002) + yaw cube (Rad 0.005) + roll cube (Rad 0.002) proceed <- checkEvents outtext g3ds guis if proceed then renderLoop cube outtext g3ds guis else return () @@ -99,15 +104,13 @@ registerWidgetEvent guis rootWindow widgetName eventName tagName = do Nothing -> do return () -white = Colour 1.0 1.0 1.0 1.0 - main = do (g3ds, guis, camera, viewport) <- initHGamer3D "HGamer3D - GUI Widgets Example" True False True -- camera position let pos = Vec3 5.0 5.0 80.0 - positionTo3D camera pos + positionTo camera pos let at = Vec3 0.0 0.0 (-300.0) cameraLookAt camera at @@ -118,9 +121,10 @@ main = do -- create a shiny blue cube let cube = cubeMesh - cube <- object3DFromMesh g3ds cube (Just (ResourceMaterial "Colours/Blue") ) False - positionTo3D cube (Vec3 0.0 0.0 0.0) - scaleTo3D cube (Vec3 0.2 0.2 0.2) + let blueMat = resourceMaterial "Colours/Blue" + cube <- object3DFromMesh g3ds cube (Just blueMat) False + positionTo cube (Vec3 0.0 0.0 0.0) + scale cube (Vec3 0.2 0.2 0.2) -- GUI Code starts here, display hg3d logo loadGuiScheme guis "hg3d.scheme" @@ -134,7 +138,7 @@ main = do addGuiElToDisplay guis guiwidgets -- add lists to listbox and combobox - listbox <- findChildGuiElRecursive guiwidgets "ListboxWidget" + listbox <- findListBox "ListboxWidget" guiwidgets outtext <- fmap fromJust ( findChildGuiElRecursive guiwidgets "OuttextWidget") case listbox of @@ -145,7 +149,7 @@ main = do Nothing -> do return () - combobox <- findChildGuiElRecursive guiwidgets "ComboboxWidget" + combobox <- findComboBox "ComboboxWidget" guiwidgets case combobox of Just widgetOk -> do mapM (comboboxAddText widgetOk) ["Choice One", "Choice Two", "Choice Three"] @@ -169,5 +173,5 @@ main = do -- start render loop renderLoop cube outtext g3ds guis - exitHGamer3D g3ds guis + freeHGamer3D g3ds guis return () diff --git a/Examples/Graphics3D/BlueCube.hs b/Examples/Graphics3D/BlueCube.hs index f244809..11a665b 100644 --- a/Examples/Graphics3D/BlueCube.hs +++ b/Examples/Graphics3D/BlueCube.hs @@ -16,15 +16,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. +import HGamer3D.Data import HGamer3D.Graphics3D -white :: Colour -white = (Colour 1.0 1.0 1.0 1.0) - renderLoop cube g3ds = do -- rotate - yaw3D cube (Rad 0.005) - roll3D cube (Rad 0.002) + yaw cube (Rad 0.005) + roll cube (Rad 0.002) quit <- loopHGamer3D g3ds if quit then return () else renderLoop cube g3ds @@ -35,7 +33,7 @@ main = do -- camera position let pos = Vec3 5.0 5.0 80.0 - positionTo3D camera pos + positionTo camera pos let at = Vec3 0.0 0.0 (-300.0) cameraLookAt camera at @@ -45,19 +43,13 @@ main = do pointLight g3ds white (Vec3 10.0 10.0 20.0) -- create a shiny blue cube - --cube <- object3DFromMesh g3ds cubeMesh (Just (ResourceMaterial "Colours/Blue") ) False - --positionTo3D cube (Vec3 0.0 0.0 0.0) - --scaleTo3D cube (Vec3 0.2 0.2 0.2) - - pinky <- colouredCubeMesh g3ds (Colour 0.5 0.5 0.0 1.0) - cube2 <- object3DFromMesh g3ds pinky Nothing False - positionTo3D cube2 (Vec3 0.0 0.0 0.0) --- scaleTo3D cube (Vec3 0.2 0.2 0.2) - cube <- object3DFromMesh g3ds pinky Nothing False - positionTo3D cube (Vec3 5.0 0.0 0.0) + let blueMaterial = resourceMaterial "Colours/Blue" + cube <- object3DFromMesh g3ds cubeMesh (Just blueMaterial) False + positionTo cube (Vec3 0.0 0.0 0.0) + scale cube (Vec3 0.2 0.2 0.2) -- start render loop - renderLoop cube2 g3ds + renderLoop cube g3ds exitHGamer3D g3ds return () diff --git a/Examples/Graphics3D/BumpMappingCube.hs b/Examples/Graphics3D/BumpMappingCube.hs index c154be2..94c598a 100644 --- a/Examples/Graphics3D/BumpMappingCube.hs +++ b/Examples/Graphics3D/BumpMappingCube.hs @@ -16,6 +16,7 @@ -- See the License for the specific language governing permissions and -- limitations under the License. +import HGamer3D.Data import HGamer3D.Graphics3D white :: Colour @@ -23,8 +24,8 @@ white = (Colour 1.0 1.0 1.0 1.0) renderLoop cube g3ds = do -- rotate - yaw3D cube (Rad 0.005) - roll3D cube (Rad 0.002) + yaw cube (Rad 0.005) + roll cube (Rad 0.002) quit <- loopHGamer3D g3ds if quit then return () else renderLoop cube g3ds @@ -35,7 +36,7 @@ main = do -- camera position let pos = Vec3 5.0 5.0 400.0 - positionTo3D camera pos + positionTo camera pos let at = Vec3 0.0 0.0 (-300.0) cameraLookAt camera at @@ -45,9 +46,10 @@ main = do pointLight g3ds (Colour 0.3 0.3 1.0 1.0) (Vec3 (-100.0) 10.0 0.0) pointLight g3ds (Colour 1.0 0.3 0.3 1.0) (Vec3 100.0 10.0 0.0) let cube = resourceMesh "knot.mesh" - cube <- object3DFromMesh g3ds cube (Just (ResourceMaterial "OffsetMapping/IntegratedShadows") ) True + let bumpMaterial = resourceMaterial "OffsetMapping/IntegratedShadows" + cube <- object3DFromMesh g3ds cube (Just bumpMaterial ) True - positionTo3D cube (Vec3 0.0 0.0 0.0) + positionTo cube (Vec3 0.0 0.0 0.0) -- start render loop renderLoop cube g3ds diff --git a/Examples/InputSystem/Joystick.hs b/Examples/InputSystem/Joystick.hs index a2189bb..8ac6eaf 100644 --- a/Examples/InputSystem/Joystick.hs +++ b/Examples/InputSystem/Joystick.hs @@ -34,15 +34,11 @@ getJoysticks = do showAxesValues jn axes = do updateJoystickStatus - bp <- isJoystickButtonPressed jn (JoystickButton 0) vals <- mapM (\a -> do getJoystickAxisPosition jn a) axes putStrLn $ "Joystick Positions: " ++ (show vals) - if not bp then do - showAxesValues jn axes - return () - else - return () + showAxesValues jn axes + return () getJoystickProperties jn = do jbs <- getJoystickButtons jn @@ -66,7 +62,7 @@ main = do putStrLn "Choose one (only type the number):" line <- readLn let jn = (fromIntegral (toInteger line))::Int - let joystick = Joystick jn + let joystick = js !! jn if (elem joystick js) then do putStrLn $ (show jn) ++ " selected" @@ -88,7 +84,7 @@ main = do -- show values of axes, until button one is pressed - putStrLn "After Enter, show values of all Axes, until Button 0 pressed" + putStrLn "After Enter, show values of all Axes" getChar x <- showAxesValues joystick axes diff --git a/Examples/Network/Network-Chat.hs b/Examples/Network/Network-Chat.hs index 9c8e864..e645256 100644 --- a/Examples/Network/Network-Chat.hs +++ b/Examples/Network/Network-Chat.hs @@ -17,13 +17,13 @@ serverLoop server clients = do serverLoop server clients doServerWork = do - server <- createNetworkServer 7890 + server <- networkServer 7890 serverLoop server [] -- connect to server on port 7890 action = do n <- initNetwork - client <- createNetworkClient + client <- networkClient ok <- connectClientToServer client "localhost" 7890 if ok then do diff --git a/Examples/SConstruct b/Examples/SConstruct index bc3b704..ce7dcef 100644 --- a/Examples/SConstruct +++ b/Examples/SConstruct @@ -27,7 +27,9 @@ for (p, s) in [ ("Games", "Cuboid2"), ("Games", "YWing-Flight") ]: - env.Command("build/" + s, p + "/" + s + ".hs", "rm -f build/*.o && " + "ghc --make -odir build -hidir build -i" + p + " -o build/" + s + " " + p + "/" + s) + env.Command("build/" + s, [p + "/" + s + ".hs", + "build/.HGamer3D" + ] , "rm -f build/*.o && " + "ghc --make -odir build -hidir build -i" + p + " -o build/" + s + " " + p + "/" + s) # the media files need to be copied to .HGamer3D env.Command("build/.HGamer3D", "MediaFiles", [ diff --git a/Examples/WinEvent/WinEvent.hs b/Examples/WinEvent/WinEvent.hs index 5a6b5f1..496a989 100644 --- a/Examples/WinEvent/WinEvent.hs +++ b/Examples/WinEvent/WinEvent.hs @@ -3,19 +3,17 @@ module Main where import HGamer3D.WinEvent loopEvents = do - evt <- loopHGamer3D + evt <- pollWinEvent case evt of Just (EvtQuit ts) -> return () _ -> loopEvents main = do - success <- initHGamer3D [WEV_INIT_EVENTS, WEV_INIT_TIMER, WEV_INIT_VIDEO] - win <- openWindow "HGamer3D - WinEvent window creation test" 100 100 500 300 [SDL_WINDOW_SHOWN] - + success <- initWinEvent [WEV_INIT_EVENTS, WEV_INIT_TIMER, WEV_INIT_VIDEO] print success - print win + win <- openWindow "HGamer3D - WinEvent window creation test" 100 100 500 300 [SDL_WINDOW_SHOWN] loopEvents - exitHGamer3D + freeWinEvent return () diff --git a/GUI/HGamer3D-GUI.cabal b/GUI/HGamer3D-GUI.cabal index f9a7294..41a1fed 100644 --- a/GUI/HGamer3D-GUI.cabal +++ b/GUI/HGamer3D-GUI.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-GUI -Version: 0.3.1 +Version: 0.4.0 Synopsis: GUI Functionality for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,9 +18,9 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.3.0 && < 0.4.0, HGamer3D-CEGUI-Binding >= 0.3.0 && < 0.4.0, HGamer3D-WinEvent >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, split, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-CEGUI-Binding >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.GUI + Exposed-modules: HGamer3D.GUI.Internal.Base, HGamer3D.GUI.Internal.Widgets, HGamer3D.GUI.Internal.Properties, HGamer3D.GUI Other-modules: c-sources: diff --git a/GUI/HGamer3D/GUI.hs b/GUI/HGamer3D/GUI.hs index 3c7687b..4705cd4 100644 --- a/GUI/HGamer3D/GUI.hs +++ b/GUI/HGamer3D/GUI.hs @@ -3,7 +3,7 @@ -- For the latest info, see http://www.hgamer3d.org -- -- (c) 2011-2013 Peter Althainz --- +-- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at @@ -16,25 +16,31 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- BasicGUI.hs +-- GUI.hs --- |GUI functionality of the Base API. +-- |GUI functionality of HGamer3D, public API. Currently not usefule standalone, but used inside HGamer3D (main module). module HGamer3D.GUI ( - -- * Data Definitions, Types - GUISystem (..), - GUIElement (..), + GUISystem, + GUIElement, GUIEvent (..), EventFunction, - -- * Initialization, Event Input and Configuration - initGUI, - injectWinEventToGUI, + -- initGUI, + -- freeGUI, + -- pollGUIEvents, + + + -- injectWinEventToGUI, + -- * Event Handling + registerGUIEvent, + + -- * Configuration: Layout, Font, Scheme, MouseCursor, Tooltip loadGuiLayoutFromFile, loadGuiScheme, loadGuiFont, @@ -58,18 +64,67 @@ module HGamer3D.GUI showGuiEl, hideGuiEl, - -- * Listbox, Compobox specific functions + -- * Widget Types and Conversions + + GUIButton, + GUIRadioButton, + GUICheckBox, + GUIEditText, + GUIListBox, + GUIComboBox, + GUISlider, + GUISpinner, + + toButton, + toRadioButton, + toCheckBox, + toEditText, + toComboBox, + toListBox, + toSpinner, + toSlider, + + findButton, + findRadioButton, + findCheckBox, + findEditText, + findComboBox, + findListBox, + findSpinner, + findSlider, + + -- * Widget Functions + listboxAddText, listboxGetSelectedText, listboxRemoveAllText, listboxInitialize, listboxStatus, + comboboxAddText, comboboxRemoveAllText, - -- * Event Handling - registerGUIEvent, - pollGUIEvents + -- * Property Types +GUIElementProperty, +GUIButtonProperty, +GUIRadioButtonProperty, +GUICheckBoxProperty, +GUIEditTextProperty, +GUISliderProperty, +GUISpinnerProperty, + +-- * Property Functions +(=:), +setP, +getP, + +-- * GUI Element Properties, for all GUI elements +pText, +pDisabled, +pVisible, +pAlpha, +pTooltip, +pAlwaysOnTop, ) @@ -126,378 +181,7 @@ import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton +import HGamer3D.GUI.Internal.Base +import HGamer3D.GUI.Internal.Widgets +import HGamer3D.GUI.Internal.Properties -data GUISystem = GUISystem { - guiRoot::HG3DClass, - guiRenderer::HG3DClass, - guiWindowManager::HG3DClass, - guiWindowManagerHG3D::HG3DClass, - guiFontManager::HG3DClass, - guiSchemeManager::HG3DClass, - guiEventController::HG3DClass, - guiUniqueName::UniqueName -} - -type EventFunction = IO () - --- | The GUI Element, a window, a button, any widget or widget element, organized in a hierarchy -data GUIElement = GUIElement HG3DClass -- ^ only one constructor, currently GUI elements are not specified in more detail - --- | load a complete layout file into the application -loadGuiLayoutFromFile :: GUISystem - -> String -- ^ filename, without the path (this is defined by resource locations) - -> String -- ^ prefix to append to the identifiers in the layout, this allows, to load the same dailog/gui element multiple times with different names, if needed - -> IO GUIElement -- ^ the resulting tree of GUI elements as top GUI element -loadGuiLayoutFromFile guis layoutFile prefix = do - let hg3dWinMgr = guiWindowManagerHG3D guis - window <- WindowManagerHG3D.loadWindowLayoutHG3D hg3dWinMgr layoutFile prefix - return (GUIElement window) - --- | add a GUI element to the display -addGuiElToDisplay :: GUISystem -> GUIElement -- ^ GUI element - -> IO () -addGuiElToDisplay guis (GUIElement window) = do - let guir = guiRoot guis - guiSheet <- System.getGUISheet guir - Window.addChildWindow2 guiSheet window - --- | remove a GUI element from the display -removeGuiElFromDisplay :: GUISystem -> GUIElement -- ^ GUI element - -> IO () -removeGuiElFromDisplay guis (GUIElement window) = do - let guir = guiRoot guis - guiSheet <- System.getGUISheet guir - Window.removeChildWindow2 guiSheet window - --- | enable GUI element, allow interaction with it and render it accordingly -enableGuiEl :: GUIElement -- ^ GUI element to enable - -> IO () -enableGuiEl (GUIElement window) = do - Window.enable window - --- | disable GUI element, disallow interaction with it and render it accordingly -disableGuiEl :: GUIElement -- ^ GUI element to disable - -> IO () -disableGuiEl (GUIElement window) = do - Window.disable window - --- | activate GUI element, process events send to it -activateGuiEl :: GUIElement -- ^ GUI element to activate - -> IO () -activateGuiEl (GUIElement window) = do - Window.activate window - --- | deactivate GUI element, do not process events send to it -deactivateGuiEl :: GUIElement -- ^ GUI element to deactivate - -> IO () -deactivateGuiEl (GUIElement window) = do - Window.deactivate window - --- | show GUI element -showGuiEl :: GUIElement -- ^ GUI element to show - -> IO () -showGuiEl (GUIElement window) = do - Window.show window - --- | hide GUI element -hideGuiEl :: GUIElement -- ^ GUI element to hide - -> IO () -hideGuiEl (GUIElement window) = do - Window.hide window - --- | get child gui element, throws an exception, if element not found in children, only searches the direct children of element. -getChildGuiEl :: GUIElement -- ^ GUI element, which childrens are searched for child element - -> String -- ^ name of searched child element - -> IO GUIElement -- ^ found element (throws exception, in case no child found) -getChildGuiEl (GUIElement window) name = do - window <- Window.getChild window name - return (GUIElement window) - --- | find child element recursively, searches all sub-trees -findChildGuiElRecursive :: GUIElement -- ^ GUI element, which childrens are searched, including children of children and so on. - -> String -- ^ name of child element to be found - -> IO (Maybe GUIElement) -- ^ in case of found element: Just el, Nothing otherwhise -findChildGuiElRecursive (GUIElement window) name = do - window <- Window.getChildRecursive window name - if (ocPtr window) == nullPtr then do - return Nothing - else do - return (Just (GUIElement window)) - --- | get a named property as string from element -getGuiElProperty :: GUIElement -- ^ GUI element - -> String -- ^ property name to get - -> IO String -- ^ property value -getGuiElProperty (GUIElement window) name = do - prop <- PropertySet.getProperty window name - return prop - --- | set a named property -setGuiElProperty :: GUIElement -- ^ GUI element - -> String -- ^ property name to set - -> String -- ^ property value as string - -> IO () -setGuiElProperty (GUIElement window) name value = do - PropertySet.setProperty window name value - --- | load a complete GUI scheme, see CEGUI manual for details -loadGuiScheme :: GUISystem -> String -- ^ scheme name - -> IO () -loadGuiScheme guis schemeName = do - SystemHG3D.schemeManagerCreate (guiSchemeManager guis) schemeName - --- | load a GUI font -loadGuiFont :: GUISystem -> String -- ^ font name - -> IO () -loadGuiFont guis fontName = do - SystemHG3D.fontManagerCreate (guiFontManager guis) fontName - --- | set default GUI font -setGuiDefaultFont :: GUISystem -> String -- ^ font name - -> IO () -setGuiDefaultFont guis fontName = do - let guir = guiRoot guis - System.setDefaultFont guir fontName - --- | set default mouse cursor -setGuiDefaultMouseCursor :: GUISystem - -> String -- ^ scheme name, where cursor is contained in - -> String -- ^ cursor name - -> IO () -setGuiDefaultMouseCursor guis schemeName cursorName = do - let guir = guiRoot guis - System.setDefaultMouseCursor3 guir schemeName cursorName - --- | set default tool tip -setGuiDefaultTooltip :: GUISystem -> String -- ^ default tool tip name - -> IO () -setGuiDefaultTooltip guis ttName = do - let guir = guiRoot guis - System.setDefaultTooltip2 guir ttName - --- | add one line of text as a selectable entry to a combobox -comboboxAddText :: GUIElement -- ^ GUI element, needs to be a combobox - -> String -- ^ the entry string to add - -> IO () -comboboxAddText (GUIElement window) itemname = do - realcombo <- WindowSF.castWindowToCombobox window - ListboxSF.comboboxAddItem realcombo itemname - --- | removes all lines of entries from a combobox -comboboxRemoveAllText :: GUIElement -- ^ the GUI elements, needs to be a combobox - -> IO () -comboboxRemoveAllText (GUIElement window) = do - realcombo <- WindowSF.castWindowToCombobox window - Combobox.resetList realcombo - --- | add one line of text as a selectable entry to a listbox -listboxAddText :: GUIElement -- ^ GUI element, needs to be a listbox - -> String -- ^ the entry string to add - -> IO () -listboxAddText (GUIElement window) itemname = do - reallistbox <- WindowSF.castWindowToListbox window - ListboxSF.listboxAddItem reallistbox itemname - -_getTextListOfItem reallistbox item list = do - let (HG3DClass ptra ptrb) = item - if ptra /= nullPtr then do - txt <- ListboxItem.getText item - let list' = list ++ [txt] - item' <- Listbox.getNextSelected reallistbox item - list'' <- _getTextListOfItem reallistbox item' list' - return list'' - else do - return list - -listboxInitialize :: GUIElement -- ^ GUI element, needs to be a listbox - -> [(String, Bool)] -- ^ list of entry, selected pairs - -> IO () -listboxInitialize (GUIElement window) pairs = do - reallistbox <- WindowSF.castWindowToListbox window - Listbox.resetList reallistbox - mapM ( \((entry, selected), ind) -> do - ListboxSF.listboxAddItem reallistbox entry - item <- Listbox.getListboxItemFromIndex reallistbox ind - ListboxItem.setSelected item selected - return () - ) (zip pairs [0..]) - return () - -listboxStatus :: GUIElement -- ^ GUI element, needs to be a listbox - -> IO [(String, Bool)] -- ^ list of entry, selected pairs -listboxStatus (GUIElement window) = do - reallistbox <- WindowSF.castWindowToListbox window - count <- Listbox.getItemCount reallistbox - outlist <- mapM ( \ind -> do - item <- Listbox.getListboxItemFromIndex reallistbox ind - sel <- ListboxItem.isSelected item - txt <- ListboxItem.getText item - return (txt, sel) - ) [0..(count-1)] - return outlist - - --- | return the selected items as an array of strings -listboxGetSelectedText :: GUIElement -- ^ the GUI element, needs to be a listbox - -> IO [String] -- ^ the selected items as an array of strings -listboxGetSelectedText (GUIElement window) = do - reallistbox <- WindowSF.castWindowToListbox window - item <- Listbox.getFirstSelectedItem reallistbox - list <- _getTextListOfItem reallistbox item ([]::[String]) - return list - --- | removes all lines of entries from a listbox -listboxRemoveAllText :: GUIElement -- ^ the GUI element, needs to be a listbox - -> IO () -listboxRemoveAllText (GUIElement window) = do - reallistbox <- WindowSF.castWindowToListbox window - Listbox.resetList reallistbox - - - - --- | initialize the GUI system, used internally -initGUI :: Bool -- ^ logging flag - -> Bool -- ^ show graphics cursor flag - -> IO (GUISystem) -- ^ GUI system object -initGUI fShowGraphicsCursor fLog = do - - - -- CEGUI system - --------------- - - -- first logger, loglevel - - if not fLog then do - ceguilog <- CEGUISystemHG3D.createNoLogger - return () - else do - ceguilog <- CEGUIDefaultLogger.new - CEGUILogger.setLogFilename ceguilog "hgamer3d-gui.log" False - CEGUILogger.setLoggingLevel ceguilog LoggingLevelInformative - return () - - -- bootstrap complete cegui system - - guirenderer <- CEGUIOgreRenderer.bootstrapSystem - - guiroot <- CEGUISystem.getSingletonPtr - guiwindowmgr <- CEGUIWindowManagerHG3D.getSingleton - guifontmgr <- CEGUISystemHG3D.getFontManagerSingleton - guischememgr <- CEGUISystemHG3D.getSchemeManagerSingleton - - CEGUIScheme.setDefaultResourceGroup "Schemes" - CEGUIImageset.setDefaultResourceGroup "Imagesets" - CEGUIFont.setDefaultResourceGroup "Fonts" - CEGUIWidgetLookManager.setDefaultResourceGroup "LookNFeel" - CEGUIWindowManager.setDefaultResourceGroup "Layouts" --- CEGUIScriptModule.setDefaultResourceGroup "lua_scripts" - - CEGUISystemHG3D.schemeManagerCreate guischememgr "VanillaSkin.scheme" - CEGUISystemHG3D.schemeManagerCreate guischememgr "WindowsLook.scheme" - CEGUISystemHG3D.schemeManagerCreate guischememgr "WindowsLookWidgets.scheme" - CEGUISystemHG3D.schemeManagerCreate guischememgr "TaharezLook.scheme" - CEGUISystemHG3D.schemeManagerCreate guischememgr "TaharezLookWidgets.scheme" - - CEGUISystemHG3D.fontManagerCreate guifontmgr "DejaVuSans-10.font" - - CEGUISystem.setDefaultFont guiroot "DejaVuSans-10" - if fShowGraphicsCursor then do - CEGUISystem.setDefaultMouseCursor3 guiroot "Vanilla-Images" "MouseArrow" - showCursor False - return () - else do - showCursor True - return () - CEGUISystem.setDefaultTooltip2 guiroot "WindowsLook/Tooltip" - - -- set standard empty gui sheet - myRoot <- CEGUIWindowManager.createWindow guiwindowmgr "DefaultWindow" "root" - CEGUISystem.setGUISheet guiroot myRoot - - eventController <- HG3DEventController.new - guiwmgrhg3d <- HG3DWindowManager.new - uniqueName <- createUniqueName "GUI" - - return (GUISystem guiroot guirenderer guiwindowmgr guiwmgrhg3d guifontmgr guischememgr eventController uniqueName) - -keyscanToScancode :: EnumSDLScancode -> Maybe Int -keyscanToScancode keyscan = if out == KeyMediaSelect then Nothing else (Just (fromIntegral (fromEnum out))) where - out = case keyscan of - SDL_SCANCODE_RETURN -> KeyReturn - SDL_SCANCODE_ESCAPE -> KeyEscape - SDL_SCANCODE_BACKSPACE -> KeyBackspace - SDL_SCANCODE_TAB -> KeyTab - SDL_SCANCODE_INSERT -> KeyInsert - SDL_SCANCODE_HOME -> KeyHome - SDL_SCANCODE_PAGEUP -> KeyPageUp - SDL_SCANCODE_DELETE -> KeyDelete - SDL_SCANCODE_END -> KeyEnd - SDL_SCANCODE_PAGEDOWN -> KeyPageDown - SDL_SCANCODE_RIGHT -> KeyArrowRight - SDL_SCANCODE_LEFT -> KeyArrowLeft - SDL_SCANCODE_DOWN -> KeyArrowDown - SDL_SCANCODE_UP ->KeyArrowUp - _ -> KeyMediaSelect -- misused as Nothing indicator - - -_injectKeyUp guiroot keycode = do - case keyscanToScancode keycode of - Nothing -> return False - Just scancode -> System.injectKeyUp guiroot scancode - -_injectKeyDown guiroot keycode = do - case keyscanToScancode keycode of - Nothing -> return False - Just scancode -> System.injectKeyDown guiroot scancode - --- keypressInject - --- | injects key presses into the CEGUI engine, used internally -injectWinEventToGUI :: GUISystem -> SDLEvent -> IO () -injectWinEventToGUI guis evt = do - - let guiroot = guiRoot guis - case evt of - EvtText ts window text -> System.injectChar guiroot (fromEnum (text !! 0)) - EvtKeyUp ts window keyscan keycode keymode -> _injectKeyUp guiroot keyscan - EvtKeyDown ts window keyscan keycode keymode -> _injectKeyDown guiroot keyscan - EvtMouseButtonUp ts window mid button x y -> do - case button of - SDLButtonLeft -> System.injectMouseButtonUp guiroot CEGUIButton.MouseLeftButton - SDLButtonRight -> System.injectMouseButtonUp guiroot CEGUIButton.MouseRightButton - SDLButtonMiddle -> System.injectMouseButtonUp guiroot CEGUIButton.MouseMiddleButton - _ -> return True - EvtMouseButtonDown ts window mid button x y -> do - case button of - SDLButtonLeft -> System.injectMouseButtonDown guiroot CEGUIButton.MouseLeftButton - SDLButtonRight -> System.injectMouseButtonDown guiroot CEGUIButton.MouseRightButton - SDLButtonMiddle -> System.injectMouseButtonDown guiroot CEGUIButton.MouseMiddleButton - _ -> return True - EvtMouseMotion ts window mid x y rx ry -> CEGUISystem.injectMousePosition guiroot (fromIntegral x) (fromIntegral y) - _ -> return True - - return () - --- | register a GUI Event, for later retrieval -registerGUIEvent :: GUISystem - -> GUIElement -- ^ GUI Element from which event is registered - -> String -- ^ event name, for which registration is done - -> String -- ^ identifier, with which event is identified later on - -> IO () -registerGUIEvent guis (GUIElement el) eventToRegister registrationTag = do - EvtSF.subscribeScriptedEvent el eventToRegister registrationTag - -data GUIEvent = GUIEvent String String GUIElement - -pollGUIEvents :: GUISystem -> IO [GUIEvent] -pollGUIEvents guis = do - let eventController = guiEventController guis - processEvents <- HG3DEventController.eventsAvailable eventController - if processEvents then do - (name, sender, window) <- HG3DEventController.popEvent eventController - let evt = GUIEvent name sender (GUIElement window) - moreEvents <- pollGUIEvents guis - return $ (evt : moreEvents) - else do - return [] diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs new file mode 100644 index 0000000..41d744d --- /dev/null +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -0,0 +1,431 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- GUI/Internal/Base.hs + +-- |Base functionality of the GUI. Implementation module with internal data structures exposed. Public API in HGamer3D.GUI. + +module HGamer3D.GUI.Internal.Base + +( + + -- * Data Definitions, Types + + GUISystem (..), + GUIElement (..), + + GUIEvent (..), + EventFunction, + + -- * Initialization, Game Loop + initGUI, + freeGUI, + pollGUIEvents, + + -- * Event Handling + registerGUIEvent, + injectWinEventToGUI, + + -- * Layout, Scheme, Font, Mause, Tooltip + loadGuiLayoutFromFile, + loadGuiScheme, + loadGuiFont, + setGuiDefaultFont, + setGuiDefaultMouseCursor, + setGuiDefaultTooltip, + + -- * Find and display GUI Elements + getChildGuiEl, + findChildGuiElRecursive, + addGuiElToDisplay, + removeGuiElFromDisplay, + + -- * Set specific GUI Element properties + getGuiElProperty, + setGuiElProperty, + enableGuiEl, + disableGuiEl, + activateGuiEl, + deactivateGuiEl, + showGuiEl, + hideGuiEl, + +) + +where + +import HGamer3D.Bindings.CEGUI.ClassOgreRenderer as CEGUIOgreRenderer +import HGamer3D.Bindings.CEGUI.ClassSystem as CEGUISystem +import HGamer3D.Bindings.CEGUI.ClassSystemHG3D as CEGUISystemHG3D +import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as CEGUIWindowManagerHG3D +import HGamer3D.Bindings.CEGUI.ClassWindowManager as CEGUIWindowManager +import HGamer3D.Bindings.CEGUI.ClassResourceProvider as CEGUIResourceProvider +import HGamer3D.Bindings.CEGUI.ClassDefaultResourceProvider as CEGUIDefaultResourceProvider +import HGamer3D.Bindings.CEGUI.ClassImageset as CEGUIImageset +import HGamer3D.Bindings.CEGUI.ClassFont as CEGUIFont +import HGamer3D.Bindings.CEGUI.ClassScheme as CEGUIScheme +import HGamer3D.Bindings.CEGUI.ClassWidgetLookManager as CEGUIWidgetLookManager +import HGamer3D.Bindings.CEGUI.ClassScriptModule as CEGUIScriptModule +import HGamer3D.Bindings.CEGUI.ClassLogger as CEGUILogger +import HGamer3D.Bindings.CEGUI.EnumLoggingLevel +import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton +import HGamer3D.Bindings.CEGUI.ClassFontManager as CEGUIFontManager +import HGamer3D.Bindings.CEGUI.ClassSchemeManager as CEGUISchemeManager +import HGamer3D.Bindings.CEGUI.ClassDefaultLogger as CEGUIDefaultLogger +import HGamer3D.Bindings.CEGUI.ClassHG3DEventController as HG3DEventController +import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as HG3DWindowManager +--import HGamer3D.Bindings.Ogre.ClassHG3DMessagePump as MessagePump + + +import GHC.Ptr + +import HGamer3D.Data +import HGamer3D.Util +import HGamer3D.WinEvent + +import HGamer3D.Bindings.CEGUI.ClassPtr +import HGamer3D.Bindings.CEGUI.Utils + +import HGamer3D.Bindings.CEGUI.ClassWindow as Window +import HGamer3D.Bindings.CEGUI.ClassWindowManager as WindowManager +import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as WindowManagerHG3D +import HGamer3D.Bindings.CEGUI.ClassWindow as Window +import HGamer3D.Bindings.CEGUI.ClassSystem as System +import HGamer3D.Bindings.CEGUI.ClassSystemHG3D as SystemHG3D +import HGamer3D.Bindings.CEGUI.ClassPropertySet as PropertySet +import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF +import HGamer3D.Bindings.CEGUI.ClassHG3DListboxStaticFunctions as ListboxSF +import HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions as WindowSF +import HGamer3D.Bindings.CEGUI.ClassListbox as Listbox +import HGamer3D.Bindings.CEGUI.ClassListboxItem as ListboxItem +import HGamer3D.Bindings.CEGUI.ClassCombobox as Combobox +import HGamer3D.Bindings.CEGUI.EnumKeyScan + +import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF + +import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton + +import HGamer3D.Data.HG3DClass + +import HGamer3D.WinEvent.Internal.Base (showCursor) + +data GUISystem = GUISystem { + guiRoot::HG3DClass, + guiRenderer::HG3DClass, + guiWindowManager::HG3DClass, + guiWindowManagerHG3D::HG3DClass, + guiFontManager::HG3DClass, + guiSchemeManager::HG3DClass, + guiEventController::HG3DClass, + guiUniqueName::UniqueName +} + +type EventFunction = IO () + +-- | The GUI Element, a window, a button, any widget or widget element, organized in a hierarchy +data GUIElement a = GUIElement HG3DClass a -- ^ only one constructor, phantom type a, to allow GUIElement sub-typing + + + + +-- | load a complete layout file into the application +loadGuiLayoutFromFile :: GUISystem + -> String -- ^ filename, without the path (this is defined by resource locations) + -> String -- ^ prefix to append to the identifiers in the layout, this allows, to load the same dailog/gui element multiple times with different names, if needed + -> IO (GUIElement a) -- ^ the resulting tree of GUI elements as top GUI element +loadGuiLayoutFromFile guis layoutFile prefix = do + let hg3dWinMgr = guiWindowManagerHG3D guis + window <- WindowManagerHG3D.loadWindowLayoutHG3D hg3dWinMgr layoutFile prefix + return (GUIElement window undefined) + +-- | add a GUI element to the display +addGuiElToDisplay :: GUISystem + -> GUIElement a -- ^ GUI element + -> IO () +addGuiElToDisplay guis (GUIElement window _) = do + let guir = guiRoot guis + guiSheet <- System.getGUISheet guir + Window.addChildWindow2 guiSheet window + +-- | remove a GUI element from the display +removeGuiElFromDisplay :: GUISystem + -> GUIElement a -- ^ GUI element + -> IO () +removeGuiElFromDisplay guis (GUIElement window _) = do + let guir = guiRoot guis + guiSheet <- System.getGUISheet guir + Window.removeChildWindow2 guiSheet window + +-- | enable GUI element, allow interaction with it and render it accordingly +enableGuiEl :: GUIElement a -- ^ GUI element to enable + -> IO () +enableGuiEl (GUIElement window _) = do + Window.enable window + +-- | disable GUI element, disallow interaction with it and render it accordingly +disableGuiEl :: GUIElement a -- ^ GUI element to disable + -> IO () +disableGuiEl (GUIElement window _) = do + Window.disable window + +-- | activate GUI element, process events send to it +activateGuiEl :: GUIElement a -- ^ GUI element to activate + -> IO () +activateGuiEl (GUIElement window _) = do + Window.activate window + +-- | deactivate GUI element, do not process events send to it +deactivateGuiEl :: GUIElement a -- ^ GUI element to deactivate + -> IO () +deactivateGuiEl (GUIElement window _) = do + Window.deactivate window + +-- | show GUI element +showGuiEl :: GUIElement a -- ^ GUI element to show + -> IO () +showGuiEl (GUIElement window _) = do + Window.show window + +-- | hide GUI element +hideGuiEl :: GUIElement a -- ^ GUI element to hide + -> IO () +hideGuiEl (GUIElement window _) = do + Window.hide window + +-- | get child gui element, throws an exception, if element not found in children, only searches the direct children of element. +getChildGuiEl :: GUIElement a -- ^ GUI element, which childrens are searched for child element + -> String -- ^ name of searched child element + -> IO (GUIElement a) -- ^ found element (throws exception, in case no child found) +getChildGuiEl (GUIElement window _) name = do + window <- Window.getChild window name + return (GUIElement window undefined) + +-- | find child element recursively, searches all sub-trees +findChildGuiElRecursive :: GUIElement a -- ^ GUI element, which childrens are searched, including children of children and so on. + -> String -- ^ name of child element to be found + -> IO (Maybe (GUIElement b)) -- ^ in case of found element: Just el, Nothing otherwhise +findChildGuiElRecursive (GUIElement window _) name = do + window <- Window.getChildRecursive window name + if (ocPtr window) == nullPtr then do + return Nothing + else do + return (Just (GUIElement window undefined)) + +-- | get a named property as string from element +getGuiElProperty :: GUIElement a -- ^ GUI element + -> String -- ^ property name to get + -> IO String -- ^ property value +getGuiElProperty (GUIElement window _) name = do + prop <- PropertySet.getProperty window name + return prop + +-- | set a named property +setGuiElProperty :: GUIElement a -- ^ GUI element + -> String -- ^ property name to set + -> String -- ^ property value as string + -> IO () +setGuiElProperty (GUIElement window _) name value = do + PropertySet.setProperty window name value + +-- | load a complete GUI scheme, see CEGUI manual for details +loadGuiScheme :: GUISystem -> String -- ^ scheme name + -> IO () +loadGuiScheme guis schemeName = do + SystemHG3D.schemeManagerCreate (guiSchemeManager guis) schemeName + +-- | load a GUI font +loadGuiFont :: GUISystem -> String -- ^ font name + -> IO () +loadGuiFont guis fontName = do + SystemHG3D.fontManagerCreate (guiFontManager guis) fontName + +-- | set default GUI font +setGuiDefaultFont :: GUISystem -> String -- ^ font name + -> IO () +setGuiDefaultFont guis fontName = do + let guir = guiRoot guis + System.setDefaultFont guir fontName + +-- | set default mouse cursor +setGuiDefaultMouseCursor :: GUISystem + -> String -- ^ scheme name, where cursor is contained in + -> String -- ^ cursor name + -> IO () +setGuiDefaultMouseCursor guis schemeName cursorName = do + let guir = guiRoot guis + System.setDefaultMouseCursor3 guir schemeName cursorName + +-- | set default tool tip +setGuiDefaultTooltip :: GUISystem -> String -- ^ default tool tip name + -> IO () +setGuiDefaultTooltip guis ttName = do + let guir = guiRoot guis + System.setDefaultTooltip2 guir ttName + + + + +-- | initialize the GUI system, used internally +initGUI :: Bool -- ^ logging flag + -> Bool -- ^ show graphics cursor flag + -> IO (GUISystem) -- ^ GUI system object +initGUI fShowGraphicsCursor fLog = do + + + -- CEGUI system + --------------- + + -- first logger, loglevel + + if not fLog then do + ceguilog <- CEGUISystemHG3D.createNoLogger + return () + else do + ceguilog <- CEGUIDefaultLogger.new + CEGUILogger.setLogFilename ceguilog "hgamer3d-gui.log" False + CEGUILogger.setLoggingLevel ceguilog LoggingLevelInformative + return () + + -- bootstrap complete cegui system + + guirenderer <- CEGUIOgreRenderer.bootstrapSystem + + guiroot <- CEGUISystem.getSingletonPtr + guiwindowmgr <- CEGUIWindowManagerHG3D.getSingleton + guifontmgr <- CEGUISystemHG3D.getFontManagerSingleton + guischememgr <- CEGUISystemHG3D.getSchemeManagerSingleton + + CEGUIScheme.setDefaultResourceGroup "Schemes" + CEGUIImageset.setDefaultResourceGroup "Imagesets" + CEGUIFont.setDefaultResourceGroup "Fonts" + CEGUIWidgetLookManager.setDefaultResourceGroup "LookNFeel" + CEGUIWindowManager.setDefaultResourceGroup "Layouts" +-- CEGUIScriptModule.setDefaultResourceGroup "lua_scripts" + + CEGUISystemHG3D.schemeManagerCreate guischememgr "VanillaSkin.scheme" + CEGUISystemHG3D.schemeManagerCreate guischememgr "WindowsLook.scheme" + CEGUISystemHG3D.schemeManagerCreate guischememgr "WindowsLookWidgets.scheme" + CEGUISystemHG3D.schemeManagerCreate guischememgr "TaharezLook.scheme" + CEGUISystemHG3D.schemeManagerCreate guischememgr "TaharezLookWidgets.scheme" + + CEGUISystemHG3D.fontManagerCreate guifontmgr "DejaVuSans-10.font" + + CEGUISystem.setDefaultFont guiroot "DejaVuSans-10" + if fShowGraphicsCursor then do + CEGUISystem.setDefaultMouseCursor3 guiroot "Vanilla-Images" "MouseArrow" + showCursor False + return () + else do + showCursor True + return () + CEGUISystem.setDefaultTooltip2 guiroot "WindowsLook/Tooltip" + + -- set standard empty gui sheet + myRoot <- CEGUIWindowManager.createWindow guiwindowmgr "DefaultWindow" "root" + CEGUISystem.setGUISheet guiroot myRoot + + eventController <- HG3DEventController.new + guiwmgrhg3d <- HG3DWindowManager.new + uniqueName <- createUniqueName "GUI" + + return (GUISystem guiroot guirenderer guiwindowmgr guiwmgrhg3d guifontmgr guischememgr eventController uniqueName) + +freeGUI :: GUISystem -> IO () +freeGUI gs = return () + +keyscanToScancode :: EnumSDLScancode -> Maybe Int +keyscanToScancode keyscan = if out == KeyMediaSelect then Nothing else (Just (fromIntegral (fromEnum out))) where + out = case keyscan of + SDL_SCANCODE_RETURN -> KeyReturn + SDL_SCANCODE_ESCAPE -> KeyEscape + SDL_SCANCODE_BACKSPACE -> KeyBackspace + SDL_SCANCODE_TAB -> KeyTab + SDL_SCANCODE_INSERT -> KeyInsert + SDL_SCANCODE_HOME -> KeyHome + SDL_SCANCODE_PAGEUP -> KeyPageUp + SDL_SCANCODE_DELETE -> KeyDelete + SDL_SCANCODE_END -> KeyEnd + SDL_SCANCODE_PAGEDOWN -> KeyPageDown + SDL_SCANCODE_RIGHT -> KeyArrowRight + SDL_SCANCODE_LEFT -> KeyArrowLeft + SDL_SCANCODE_DOWN -> KeyArrowDown + SDL_SCANCODE_UP ->KeyArrowUp + _ -> KeyMediaSelect -- misused as Nothing indicator + + +_injectKeyUp guiroot keycode = do + case keyscanToScancode keycode of + Nothing -> return False + Just scancode -> System.injectKeyUp guiroot scancode + +_injectKeyDown guiroot keycode = do + case keyscanToScancode keycode of + Nothing -> return False + Just scancode -> System.injectKeyDown guiroot scancode + +-- keypressInject + +-- | injects key presses into the CEGUI engine, used internally +injectWinEventToGUI :: GUISystem -> SDLEvent -> IO () +injectWinEventToGUI guis evt = do + + let guiroot = guiRoot guis + case evt of + EvtText ts window text -> System.injectChar guiroot (fromEnum (text !! 0)) + EvtKeyUp ts window keyscan keycode keymode -> _injectKeyUp guiroot keyscan + EvtKeyDown ts window keyscan keycode keymode -> _injectKeyDown guiroot keyscan + EvtMouseButtonUp ts window mid button x y -> do + case button of + SDLButtonLeft -> System.injectMouseButtonUp guiroot CEGUIButton.MouseLeftButton + SDLButtonRight -> System.injectMouseButtonUp guiroot CEGUIButton.MouseRightButton + SDLButtonMiddle -> System.injectMouseButtonUp guiroot CEGUIButton.MouseMiddleButton + _ -> return True + EvtMouseButtonDown ts window mid button x y -> do + case button of + SDLButtonLeft -> System.injectMouseButtonDown guiroot CEGUIButton.MouseLeftButton + SDLButtonRight -> System.injectMouseButtonDown guiroot CEGUIButton.MouseRightButton + SDLButtonMiddle -> System.injectMouseButtonDown guiroot CEGUIButton.MouseMiddleButton + _ -> return True + EvtMouseMotion ts window mid x y rx ry -> CEGUISystem.injectMousePosition guiroot (fromIntegral x) (fromIntegral y) + _ -> return True + + return () + +-- | register a GUI Event, for later retrieval +registerGUIEvent :: GUISystem + -> GUIElement a -- ^ GUI Element from which event is registered + -> String -- ^ event name, for which registration is done + -> String -- ^ identifier, with which event is identified later on + -> IO () +registerGUIEvent guis (GUIElement el _) eventToRegister registrationTag = do + EvtSF.subscribeScriptedEvent el eventToRegister registrationTag + +data GUIEvent = GUIEvent String String (GUIElement ()) + +pollGUIEvents :: GUISystem -> IO [GUIEvent] +pollGUIEvents guis = do + let eventController = guiEventController guis + processEvents <- HG3DEventController.eventsAvailable eventController + if processEvents then do + (name, sender, window) <- HG3DEventController.popEvent eventController + let evt = GUIEvent name sender (GUIElement window ()) + moreEvents <- pollGUIEvents guis + return $ (evt : moreEvents) + else do + return [] + diff --git a/GUI/HGamer3D/GUI/Internal/Properties.hs b/GUI/HGamer3D/GUI/Internal/Properties.hs new file mode 100644 index 0000000..c35fbde --- /dev/null +++ b/GUI/HGamer3D/GUI/Internal/Properties.hs @@ -0,0 +1,135 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- GUI/Internal/Properties.hs + +-- |Properties functionality of the GUI. Implementation module with internal data structures exposed. Public API in HGamer3D.GUI. + +module HGamer3D.GUI.Internal.Properties + +( + + -- * Property Types +GUIElementProperty, +GUIButtonProperty, +GUIRadioButtonProperty, +GUICheckBoxProperty, +GUIEditTextProperty, +GUISliderProperty, +GUISpinnerProperty, + +-- * Property Functions +(=:), +setP, +getP, + +-- * GUI Element Properties, for all GUI elements +pText, +pDisabled, +pVisible, +pAlpha, +pTooltip, +pAlwaysOnTop, + +) + +where + + +import GHC.Ptr +import Data.List.Split +import Control.Monad + +import HGamer3D.Data +import HGamer3D.Util + +import HGamer3D.GUI.Internal.Base +import HGamer3D.GUI.Internal.Widgets +import HGamer3D.Data.HG3DClass + +type GUIElementProperty a b = (GUIElement a -> IO b, GUIElement a -> b -> IO ()) +type GUIButtonProperty b = GUIElementProperty GEButton b +type GUIRadioButtonProperty b = GUIElementProperty GERadioButton b +type GUICheckBoxProperty b = GUIElementProperty GECheckBox b +type GUIEditTextProperty b = GUIElementProperty GEEditText b +type GUISliderProperty b = GUIElementProperty GESlider b +type GUISpinnerProperty b = GUIElementProperty GESpinner b + +(=:) :: (GUIElementProperty a b) -> b -> (GUIElement a -> IO ()) +(=:) prop val = (\val' guiel -> (snd prop) guiel val') val + +setP :: GUIElement a -> [GUIElement a -> IO ()] -> IO [()] +setP guiel ps = sequence $ fmap (\f -> f guiel) ps + +getP :: GUIElement a -> GUIElementProperty a b -> IO b +getP guiel p = (fst p) guiel + +_stringProp :: String -> GUIElementProperty a String +_stringProp name = ( + (flip getGuiElProperty) name, + (\pname guiel val -> setGuiElProperty guiel pname val) name + ) + +_toBool :: String -> Bool +_toBool instr = case instr of + "True" -> True + "False" -> False + _ -> False + +_fromBool :: Bool -> String +_fromBool inb = case inb of + True -> "True" + False -> "False" + _ -> "False" + +_toFloat :: String -> Float +_toFloat = read + +_fromFloat :: Float -> String +_fromFloat = show + +_boolProp :: String -> GUIElementProperty a Bool +_boolProp name = ( + ((flip getGuiElProperty) name) >=> return . _toBool, + ((\pname guiel val -> setGuiElProperty guiel pname (_fromBool val)) name) + ) + +_floatProp :: String -> GUIElementProperty a Float +_floatProp name = ( + ((flip getGuiElProperty) name) >=> return . _toFloat, + ((\pname guiel val -> setGuiElProperty guiel pname (_fromFloat val)) name) + ) + +pText :: GUIElementProperty a String +pText = _stringProp "Text" + +pDisabled :: GUIElementProperty a Bool +pDisabled = _boolProp "Disabled" + +pVisible :: GUIElementProperty a Bool +pVisible = _boolProp "Visible" + +pAlpha :: GUIElementProperty a Float +pAlpha = _floatProp "Alpha" + +pAlwaysOnTop :: GUIElementProperty a Bool +pAlwaysOnTop = _boolProp "AlwaysOnTop" + +pTooltip :: GUIElementProperty a String +pTooltip = _stringProp "Tooltip" + diff --git a/GUI/HGamer3D/GUI/Internal/Widgets.hs b/GUI/HGamer3D/GUI/Internal/Widgets.hs new file mode 100644 index 0000000..d173284 --- /dev/null +++ b/GUI/HGamer3D/GUI/Internal/Widgets.hs @@ -0,0 +1,296 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- GUI/Internal/Widgets.hs + +-- |Widget functionality of the GUI. Implementation module with internal data structures exposed. Public API in HGamer3D.GUI. + +module HGamer3D.GUI.Internal.Widgets + +( + + GUIButton (..), + GUIRadioButton (..), + GUICheckBox (..), + GUIEditText (..), + GUIListBox (..), + GUIComboBox (..), + GUISlider (..), + GUISpinner (..), + + GEButton (..), + GERadioButton (..), + GECheckBox (..), + GEEditText (..), + GEListBox (..), + GEComboBox (..), + GESlider (..), + GESpinner (..), + + typeOfGuiEl, + toGuiType, + + toButton, + toRadioButton, + toCheckBox, + toEditText, + toComboBox, + toListBox, + toSpinner, + toSlider, + + findButton, + findRadioButton, + findCheckBox, + findEditText, + findComboBox, + findListBox, + findSpinner, + findSlider, + + -- * Listbox, Compobox specific functions + listboxAddText, + listboxGetSelectedText, + listboxRemoveAllText, + listboxInitialize, + listboxStatus, + comboboxAddText, + comboboxRemoveAllText, + +) + +where + +import HGamer3D.Bindings.CEGUI.ClassOgreRenderer as CEGUIOgreRenderer +import HGamer3D.Bindings.CEGUI.ClassSystem as CEGUISystem +import HGamer3D.Bindings.CEGUI.ClassSystemHG3D as CEGUISystemHG3D +import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as CEGUIWindowManagerHG3D +import HGamer3D.Bindings.CEGUI.ClassWindowManager as CEGUIWindowManager +import HGamer3D.Bindings.CEGUI.ClassResourceProvider as CEGUIResourceProvider +import HGamer3D.Bindings.CEGUI.ClassDefaultResourceProvider as CEGUIDefaultResourceProvider +import HGamer3D.Bindings.CEGUI.ClassImageset as CEGUIImageset +import HGamer3D.Bindings.CEGUI.ClassFont as CEGUIFont +import HGamer3D.Bindings.CEGUI.ClassScheme as CEGUIScheme +import HGamer3D.Bindings.CEGUI.ClassWidgetLookManager as CEGUIWidgetLookManager +import HGamer3D.Bindings.CEGUI.ClassScriptModule as CEGUIScriptModule +import HGamer3D.Bindings.CEGUI.ClassLogger as CEGUILogger +import HGamer3D.Bindings.CEGUI.EnumLoggingLevel +import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton +import HGamer3D.Bindings.CEGUI.ClassFontManager as CEGUIFontManager +import HGamer3D.Bindings.CEGUI.ClassSchemeManager as CEGUISchemeManager +import HGamer3D.Bindings.CEGUI.ClassDefaultLogger as CEGUIDefaultLogger +import HGamer3D.Bindings.CEGUI.ClassHG3DEventController as HG3DEventController +import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as HG3DWindowManager +--import HGamer3D.Bindings.Ogre.ClassHG3DMessagePump as MessagePump + + +import GHC.Ptr +import Data.List.Split + +import HGamer3D.Data +import HGamer3D.Util + +-- import HGamer3D.Internal.WinEvent + +import HGamer3D.Bindings.CEGUI.ClassPtr +import HGamer3D.Bindings.CEGUI.Utils + +import HGamer3D.Bindings.CEGUI.ClassWindow as Window +import HGamer3D.Bindings.CEGUI.ClassWindowManager as WindowManager +import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as WindowManagerHG3D +import HGamer3D.Bindings.CEGUI.ClassWindow as Window +import HGamer3D.Bindings.CEGUI.ClassSystem as System +import HGamer3D.Bindings.CEGUI.ClassSystemHG3D as SystemHG3D +import HGamer3D.Bindings.CEGUI.ClassPropertySet as PropertySet +import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF +import HGamer3D.Bindings.CEGUI.ClassHG3DListboxStaticFunctions as ListboxSF +import HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions as WindowSF +import HGamer3D.Bindings.CEGUI.ClassListbox as Listbox +import HGamer3D.Bindings.CEGUI.ClassListboxItem as ListboxItem +import HGamer3D.Bindings.CEGUI.ClassCombobox as Combobox +import HGamer3D.Bindings.CEGUI.EnumKeyScan + +import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF + +import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton + +import HGamer3D.GUI.Internal.Base +import HGamer3D.Data.HG3DClass + +data GEButton = GEButton +data GERadioButton = GERadioButton +data GECheckBox = GECheckBox + +data GEEditText = GEEditText + +data GEListBox = GEListBox +data GEComboBox = GEComboBox + +data GESlider = GESlider +data GESpinner = GESpinner + +-- | GUI Element, Sybtype Button +type GUIButton = GUIElement GEButton + +-- | GUI Element, Sybtype RadioButton +type GUIRadioButton = GUIElement GERadioButton + +-- | GUI Element, Sybtype CheckBox +type GUICheckBox = GUIElement GECheckBox + +-- | GUI Element, Sybtype EditText +type GUIEditText = GUIElement GEEditText + +-- | GUI Element, Sybtype Listbox +type GUIListBox = GUIElement GEListBox + +-- | GUI Element, Sybtype Combobox +type GUIComboBox = GUIElement GEComboBox + +-- | GUI Element, Sybtype Slider +type GUISlider = GUIElement GESlider + +-- | GUI Element, Sybtype Spinner +type GUISpinner = GUIElement GESpinner + + +-- | get Type of GUI element as string +typeOfGuiEl :: GUIElement a -- ^ GUI element to enable + -> IO String +typeOfGuiEl (GUIElement window _) = do + Window.getType window + +toGuiType :: String -> b -> GUIElement a -> IO (Maybe (GUIElement b)) +toGuiType typestr cons guiel@(GUIElement window _) = do + tp <- typeOfGuiEl guiel + -- CEGUI Types as String have the format "WindowLook/Button" for example + let tp' = (splitOn "/" tp) !! 1 + let guiel' = case tp' of + typestr -> Just $ GUIElement window cons + _ -> Nothing + return guiel' + +toButton = toGuiType "Button" GEButton +toRadioButton = toGuiType "RadioButton" GERadioButton +toCheckBox = toGuiType "Checkbox" GECheckBox + +toEditText = toGuiType "EditText" GEEditText + +toComboBox = toGuiType "Combobox" GEComboBox +toListBox = toGuiType "Listbox" GEListBox + +toSlider = toGuiType "Slider" GESlider +toSpinner = toGuiType "Spinner" GESpinner + +findElement :: (GUIElement a -> IO (Maybe (GUIElement b))) + ->String + -> GUIElement a + -> IO (Maybe (GUIElement b)) +findElement toNewType name topel = do + mFound <- findChildGuiElRecursive topel name + case mFound of + Nothing -> return Nothing + Just guiel -> toNewType guiel + +findButton = findElement toButton +findRadioButton = findElement toRadioButton +findCheckBox = findElement toCheckBox +findEditText = findElement toEditText +findComboBox = findElement toComboBox +findListBox = findElement toListBox +findSpinner = findElement toSpinner +findSlider = findElement toSlider + +-- | add one line of text as a selectable entry to a combobox +comboboxAddText :: GUIComboBox -- ^ GUI element, needs to be a combobox + -> String -- ^ the entry string to add + -> IO () +comboboxAddText (GUIElement window GEComboBox) itemname = do + realcombo <- WindowSF.castWindowToCombobox window + ListboxSF.comboboxAddItem realcombo itemname + +-- | removes all lines of entries from a combobox +comboboxRemoveAllText :: GUIComboBox -- ^ the GUI elements, needs to be a combobox + -> IO () +comboboxRemoveAllText (GUIElement window GEComboBox) = do + realcombo <- WindowSF.castWindowToCombobox window + Combobox.resetList realcombo + +-- | add one line of text as a selectable entry to a listbox +listboxAddText :: GUIListBox -- ^ GUI element, needs to be a listbox + -> String -- ^ the entry string to add + -> IO () +listboxAddText (GUIElement window GEListBox) itemname = do + reallistbox <- WindowSF.castWindowToListbox window + ListboxSF.listboxAddItem reallistbox itemname + +_getTextListOfItem reallistbox item list = do + let (HG3DClass ptra ptrb) = item + if ptra /= nullPtr then do + txt <- ListboxItem.getText item + let list' = list ++ [txt] + item' <- Listbox.getNextSelected reallistbox item + list'' <- _getTextListOfItem reallistbox item' list' + return list'' + else do + return list + +listboxInitialize :: GUIListBox -- ^ GUI element, needs to be a listbox + -> [(String, Bool)] -- ^ list of entry, selected pairs + -> IO () +listboxInitialize (GUIElement window GEListBox) pairs = do + reallistbox <- WindowSF.castWindowToListbox window + Listbox.resetList reallistbox + mapM ( \((entry, selected), ind) -> do + ListboxSF.listboxAddItem reallistbox entry + item <- Listbox.getListboxItemFromIndex reallistbox ind + ListboxItem.setSelected item selected + return () + ) (zip pairs [0..]) + return () + +listboxStatus :: GUIListBox -- ^ GUI element, needs to be a listbox + -> IO [(String, Bool)] -- ^ list of entry, selected pairs +listboxStatus (GUIElement window GEListBox) = do + reallistbox <- WindowSF.castWindowToListbox window + count <- Listbox.getItemCount reallistbox + outlist <- mapM ( \ind -> do + item <- Listbox.getListboxItemFromIndex reallistbox ind + sel <- ListboxItem.isSelected item + txt <- ListboxItem.getText item + return (txt, sel) + ) [0..(count-1)] + return outlist + + +-- | return the selected items as an array of strings +listboxGetSelectedText :: GUIListBox -- ^ the GUI element, needs to be a listbox + -> IO [String] -- ^ the selected items as an array of strings +listboxGetSelectedText (GUIElement window GEListBox) = do + reallistbox <- WindowSF.castWindowToListbox window + item <- Listbox.getFirstSelectedItem reallistbox + list <- _getTextListOfItem reallistbox item ([]::[String]) + return list + +-- | removes all lines of entries from a listbox +listboxRemoveAllText :: GUIListBox -- ^ the GUI element, needs to be a listbox + -> IO () +listboxRemoveAllText (GUIElement window GEListBox) = do + reallistbox <- WindowSF.castWindowToListbox window + Listbox.resetList reallistbox + diff --git a/GUI/SConstruct b/GUI/SConstruct index 52ef589..3793c7a 100644 --- a/GUI/SConstruct +++ b/GUI/SConstruct @@ -1,5 +1,5 @@ -# SConstruct file to build Haskell packages -# ######################################### +# SConstruct file to build Haskell packages for GUI module +# ######################################################## # set environment ################# @@ -14,14 +14,23 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - Glob("HGamer3D/*"), + "HGamer3D/GUI.hs", + Glob("HGamer3D/GUI/Internal/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), + Glob("../Bindings/CEGUI/hBuild/dist/HGamer3D-*.tar.gz"), + Glob("../WinEvent/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", + "cabal configure --user", "cabal build", "cabal haddock", diff --git a/Graphics3D/HGamer3D-Graphics3D.cabal b/Graphics3D/HGamer3D-Graphics3D.cabal index 5a2d235..9ceeb8d 100644 --- a/Graphics3D/HGamer3D-Graphics3D.cabal +++ b/Graphics3D/HGamer3D-Graphics3D.cabal @@ -21,7 +21,7 @@ Library Build-Depends: base >= 3 && < 5, containers, mtl, transformers, filepath, directory, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Ogre-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Graphics3D.Base, HGamer3D.Graphics3D.Shapes, HGamer3D.Graphics3D.PlatonShapes, HGamer3D.Graphics3D.Light, HGamer3D.Graphics3D + Exposed-modules: HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D Other-modules: c-sources: diff --git a/Graphics3D/HGamer3D/Graphics3D.hs b/Graphics3D/HGamer3D/Graphics3D.hs index b7a07d2..3896a4c 100644 --- a/Graphics3D/HGamer3D/Graphics3D.hs +++ b/Graphics3D/HGamer3D/Graphics3D.hs @@ -18,45 +18,38 @@ -- Graphics.hs --- | 3D Graphics for HGamer3D +-- | 3D Graphics for HGamer3D, public API. module HGamer3D.Graphics3D ( - module HGamer3D.Data, - module HGamer3D.Util, - -- * Fundamental Types + Graphics3DSystem, Object3D, Material, Mesh, Camera, + Viewport, - -- * Initialization - - Graphics3DSystem, - initHGamer3D, - exitHGamer3D, - loopHGamer3D, - - -- * Misc Functions + -- * Initialization and Game Loop Functions - cameraLookAt, - HGamer3D.Graphics3D.Base.setBackgroundColour, - addResourceLocationMedia, - addResourceZipfileMedia, - addResourceLocationGUI, + initGraphics3D, + freeGraphics3D, + stepGraphics3D, -- * Light Light, - HGamer3D.Graphics3D.Light.setAmbientLight, + HGamer3D.Graphics3D.Internal.Light.setAmbientLight, pointLight, spotLight, spotLightSetDirection, setSpotLightAngle, directionalLight, - -- * Shapes + -- * Materials + resourceMaterial, + + -- * Meshes sphereMesh, cubeMesh, planeMesh, @@ -66,11 +59,20 @@ module HGamer3D.Graphics3D colouredLineMesh, rainbowCubeMesh, - createIkosaederMesh, - createDodekaederMesh, + ikosaederMesh, + dodekaederMesh, + -- * Graphics Objects object3DFromMesh, - object3DFromObjects + object3DFromObjects, + + -- * Misc Functions + + cameraLookAt, + HGamer3D.Graphics3D.Internal.Base.setBackgroundColour, + addResourceLocationMedia, + addResourceZipfileMedia, + addResourceLocationGUI, ) @@ -79,18 +81,11 @@ where import HGamer3D.Data import HGamer3D.Util - import HGamer3D.Graphics3D.Base - import HGamer3D.Graphics3D.Light - import HGamer3D.Graphics3D.Shapes - import HGamer3D.Graphics3D.PlatonShapes - - initHGamer3D windowName sceneManagerType fConfig fLog = do - (g3ds, camera, viewport, window) <- initGraphics3D windowName sceneManagerType fConfig fLog - return (g3ds, camera, viewport) - - exitHGamer3D = exitGraphics3D + import HGamer3D.Graphics3D.Internal.Base + import HGamer3D.Graphics3D.Internal.Light + import HGamer3D.Graphics3D.Internal.Shapes + import HGamer3D.Graphics3D.Internal.PlatonShapes - loopHGamer3D = loopGraphics3D diff --git a/Graphics3D/HGamer3D/Graphics3D/Base.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs similarity index 93% rename from Graphics3D/HGamer3D/Graphics3D/Base.hs rename to Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs index 022b64a..f1f11fb 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Base.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs @@ -18,15 +18,17 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Base.hs +-- Graphics3D/Internal/Base.hs --- | Basic Types, Initialization and some global functions for the Graphics3D module -module HGamer3D.Graphics3D.Base ( +-- | Basic Types, Initialization and some global functions for the Graphics3D module. This is the internal implementation module. The external API is in HGamer3D.Graphics3D. +module HGamer3D.Graphics3D.Internal.Base ( -- * Fundamental Types Object3D (..), Material (..), + resourceMaterial, + Mesh (..), Camera (..), @@ -43,14 +45,14 @@ module HGamer3D.Graphics3D.Base ( Graphics3DSystem (..), - -- * Initialization of Graphics3D and Game Loop + -- * Initialization of Graphics3D and Game Loop Functions initGraphics3D, - exitGraphics3D, - loopGraphics3D, + freeGraphics3D, + stepGraphics3D, -- * global functions cameraLookAt, - HGamer3D.Graphics3D.Base.setBackgroundColour, + HGamer3D.Graphics3D.Internal.Base.setBackgroundColour, addResourceLocationMedia, addResourceZipfileMedia, addResourceLocationGUI, @@ -65,6 +67,9 @@ module HGamer3D.Graphics3D.Base ( where import HGamer3D.Data +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Window + import HGamer3D.Util import qualified HGamer3D.Bindings.Ogre.ClassRoot as Root @@ -103,6 +108,11 @@ import HGamer3D.Util -- | The material. Define how an object is looking. Currently we have materials from resources data Material = ResourceMaterial String -- ^ a named material, already installed as a resource +-- | give back a resource Material +resourceMaterial :: String -- ^ the name of the Material as a resource + -> Material -- ^ the created material +resourceMaterial name = ResourceMaterial name + -- | The mesh. A mesh in HGamer3D is just that, a mesh loaded from a template, a manual mesh, or loaded from file. It comes with default -- material, but 3D objects based on this can get other materials individually. data Mesh = CubeMesh | -- ^ Cube Mesh-Type @@ -203,16 +213,17 @@ renderOneFrame g3ds = do Root.renderOneFrame root return () - -loopGraphics3D :: Graphics3DSystem -> IO Bool -loopGraphics3D g3ds = do +-- | steps the game loop by one tick, renders a frame and handles system messages +stepGraphics3D :: Graphics3DSystem -- ^ the graphics3d system + -> IO Bool -- ^ quit flag, true if window closed +stepGraphics3D g3ds = do renderOneFrame g3ds graphics3DPumpWindowMessages i <- checkQuitReceived return (i == 1) -exitGraphics3D :: Graphics3DSystem -> IO () -exitGraphics3D g3ds = do +freeGraphics3D :: Graphics3DSystem -> IO () +freeGraphics3D g3ds = do let (RootObject root) = g3dsRoot g3ds let (RenderTarget rt) = g3dsRenderTarget g3ds Root.destroyRenderTarget root rt diff --git a/Graphics3D/HGamer3D/Graphics3D/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs similarity index 92% rename from Graphics3D/HGamer3D/Graphics3D/Light.hs rename to Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs index 1fa8bcd..8ffc667 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs @@ -18,18 +18,18 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Light.hs +-- Graphics3D/Internal/Light.hs --- | Creating and managing Light in Base API. +-- | Creating and managing Light in Base API. Internal implementation module. Public API is in HGamer3D.Graphics3D. -module HGamer3D.Graphics3D.Light ( +module HGamer3D.Graphics3D.Internal.Light ( -- * Types Light (..), -- * create and modify light sources - HGamer3D.Graphics3D.Light.setAmbientLight, + HGamer3D.Graphics3D.Internal.Light.setAmbientLight, pointLight, spotLight, spotLightSetDirection, @@ -41,6 +41,7 @@ where import HGamer3D.Data +import HGamer3D.Data.HG3DClass import HGamer3D.Util import GHC.Ptr @@ -80,7 +81,7 @@ import HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType import HGamer3D.Data.HG3DClass import HGamer3D.Data.Transform3D -import HGamer3D.Graphics3D.Base +import HGamer3D.Graphics3D.Internal.Base import Control.Monad import Control.Monad.Trans diff --git a/Graphics3D/HGamer3D/Graphics3D/PlatonShapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs similarity index 92% rename from Graphics3D/HGamer3D/Graphics3D/PlatonShapes.hs rename to Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs index dd7dc9f..9a143df 100644 --- a/Graphics3D/HGamer3D/Graphics3D/PlatonShapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs @@ -18,13 +18,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- PlatonShapes.hs +-- Graphics3D/Internal/PlatonShapes.hs --- | Create platonic shapes, ikosaeder and dodekaeder -module HGamer3D.Graphics3D.PlatonShapes ( +-- | Create platonic shapes, ikosaeder and dodekaeder, implementation module. Public API is in HGamer3D.Graphics3D. +module HGamer3D.Graphics3D.Internal.PlatonShapes ( - createIkosaederMesh, - createDodekaederMesh + ikosaederMesh, + dodekaederMesh ) where @@ -33,6 +33,7 @@ where import GHC.Ptr import HGamer3D.Data +import HGamer3D.Data.HG3DClass import HGamer3D.Util import HGamer3D.Bindings.Ogre.ClassPtr @@ -67,7 +68,7 @@ import HGamer3D.Bindings.Ogre.ClassControllerManager as ControllerManager import HGamer3D.Bindings.Ogre.ClassWindowEventUtilities as WindowEventUtilities import HGamer3D.Bindings.Ogre.ClassManualObject as ManualObject -import HGamer3D.Graphics3D.Base +import HGamer3D.Graphics3D.Internal.Base import Control.Monad import Control.Monad.Trans @@ -123,10 +124,10 @@ _createPlatonObject g3ds colour vertices faces iColor = do -- | create an ikoaeder mesh - from the mesh more objects can be created -createIkosaederMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D +ikosaederMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D -> Colour -- ^ colour of the ikosaeder -> IO Mesh -- ^ created mesh object -createIkosaederMesh g3ds colour = do +ikosaederMesh g3ds colour = do let (SceneManager scm) = (g3dsSceneManager g3ds) uid <- nextUniqueName (g3dsUniqueName g3ds) @@ -166,10 +167,10 @@ createIkosaederMesh g3ds colour = do -- | create a dodekaeder mesh -createDodekaederMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D +dodekaederMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D -> Colour -- ^ colour of the dodekaeder -> IO Mesh -- ^ created dodekaeder mesh -createDodekaederMesh g3ds colour = do +dodekaederMesh g3ds colour = do let (SceneManager scm) = (g3dsSceneManager g3ds) uid <- nextUniqueName (g3dsUniqueName g3ds) diff --git a/Graphics3D/HGamer3D/Graphics3D/Shapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs similarity index 97% rename from Graphics3D/HGamer3D/Graphics3D/Shapes.hs rename to Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs index 3984e32..95d3b4f 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Shapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs @@ -18,10 +18,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Object3D.hs +-- Graphics3D/Internal/Object3D.hs --- | Creating and managing 3D objects functionality for Graphics3D module -module HGamer3D.Graphics3D.Shapes ( +-- | Creating and managing 3D objects functionality for Graphics3D module, internal implemenatation module. Public API is HGamer3D.Graphics3D. +module HGamer3D.Graphics3D.Internal.Shapes ( -- * Mesh creation functions, standard meshes sphereMesh, @@ -43,6 +43,7 @@ module HGamer3D.Graphics3D.Shapes ( where import HGamer3D.Data +import HGamer3D.Data.HG3DClass import HGamer3D.Util import GHC.Ptr @@ -81,7 +82,7 @@ import HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType import HGamer3D.Data.HG3DClass import HGamer3D.Data.Transform3D -import HGamer3D.Graphics3D.Base +import HGamer3D.Graphics3D.Internal.Base import Control.Monad import Control.Monad.Trans diff --git a/Graphics3D/SConstruct b/Graphics3D/SConstruct index 451f73d..5e1c9dd 100644 --- a/Graphics3D/SConstruct +++ b/Graphics3D/SConstruct @@ -1,5 +1,5 @@ -# SConstruct file to build Haskell packages -# ######################################### +# SConstruct file to build Haskell packages for Ogre module +# ######################################################### # set environment ################# @@ -14,16 +14,22 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - Glob("HGamer3D/*"), - Glob("HGamer3D/Graphics3D/*"), - Glob("HGamer3D/Graphics3D/Data/*"), + "HGamer3D/Graphics3D.hs", + Glob("HGamer3D/Graphics3D/Internal/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), + Glob("../Bindings/Ogre/hBuild/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", + "cabal configure --user", "cabal build", "cabal haddock", diff --git a/InputSystem/HGamer3D-InputSystem.cabal b/InputSystem/HGamer3D-InputSystem.cabal index 8df8a65..a91dbb7 100644 --- a/InputSystem/HGamer3D-InputSystem.cabal +++ b/InputSystem/HGamer3D-InputSystem.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-InputSystem -Version: 0.3.0 +Version: 0.4.0 Synopsis: Joystick, Mouse and Keyboard Functionality for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -19,9 +19,9 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.3.0 && < 0.4.0, HGamer3D-SFML-Binding >= 0.3.0 && < 0.4.0, HGamer3D-SDL2-Binding >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-SFML-Binding >= 0.4.0 && < 0.5.0, HGamer3D-SDL2-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.InputSystem + Exposed-modules: HGamer3D.InputSystem.Internal.Base, HGamer3D.InputSystem Other-modules: c-sources: diff --git a/InputSystem/HGamer3D/InputSystem.hs b/InputSystem/HGamer3D/InputSystem.hs index 2ca03c4..870e776 100644 --- a/InputSystem/HGamer3D/InputSystem.hs +++ b/InputSystem/HGamer3D/InputSystem.hs @@ -19,7 +19,7 @@ -- InputSystem.hs --- | Mouse, Keyboard and Joystick functionality for HGamer3D +-- | Mouse, Keyboard and Joystick functionality for HGamer3D, public API. module HGamer3D.InputSystem @@ -29,8 +29,8 @@ module HGamer3D.InputSystem module HGamer3D.Bindings.SFML.EnumKey, module HGamer3D.Bindings.SFML.EnumMouseButton, - Joystick (..), - JoystickButton (..), + Joystick, + JoystickButton, -- * Joystick Functions updateJoystickStatus, @@ -78,103 +78,5 @@ import HGamer3D.Bindings.SFML.EnumMouseButton import Control.Monad --- | The Joystick -data Joystick = Joystick Int deriving (Eq) -data JoystickButton = JoystickButton Int deriving (Eq) - -instance Show Joystick where - show (Joystick j) = show $ "Joystick-" ++ (show j) - -instance Show JoystickButton where - show (JoystickButton jb) = show $ "JoystickButton-" ++ (show jb) - -instance Show EnumJoystickAxis where - show axis = "JoystickAxis-" ++ (case axis of - JoystickAxisX -> "X" - JoystickAxisY -> "Y" - JoystickAxisZ -> "Z" - JoystickAxisR -> "R" - JoystickAxisU -> "U" - JoystickAxisV -> "V" - JoystickAxisPovX -> "PovX" - JoystickAxisPovY -> "PoxY" - ) - - - --- Joystick funtions --- - --- | This functions gathers the Joystick inputs. It should called frequently, for example during the gameloop, to get new values and new Joystick availability. At least it should be called before querying the Joystick values. -updateJoystickStatus :: IO () -updateJoystickStatus = JST.update - --- | Get a list of connected Joysticks. -getConnectedJoysticks :: IO [Joystick] -- ^ returns list of connected Joysticks -getConnectedJoysticks = do - let ns = [ x | x <- [0..15]] - jns <- filterM (\jn -> do - c <- JST.isConnected jn - return (c) ) ns - let js = map Joystick jns - return js - --- | Queries, if a specific Joystick is connected. -isJoystickConnected :: Joystick -- ^ the Joystick to be queried - -> IO Bool -- ^ True: Joystick is connected -isJoystickConnected (Joystick jn) = do - rv <- JST.isConnected jn - return rv - --- | Queries the available axes of one specific Joystick -getJoystickAxes:: Joystick -- ^ the Joystick to be queried - -> IO [EnumJoystickAxis] -- ^ returns a list of available axes -getJoystickAxes (Joystick j) = do - axes <- filterM ( \a -> do - JST.hasAxis j a) [ JoystickAxisX, JoystickAxisY, JoystickAxisZ, - JoystickAxisR, JoystickAxisU, JoystickAxisV, - JoystickAxisPovX, JoystickAxisPovY ] - return axes - --- | Queries the available buttons of one specific Joystick -getJoystickButtons :: Joystick -- ^ the Joystick to be queried - -> IO [JoystickButton] -- ^ returns a list of available buttons -getJoystickButtons (Joystick j) = do - jn <- JST.getButtonCount j - let btns = map JoystickButton [0..(jn-1)] - return btns - --- | Check if a specific Joystick Button is currently pressed -isJoystickButtonPressed :: Joystick -- ^ the Joystick - -> JoystickButton -- ^ the Button - -> IO Bool -- ^ returns True if pressed -isJoystickButtonPressed (Joystick j) (JoystickButton b) = JST.isButtonPressed j b - --- | Queries the current position of a Joystick Axis -getJoystickAxisPosition :: Joystick -- ^ the Joystick - -> EnumJoystickAxis -- ^ the Axis - -> IO Float -- ^ returns the postion, ranging from -x.0 to x.0, x depending on Joystick -getJoystickAxisPosition (Joystick j) ax = JST.getAxisPosition j ax - - --- Keyboard functions --- - --- | Check if a specific keyboard key is currently pressed -isKeyPressed :: EnumKey -- ^ the key - -> IO Bool -- ^ True, if pressed -isKeyPressed key = Keyboard.isKeyPressed key - --- Mouse functions --- - --- | Check if a specific mouse button is pressed -isMouseButtonPressed :: EnumMouseButton -- ^ mouse button - -> IO Bool -- ^ True, if pressed -isMouseButtonPressed mb = Mouse.isButtonPressed mb - --- | Queries current mouse position -getMousePosition :: IO (Int, Int) -- ^ absolute mouse position on screen in pixel -getMousePosition = Mouse2.getPosition - +import HGamer3D.InputSystem.Internal.Base diff --git a/InputSystem/HGamer3D/InputSystem/Internal/Base.hs b/InputSystem/HGamer3D/InputSystem/Internal/Base.hs new file mode 100644 index 0000000..0be07b8 --- /dev/null +++ b/InputSystem/HGamer3D/InputSystem/Internal/Base.hs @@ -0,0 +1,180 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- InputSystem/Internal/Base.hs + + +-- | Mouse, Keyboard and Joystick functionality for HGamer3D, internal implementation. This modules also exposes internal data structures. Public API is HGamer3D.InputSystem. + +module HGamer3D.InputSystem.Internal.Base + +( + -- * Types + module HGamer3D.Bindings.SFML.EnumJoystickAxis, + module HGamer3D.Bindings.SFML.EnumKey, + module HGamer3D.Bindings.SFML.EnumMouseButton, + + Joystick (..), + JoystickButton (..), + + -- * Joystick Functions + updateJoystickStatus, + + getConnectedJoysticks, + isJoystickConnected, + + getJoystickAxes, + getJoystickButtons, + + isJoystickButtonPressed, + getJoystickAxisPosition, + + -- * Keyboard Functions + isKeyPressed, + + -- * Mouse Functions + isMouseButtonPressed, + getMousePosition, + + + +) + +where + +import GHC.Ptr + +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Vector + +import HGamer3D.Bindings.SFML.ClassPtr +import HGamer3D.Bindings.SFML.Utils + +import qualified HGamer3D.Bindings.SFML.ClassJoystick as JST + +import qualified HGamer3D.Bindings.SFML.ClassKeyboard as Keyboard + +import qualified HGamer3D.Bindings.SFML.ClassMouse as Mouse +import qualified HGamer3D.Bindings.SFML.ClassMouseHG3D as Mouse2 + +import HGamer3D.Bindings.SFML.EnumJoystickAxis +import HGamer3D.Bindings.SFML.EnumKey +import HGamer3D.Bindings.SFML.EnumMouseButton + +import Control.Monad + +-- | The Joystick +data Joystick = Joystick Int deriving (Eq) +data JoystickButton = JoystickButton Int deriving (Eq) + +instance Show Joystick where + show (Joystick j) = show $ "Joystick-" ++ (show j) + +instance Show JoystickButton where + show (JoystickButton jb) = show $ "JoystickButton-" ++ (show jb) + +instance Show EnumJoystickAxis where + show axis = "JoystickAxis-" ++ (case axis of + JoystickAxisX -> "X" + JoystickAxisY -> "Y" + JoystickAxisZ -> "Z" + JoystickAxisR -> "R" + JoystickAxisU -> "U" + JoystickAxisV -> "V" + JoystickAxisPovX -> "PovX" + JoystickAxisPovY -> "PoxY" + ) + + + +-- Joystick funtions +-- + +-- | This functions gathers the Joystick inputs. It should called frequently, for example during the gameloop, to get new values and new Joystick availability. At least it should be called before querying the Joystick values. +updateJoystickStatus :: IO () +updateJoystickStatus = JST.update + +-- | Get a list of connected Joysticks. +getConnectedJoysticks :: IO [Joystick] -- ^ returns list of connected Joysticks +getConnectedJoysticks = do + let ns = [ x | x <- [0..15]] + jns <- filterM (\jn -> do + c <- JST.isConnected jn + return (c) ) ns + let js = map Joystick jns + return js + +-- | Queries, if a specific Joystick is connected. +isJoystickConnected :: Joystick -- ^ the Joystick to be queried + -> IO Bool -- ^ True: Joystick is connected +isJoystickConnected (Joystick jn) = do + rv <- JST.isConnected jn + return rv + +-- | Queries the available axes of one specific Joystick +getJoystickAxes:: Joystick -- ^ the Joystick to be queried + -> IO [EnumJoystickAxis] -- ^ returns a list of available axes +getJoystickAxes (Joystick j) = do + axes <- filterM ( \a -> do + JST.hasAxis j a) [ JoystickAxisX, JoystickAxisY, JoystickAxisZ, + JoystickAxisR, JoystickAxisU, JoystickAxisV, + JoystickAxisPovX, JoystickAxisPovY ] + return axes + +-- | Queries the available buttons of one specific Joystick +getJoystickButtons :: Joystick -- ^ the Joystick to be queried + -> IO [JoystickButton] -- ^ returns a list of available buttons +getJoystickButtons (Joystick j) = do + jn <- JST.getButtonCount j + let btns = map JoystickButton [0..(jn-1)] + return btns + +-- | Check if a specific Joystick Button is currently pressed +isJoystickButtonPressed :: Joystick -- ^ the Joystick + -> JoystickButton -- ^ the Button + -> IO Bool -- ^ returns True if pressed +isJoystickButtonPressed (Joystick j) (JoystickButton b) = JST.isButtonPressed j b + +-- | Queries the current position of a Joystick Axis +getJoystickAxisPosition :: Joystick -- ^ the Joystick + -> EnumJoystickAxis -- ^ the Axis + -> IO Float -- ^ returns the postion, ranging from -x.0 to x.0, x depending on Joystick +getJoystickAxisPosition (Joystick j) ax = JST.getAxisPosition j ax + + +-- Keyboard functions +-- + +-- | Check if a specific keyboard key is currently pressed +isKeyPressed :: EnumKey -- ^ the key + -> IO Bool -- ^ True, if pressed +isKeyPressed key = Keyboard.isKeyPressed key + +-- Mouse functions +-- + +-- | Check if a specific mouse button is pressed +isMouseButtonPressed :: EnumMouseButton -- ^ mouse button + -> IO Bool -- ^ True, if pressed +isMouseButtonPressed mb = Mouse.isButtonPressed mb + +-- | Queries current mouse position +getMousePosition :: IO (Int, Int) -- ^ absolute mouse position on screen in pixel +getMousePosition = Mouse2.getPosition + + diff --git a/InputSystem/SConstruct b/InputSystem/SConstruct index 52ef589..0ee734c 100644 --- a/InputSystem/SConstruct +++ b/InputSystem/SConstruct @@ -1,5 +1,5 @@ -# SConstruct file to build Haskell packages -# ######################################### +# SConstruct file to build Haskell packages for InputSystem module +# ################################################################ # set environment ################# @@ -14,14 +14,23 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - Glob("HGamer3D/*"), + "HGamer3D/InputSystem.hs", + Glob("HGamer3D/InputSystem/Internal/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), + Glob("../Bindings/SFML/hBuild/dist/HGamer3D-*.tar.gz"), + ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", + "cabal configure --user", "cabal build", "cabal haddock", diff --git a/Main/HGamer3D.cabal b/Main/HGamer3D.cabal index daf69cb..a38c02c 100644 --- a/Main/HGamer3D.cabal +++ b/Main/HGamer3D.cabal @@ -1,5 +1,5 @@ Name: HGamer3D -Version: 0.3.3 +Version: 0.4.0 Synopsis: A Game Engine for the Haskell Programmer Description: HGamer3D is a game engine for developing 3D games in the programming @@ -7,7 +7,6 @@ Description: sound, input device handling, gui programming and other areas and make those functions available for the Haskell programmer by providing a Haskell API on top of that. HGamer3D is available on Windows and Linux. - This package includes 3D Graphics, GUI and WinEvent. License: OtherLicense License-file: LICENSE @@ -19,10 +18,26 @@ Homepage: http://www.hgamer3d.org Category: Game Engine Extra-source-files: Setup.hs +Flag Audio + Description: Enable Audio + Default: True + +Flag Network + Description: Enable Network + Default: True + +Flag InputSystem + Description: Enable Joystick, Mouse, Keyboard Polling + Default: True + +Flag Extensions + Description: API extensions + Default: True + Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.3.0 && < 0.4.0, HGamer3D-Graphics3D >= 0.3.0 && < 0.4.0, HGamer3D-WinEvent >= 0.3.0 && < 0.4.0, HGamer3D-GUI >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D + Exposed-modules: HGamer3D.Internal.GameLoop, HGamer3D.BaseAPI Other-modules: c-sources: @@ -33,3 +48,19 @@ Library Include-dirs: . build-depends: extra-libraries: + + if flag(audio) + build-depends: HGamer3D-Audio >= 0.4 && < 0.5 + exposed-modules: HGamer3D.Modules.Audio + + if flag(network) + build-depends: HGamer3D-Network >= 0.4 && < 0.5 + exposed-modules: HGamer3D.Modules.Network + + if flag(inputsystem) + build-depends: HGamer3D-InputSystem >= 0.4 && < 0.5 + exposed-modules: HGamer3D.Modules.InputSystem + + if flag(extensions) + build-depends: HGamer3D-Wire >= 0.4.0 && < 0.5.0, HGamer3D-Schema >= 0.4.0 && < 0.5.0 + exposed-modules: HGamer3D.Extensions.Schema, HGamer3D.Extensions.Wire \ No newline at end of file diff --git a/Main/HGamer3D/BaseAPI.hs b/Main/HGamer3D/BaseAPI.hs new file mode 100644 index 0000000..4b64277 --- /dev/null +++ b/Main/HGamer3D/BaseAPI.hs @@ -0,0 +1,48 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D BaseAPI Module +-- + +-- | HGamer3D - A game engine for the Haskell Programmer, this module includes the common modules for the basic API. +module HGamer3D.BaseAPI + +( + module HGamer3D.Data, + module HGamer3D.Util, + + module HGamer3D.Graphics3D, + module HGamer3D.WinEvent, + module HGamer3D.GUI, + + HG3DEvent (..), + + initHGamer3D, + freeHGamer3D, + stepHGamer3D, + + ) where + + import HGamer3D.Data + import HGamer3D.Util + + import HGamer3D.Graphics3D + import HGamer3D.WinEvent + import HGamer3D.GUI + + import HGamer3D.Internal.GameLoop diff --git a/Main/HGamer3D/Extensions/Schema.hs b/Main/HGamer3D/Extensions/Schema.hs new file mode 100644 index 0000000..8be8d41 --- /dev/null +++ b/Main/HGamer3D/Extensions/Schema.hs @@ -0,0 +1,28 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D Extensions/Schema Module +-- + +module HGamer3D.Extensions.Schema + +( + module HGamer3D.Schema +) where + + import HGamer3D.Schema diff --git a/Main/HGamer3D/Extensions/Wire.hs b/Main/HGamer3D/Extensions/Wire.hs new file mode 100644 index 0000000..51c3b09 --- /dev/null +++ b/Main/HGamer3D/Extensions/Wire.hs @@ -0,0 +1,28 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D Extensions/Wire Module +-- + +module HGamer3D.Extensions.Wire + +( + module HGamer3D.Wire +) where + + import HGamer3D.Wire diff --git a/Main/HGamer3D.hs b/Main/HGamer3D/Internal/GameLoop.hs similarity index 72% rename from Main/HGamer3D.hs rename to Main/HGamer3D/Internal/GameLoop.hs index 56222eb..d192ddc 100644 --- a/Main/HGamer3D.hs +++ b/Main/HGamer3D/Internal/GameLoop.hs @@ -16,42 +16,47 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- HGamer3D Main Module +-- HGamer3D/Internal/GameLoop Module -- --- | HGamer3D - A game engine for the Haskell Programmer -module HGamer3D +-- | HGamer3D - A game engine for the Haskell Programmer, this module includes the implementation of the gameloop and initialization routines. This is an internal module, the public API is in HGamer3D.BaseAPI. +module HGamer3D.Internal.GameLoop ( HG3DEvent (..), - module HGamer3D.Graphics3D, - module HGamer3D.WinEvent, - module HGamer3D.GUI, - - loopHGamer3D, initHGamer3D, - exitHGamer3D + freeHGamer3D, + stepHGamer3D, ) where - import HGamer3D.Graphics3D hiding (initHGamer3D, loopHGamer3D, exitHGamer3D) - import HGamer3D.WinEvent hiding (initHGamer3D, loopHGamer3D, exitHGamer3D) + import HGamer3D.Data + import HGamer3D.Util + + import HGamer3D.Graphics3D + import HGamer3D.WinEvent import HGamer3D.GUI + + -- need a couple of internal functions from base modules, to implement game loop + import HGamer3D.Graphics3D.Internal.Base (renderOneFrame, graphics3DPumpWindowMessages, checkQuitReceived) + import HGamer3D.GUI.Internal.Base (pollGUIEvents, initGUI, injectWinEventToGUI) + import HGamer3D.WinEvent.Internal.Base (attachToWindow) + import qualified System.Info as SI data HG3DEvent = EventWindow SDLEvent | EventGUI [GUIEvent] - exitHGamer3D :: Graphics3DSystem -> GUISystem -> IO () - exitHGamer3D g3ds guis = do - exitGraphics3D g3ds + freeHGamer3D :: Graphics3DSystem -> GUISystem -> IO () + freeHGamer3D g3ds guis = do + freeGraphics3D g3ds -- the game loops works in a way, that window events are much faster processed then -- update of rendering -> all events needs to be cleared, then next renderOneFrame is processed - loopHGamer3D :: Graphics3DSystem -> GUISystem -> IO (Maybe HG3DEvent, Bool) - loopHGamer3D g3ds guis = do + stepHGamer3D :: Graphics3DSystem -> GUISystem -> IO (Maybe HG3DEvent, Bool) + stepHGamer3D g3ds guis = do -- this one is quite tricky, on Linux we need to call the message loop in addition to WinEvent! if SI.os /= "mingw32" then graphics3DPumpWindowMessages else return () diff --git a/Main/HGamer3D/Modules/Audio.hs b/Main/HGamer3D/Modules/Audio.hs new file mode 100644 index 0000000..fff9985 --- /dev/null +++ b/Main/HGamer3D/Modules/Audio.hs @@ -0,0 +1,28 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D Modules/Audio Module +-- + +module HGamer3D.Modules.Audio + +( + module HGamer3D.Audio +) where + + import HGamer3D.Audio diff --git a/Main/HGamer3D/Modules/InputSystem.hs b/Main/HGamer3D/Modules/InputSystem.hs new file mode 100644 index 0000000..89d6f68 --- /dev/null +++ b/Main/HGamer3D/Modules/InputSystem.hs @@ -0,0 +1,28 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D Modules/InputSystem Module +-- + +module HGamer3D.Modules.InputSystem + +( + module HGamer3D.InputSystem +) where + + import HGamer3D.InputSystem diff --git a/Main/HGamer3D/Modules/Network.hs b/Main/HGamer3D/Modules/Network.hs new file mode 100644 index 0000000..f51b42d --- /dev/null +++ b/Main/HGamer3D/Modules/Network.hs @@ -0,0 +1,28 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D Modules/Network Module +-- + +module HGamer3D.Modules.Network + +( + module HGamer3D.Network +) where + + import HGamer3D.Network diff --git a/Main/SConstruct b/Main/SConstruct index f7d65b0..87020aa 100644 --- a/Main/SConstruct +++ b/Main/SConstruct @@ -1,5 +1,5 @@ -# SConstruct file to build Haskell packages -# ######################################### +# SConstruct file to build Haskell packages for Main Module +# ######################################################### # set environment ################# @@ -14,9 +14,22 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - "HGamer3D.hs", + "HGamer3D/BaseAPI.hs", + Glob("HGamer3D/Modules/*"), + Glob("HGamer3D/Extensions/*"), + Glob("HGamer3D/Internal/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), + Glob("../GUI/dist/HGamer3D-*.tar.gz"), + Glob("../WinEvent/dist/HGamer3D-*.tar.gz"), + Glob("../Graphics3D/dist/HGamer3D-*.tar.gz"), + Glob("../Audio/dist/HGamer3D-*.tar.gz"), + Glob("../Network/dist/HGamer3D-*.tar.gz"), + Glob("../InputSystem/dist/HGamer3D-*.tar.gz"), + Glob("../Schema/dist/HGamer3D-*.tar.gz"), + Glob("../Wire/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] diff --git a/Network/HGamer3D-Network.cabal b/Network/HGamer3D-Network.cabal index d9e9afa..7da1730 100644 --- a/Network/HGamer3D-Network.cabal +++ b/Network/HGamer3D-Network.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-Network -Version: 0.3.0 +Version: 0.4.0 Synopsis: Networking Functionality for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,9 +18,9 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.3.0 && < 0.4.0, HGamer3D-Enet-Binding >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Enet-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Network + Exposed-modules: HGamer3D.Network.Internal.Base, HGamer3D.Network Other-modules: c-sources: diff --git a/Network/HGamer3D/Network.hs b/Network/HGamer3D/Network.hs index 2bc3933..86bb807 100644 --- a/Network/HGamer3D/Network.hs +++ b/Network/HGamer3D/Network.hs @@ -18,7 +18,7 @@ -- Network.hs --- | Network functionality for HGamer3D +-- | Network functionality for HGamer3D, public API. module HGamer3D.Network ( @@ -27,158 +27,23 @@ module HGamer3D.Network -- $Overview -- * Types - NetworkClient (..), - NetworkServer (..), + NetworkSystem, + NetworkClient, + NetworkServer, NetworkPacket (..), NetworkNode (..), -- * Library initialization initNetwork, - deinitNetwork, + freeNetwork, -- * Connection Handling - createNetworkClient, - createNetworkServer, + networkClient, + networkServer, connectClientToServer, disconnectClient ) where -import GHC.Ptr - -import HGamer3D.Data.HG3DClass -import HGamer3D.Data.TimeMS - -import HGamer3D.Bindings.Enet.ClassEnet as EnetClass -import HGamer3D.Bindings.Enet.ClassEnetServer as EnetServer -import HGamer3D.Bindings.Enet.ClassEnetClient as EnetClient -import HGamer3D.Bindings.Enet.ClassEnetPacket as EnetPacket - --- | The network client -data NetworkClient = NetworkClient HG3DClass - --- | The network server -data NetworkServer = NetworkServer HG3DClass - --- | A network packet -data NetworkPacket = NetworkPacket { - clientname :: String, -- ^ the name of the client, sending the message, can be used, to reply - channel :: Int, -- ^ the channel on which the message has been sent - message :: String -- ^ the actual message itself - } - - -initNetwork = EnetClass.new -deinitNetwork = EnetClass.delete - --- | creates a network client, a client can connect to servers, but not vice versa -createNetworkClient :: IO NetworkClient -createNetworkClient = do - client <- EnetClass.createClient - return (NetworkClient client) - --- | creates a network server, a server can accept connections from clients -createNetworkServer :: Int -- ^ the port on which the server listen for connections - -> IO NetworkServer -createNetworkServer port = do - server <- EnetClass.createServer port - return (NetworkServer server) - --- | create a connection from a client to a server -connectClientToServer :: NetworkClient -- ^ the client, created by createNetworkClient - -> String -- ^ the server address (regular IP addresses or NS names) - -> Int -- ^ the port of the server to connect to - -> IO Bool -connectClientToServer (NetworkClient client) serveraddress port = do - ok <- EnetClient.connect client serveraddress port - return ok - --- | disconnect a client from a server -disconnectClient :: NetworkClient -- ^ the client - -> IO Bool -disconnectClient (NetworkClient client) = do - ok <- EnetClient.disconnect client - return ok - --- | The network node. This TypeClass contain the methods for sending and receiving data. -class NetworkNode a where - -- | the method to send a message - sendNetworkMessage :: a -- ^ the node itself - -> String -- ^ the clientname (only used, when a server send to one of his clients). Can be obtained from the first message send by the client, see above in the 'NetworkPacket' type. - -> Int -- ^ the channel on which to send the message - -> String -- ^ the message - -> IO () - - -- | receive pending messages - receiveNetworkMessages :: a -- ^ the node itself - -> TimeMS -- ^ the time in ms, which the node waits for incoming messages. If zero only delivers pending messages. - -> IO [NetworkPacket] -- ^ array of received network packages - - -_transformPackage :: HG3DClass -> IO NetworkPacket -_transformPackage p = do - message <- EnetPacket.getData p - channel <- EnetPacket.getChannel p - clientname <- EnetPacket.getPeer p - EnetPacket.delete p - return $ NetworkPacket clientname channel message - -_receiveClient client ms pkg = do - EnetClient.serve client ms - p <- EnetClient.getPacket client - let (HG3DClass aptr bptr) = p - if aptr /= nullPtr - then do - p' <- _transformPackage p - pkg' <- _receiveClient client ms (pkg ++ [p']) - return pkg' - else do - return pkg - -_receiveServer server ms pkg = do - EnetServer.serve server ms - p <- EnetServer.getPacket server - let (HG3DClass aptr bptr) = p - if aptr /= nullPtr - then do - p' <- _transformPackage p - pkg' <- _receiveServer server ms (pkg ++ [p']) - return pkg' - else do - return pkg - -instance NetworkNode NetworkClient where - - sendNetworkMessage (NetworkClient client) clientname channel message = do - EnetClient.send client message channel - return () - - receiveNetworkMessages (NetworkClient client) (TimeMS ms) = do - allPs <- _receiveClient client ms [] - return allPs - -instance NetworkNode NetworkServer where - - sendNetworkMessage (NetworkServer server) clientname channel message = do - EnetServer.send server clientname message channel - return () - - receiveNetworkMessages (NetworkServer server) (TimeMS ms) = do - allPs <- _receiveServer server ms [] - return allPs - - - - -{-$Overview - -The commuication model of this library is as follows. There are clients and servers. Clients can connect to servers but not the other way around. So each server can have multiple clients. Both are nodes. Nodes can send and receive messages. - -Upon connection the port is defined on which servers and clients communicate with each other. - -In addition to the port, channels exists, to enable parallel streams of messages on different channels. - -A client has a name, to identify him. This name is communicated in the first packet from the client to the server. The server needs the client name, to send a package to the specific client. The client does not need a name for the server, since there exists only one connection from the client to one server. - --} \ No newline at end of file +import HGamer3D.Network.Internal.Base diff --git a/Network/HGamer3D/Network/Internal/Base.hs b/Network/HGamer3D/Network/Internal/Base.hs new file mode 100644 index 0000000..680621e --- /dev/null +++ b/Network/HGamer3D/Network/Internal/Base.hs @@ -0,0 +1,191 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Network/Internal/Base.hs + +-- | Network functionality for HGamer3D, internal implementation, which exports also internal data structures. Public API is in module HGamer3D.Network. +module HGamer3D.Network.Internal.Base + +( + + -- * Overview + -- $Overview + + -- * Types + NetworkSystem (..), + NetworkClient (..), + NetworkServer (..), + NetworkPacket (..), + NetworkNode (..), + + -- * Library initialization + initNetwork, + freeNetwork, + + -- * Connection Handling + networkClient, + networkServer, + connectClientToServer, + disconnectClient +) + +where + +import GHC.Ptr + +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.TimeMS + +import HGamer3D.Bindings.Enet.ClassEnet as EnetClass +import HGamer3D.Bindings.Enet.ClassEnetServer as EnetServer +import HGamer3D.Bindings.Enet.ClassEnetClient as EnetClient +import HGamer3D.Bindings.Enet.ClassEnetPacket as EnetPacket + +-- | The network system +data NetworkSystem = NetworkSystem HG3DClass + +-- | The network client +data NetworkClient = NetworkClient HG3DClass + +-- | The network server +data NetworkServer = NetworkServer HG3DClass + +-- | A network packet +data NetworkPacket = NetworkPacket { + clientname :: String, -- ^ the name of the client, sending the message, can be used, to reply + channel :: Int, -- ^ the channel on which the message has been sent + message :: String -- ^ the actual message itself + } + + +initNetwork = do + hg3dclass <- EnetClass.new + return (NetworkSystem hg3dclass) + +freeNetwork (NetworkSystem hg3dclass) = EnetClass.delete hg3dclass + +-- | creates a network client, a client can connect to servers, but not vice versa +networkClient :: IO NetworkClient +networkClient = do + client <- EnetClass.createClient + return (NetworkClient client) + +-- | creates a network server, a server can accept connections from clients +networkServer :: Int -- ^ the port on which the server listen for connections + -> IO NetworkServer +networkServer port = do + server <- EnetClass.createServer port + return (NetworkServer server) + +-- | create a connection from a client to a server +connectClientToServer :: NetworkClient -- ^ the client, created by createNetworkClient + -> String -- ^ the server address (regular IP addresses or NS names) + -> Int -- ^ the port of the server to connect to + -> IO Bool +connectClientToServer (NetworkClient client) serveraddress port = do + ok <- EnetClient.connect client serveraddress port + return ok + +-- | disconnect a client from a server +disconnectClient :: NetworkClient -- ^ the client + -> IO Bool +disconnectClient (NetworkClient client) = do + ok <- EnetClient.disconnect client + return ok + +-- | The network node. This TypeClass contain the methods for sending and receiving data. +class NetworkNode a where + -- | the method to send a message + sendNetworkMessage :: a -- ^ the node itself + -> String -- ^ the clientname (only used, when a server send to one of his clients). Can be obtained from the first message send by the client, see above in the 'NetworkPacket' type. + -> Int -- ^ the channel on which to send the message + -> String -- ^ the message + -> IO () + + -- | receive pending messages + receiveNetworkMessages :: a -- ^ the node itself + -> TimeMS -- ^ the time in ms, which the node waits for incoming messages. If zero only delivers pending messages. + -> IO [NetworkPacket] -- ^ array of received network packages + + +_transformPackage :: HG3DClass -> IO NetworkPacket +_transformPackage p = do + message <- EnetPacket.getData p + channel <- EnetPacket.getChannel p + clientname <- EnetPacket.getPeer p + EnetPacket.delete p + return $ NetworkPacket clientname channel message + +_receiveClient client ms pkg = do + EnetClient.serve client ms + p <- EnetClient.getPacket client + let (HG3DClass aptr bptr) = p + if aptr /= nullPtr + then do + p' <- _transformPackage p + pkg' <- _receiveClient client ms (pkg ++ [p']) + return pkg' + else do + return pkg + +_receiveServer server ms pkg = do + EnetServer.serve server ms + p <- EnetServer.getPacket server + let (HG3DClass aptr bptr) = p + if aptr /= nullPtr + then do + p' <- _transformPackage p + pkg' <- _receiveServer server ms (pkg ++ [p']) + return pkg' + else do + return pkg + +instance NetworkNode NetworkClient where + + sendNetworkMessage (NetworkClient client) clientname channel message = do + EnetClient.send client message channel + return () + + receiveNetworkMessages (NetworkClient client) (TimeMS ms) = do + allPs <- _receiveClient client ms [] + return allPs + +instance NetworkNode NetworkServer where + + sendNetworkMessage (NetworkServer server) clientname channel message = do + EnetServer.send server clientname message channel + return () + + receiveNetworkMessages (NetworkServer server) (TimeMS ms) = do + allPs <- _receiveServer server ms [] + return allPs + + + + +{-$Overview + +The commuication model of this library is as follows. There are clients and servers. Clients can connect to servers but not the other way around. So each server can have multiple clients. Both are nodes. Nodes can send and receive messages. + +Upon connection the port is defined on which servers and clients communicate with each other. + +In addition to the port, channels exists, to enable parallel streams of messages on different channels. + +A client has a name, to identify him. This name is communicated in the first packet from the client to the server. The server needs the client name, to send a package to the specific client. The client does not need a name for the server, since there exists only one connection from the client to one server. + +-} diff --git a/Network/SConstruct b/Network/SConstruct index 52ef589..bf040e4 100644 --- a/Network/SConstruct +++ b/Network/SConstruct @@ -1,5 +1,5 @@ -# SConstruct file to build Haskell packages -# ######################################### +# SConstruct file to build Haskell packages for Network module +# ############################################################ # set environment ################# @@ -14,14 +14,24 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - Glob("HGamer3D/*"), + "HGamer3D/Network.hs", + Glob("HGamer3D/Network/Internal/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), + Glob("../Bindings/Enet/hBuild/dist/HGamer3D-*.tar.gz"), + + ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", + "cabal configure --user", "cabal build", "cabal haddock", diff --git a/README.md b/README.md index 1348ddb..14582ef 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,6 @@ Documentation is on: http://www.hgamer3d.org News ---- +- HGamer3D now works on 64 bit Linux - Fixes of various build problems, April 2014, see new install instructions on http://www.hgamer3d.org/Install.html - Version 0.3.x published on master, changes keep 0.3.x compatibility diff --git a/Scheme/HGamer3D-Scheme.cabal b/Schema/HGamer3D-Schema.cabal similarity index 64% rename from Scheme/HGamer3D-Scheme.cabal rename to Schema/HGamer3D-Schema.cabal index 5ce570d..4dcf75c 100644 --- a/Scheme/HGamer3D-Scheme.cabal +++ b/Schema/HGamer3D-Schema.cabal @@ -1,10 +1,11 @@ -Name: HGamer3D-Scheme +Name: HGamer3D-Schema Version: 0.4.0 Synopsis: Game Engine for the Haskell Programmer - Data Scheme Definitions Description: HGamer3D is a game engine for developing 3D games in the programming - language Haskell. HGamer3D is available on Windows and Linux. This - package provides functional data schemes for HGamer3D. + language Haskell. HGamer3D is available on Windows and Linux. + + This module provides functional data structures for all aspects of the framework, being really a "schema" for HGamer3D. License: OtherLicense License-file: LICENSE @@ -19,7 +20,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, containers, mtl, template-haskell, indents, parsec, lens, HGamer3D-Data >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Scheme.Scene, HGamer3D.Scheme.Geometry, HGamer3D.Scheme.Material, HGamer3D.Scheme.Colour, HGamer3D.Scheme.Texture, HGamer3D.Scheme.Node, HGamer3D.Scheme.Camera, HGamer3D.Scheme.Light, HGamer3D.Scheme.Parser + Exposed-modules: HGamer3D.Schema.Scene, HGamer3D.Schema.Geometry, HGamer3D.Schema.Material, HGamer3D.Schema.Colour, HGamer3D.Schema.Texture, HGamer3D.Schema.Node, HGamer3D.Schema.Camera, HGamer3D.Schema.Light, HGamer3D.Schema.Parser Other-modules: diff --git a/Scheme/HGamer3D/Scheme/Camera.hs b/Schema/HGamer3D/Schema/Camera.hs similarity index 97% rename from Scheme/HGamer3D/Scheme/Camera.hs rename to Schema/HGamer3D/Schema/Camera.hs index bfe126a..65aca15 100644 --- a/Scheme/HGamer3D/Scheme/Camera.hs +++ b/Schema/HGamer3D/Schema/Camera.hs @@ -21,7 +21,7 @@ -- Camera.hs -- | Types which describe the Scene, the high level of a Scene Tree -module HGamer3D.Scheme.Camera +module HGamer3D.Schema.Camera where diff --git a/Scheme/HGamer3D/Scheme/Colour.hs b/Schema/HGamer3D/Schema/Colour.hs similarity index 97% rename from Scheme/HGamer3D/Scheme/Colour.hs rename to Schema/HGamer3D/Schema/Colour.hs index 9dec1da..84b5761 100644 --- a/Scheme/HGamer3D/Scheme/Colour.hs +++ b/Schema/HGamer3D/Schema/Colour.hs @@ -21,7 +21,7 @@ -- Colour.hs -- | Types which describe Colourss, Colour is defined in HGamer3D.Data but we need the ColourSlot -module HGamer3D.Scheme.Colour +module HGamer3D.Schema.Colour where diff --git a/Scheme/HGamer3D/Scheme/Geometry.hs b/Schema/HGamer3D/Schema/Geometry.hs similarity index 98% rename from Scheme/HGamer3D/Scheme/Geometry.hs rename to Schema/HGamer3D/Schema/Geometry.hs index bdfeb6f..51afd78 100644 --- a/Scheme/HGamer3D/Scheme/Geometry.hs +++ b/Schema/HGamer3D/Schema/Geometry.hs @@ -21,7 +21,7 @@ -- Scene.hs -- | Types which describe the Geometry -module HGamer3D.Scheme.Geometry +module HGamer3D.Schema.Geometry where diff --git a/Scheme/HGamer3D/Scheme/Light.hs b/Schema/HGamer3D/Schema/Light.hs similarity index 97% rename from Scheme/HGamer3D/Scheme/Light.hs rename to Schema/HGamer3D/Schema/Light.hs index 7a7843c..6e783d2 100644 --- a/Scheme/HGamer3D/Scheme/Light.hs +++ b/Schema/HGamer3D/Schema/Light.hs @@ -21,7 +21,7 @@ -- Scene.hs -- | Types which describe the Scene, the high level of a Scene Tree -module HGamer3D.Scheme.Light +module HGamer3D.Schema.Light where diff --git a/Scheme/HGamer3D/Scheme/Material.hs b/Schema/HGamer3D/Schema/Material.hs similarity index 97% rename from Scheme/HGamer3D/Scheme/Material.hs rename to Schema/HGamer3D/Schema/Material.hs index 41a7f1f..95e220c 100644 --- a/Scheme/HGamer3D/Scheme/Material.hs +++ b/Schema/HGamer3D/Schema/Material.hs @@ -21,7 +21,7 @@ -- Material.hs -- | Types which describe Materials -module HGamer3D.Scheme.Material +module HGamer3D.Schema.Material where diff --git a/Scheme/HGamer3D/Scheme/Node.hs b/Schema/HGamer3D/Schema/Node.hs similarity index 86% rename from Scheme/HGamer3D/Scheme/Node.hs rename to Schema/HGamer3D/Schema/Node.hs index 22d96a3..5f0d24e 100644 --- a/Scheme/HGamer3D/Scheme/Node.hs +++ b/Schema/HGamer3D/Schema/Node.hs @@ -21,7 +21,7 @@ -- Node.hs -- | Types which describe Materials -module HGamer3D.Scheme.Node +module HGamer3D.Schema.Node where @@ -30,13 +30,13 @@ import HGamer3D.Data.Vector.Instances import qualified Data.Map as Map import Control.Lens -import qualified HGamer3D.Scheme.Material as Mat -import qualified HGamer3D.Scheme.Texture as Tex -import qualified HGamer3D.Scheme.Colour as Col -import qualified HGamer3D.Scheme.Light as Li -import qualified HGamer3D.Scheme.Camera as Cam -import qualified HGamer3D.Scheme.Scene as Sc -import qualified HGamer3D.Scheme.Geometry as Geo +import qualified HGamer3D.Schema.Material as Mat +import qualified HGamer3D.Schema.Texture as Tex +import qualified HGamer3D.Schema.Colour as Col +import qualified HGamer3D.Schema.Light as Li +import qualified HGamer3D.Schema.Camera as Cam +import qualified HGamer3D.Schema.Scene as Sc +import qualified HGamer3D.Schema.Geometry as Geo deriving instance Eq Dat.UnitQuaternion diff --git a/Scheme/HGamer3D/Scheme/Parser.hs b/Schema/HGamer3D/Schema/Parser.hs similarity index 96% rename from Scheme/HGamer3D/Scheme/Parser.hs rename to Schema/HGamer3D/Schema/Parser.hs index 3226d90..05cde18 100644 --- a/Scheme/HGamer3D/Scheme/Parser.hs +++ b/Schema/HGamer3D/Schema/Parser.hs @@ -19,7 +19,7 @@ -- Parser.hs -- | The Parser to implement a DSL for describing the Scene inclusive all nodes in text -module HGamer3D.Scheme.Parser ( +module HGamer3D.Schema.Parser ( parseScene ) @@ -28,14 +28,14 @@ where import qualified HGamer3D.Data as Dat import qualified Data.Map as Map -import qualified HGamer3D.Scheme.Material as Mat -import qualified HGamer3D.Scheme.Texture as Tex -import qualified HGamer3D.Scheme.Colour as Col -import qualified HGamer3D.Scheme.Light as Li -import qualified HGamer3D.Scheme.Camera as Cam -import qualified HGamer3D.Scheme.Scene as Sc -import qualified HGamer3D.Scheme.Geometry as Geo -import qualified HGamer3D.Scheme.Node as No +import qualified HGamer3D.Schema.Material as Mat +import qualified HGamer3D.Schema.Texture as Tex +import qualified HGamer3D.Schema.Colour as Col +import qualified HGamer3D.Schema.Light as Li +import qualified HGamer3D.Schema.Camera as Cam +import qualified HGamer3D.Schema.Scene as Sc +import qualified HGamer3D.Schema.Geometry as Geo +import qualified HGamer3D.Schema.Node as No import Text.Parsec hiding (State) diff --git a/Scheme/HGamer3D/Scheme/Scene.hs b/Schema/HGamer3D/Schema/Scene.hs similarity index 98% rename from Scheme/HGamer3D/Scheme/Scene.hs rename to Schema/HGamer3D/Schema/Scene.hs index 6e92c20..d938844 100644 --- a/Scheme/HGamer3D/Scheme/Scene.hs +++ b/Schema/HGamer3D/Schema/Scene.hs @@ -21,7 +21,7 @@ -- Scene.hs -- | Types which describe the Scene, the high level of a Scene Tree -module HGamer3D.Scheme.Scene +module HGamer3D.Schema.Scene where diff --git a/Scheme/HGamer3D/Scheme/Texture.hs b/Schema/HGamer3D/Schema/Texture.hs similarity index 97% rename from Scheme/HGamer3D/Scheme/Texture.hs rename to Schema/HGamer3D/Schema/Texture.hs index 9e49cee..d79b55f 100644 --- a/Scheme/HGamer3D/Scheme/Texture.hs +++ b/Schema/HGamer3D/Schema/Texture.hs @@ -21,7 +21,7 @@ -- Texture.hs -- | Types which describe Textures -module HGamer3D.Scheme.Texture +module HGamer3D.Schema.Texture where diff --git a/Scheme/LICENSE b/Schema/LICENSE similarity index 100% rename from Scheme/LICENSE rename to Schema/LICENSE diff --git a/Scheme/SConstruct b/Schema/SConstruct similarity index 69% rename from Scheme/SConstruct rename to Schema/SConstruct index ce505f3..e839647 100644 --- a/Scheme/SConstruct +++ b/Schema/SConstruct @@ -1,5 +1,5 @@ -# SConstruct file to build Haskell packages -# ######################################### +# SConstruct file to build Haskell packages for Schema Module +# ########################################################### # set environment ################# @@ -17,12 +17,18 @@ dependsOn = [ Glob("HGamer3D/*"), Glob("HGamer3D/Scheme/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", + "cabal configure --user", "cabal build", "cabal haddock", diff --git a/Scheme/Setup.hs b/Schema/Setup.hs similarity index 100% rename from Scheme/Setup.hs rename to Schema/Setup.hs diff --git a/WinEvent/HGamer3D-WinEvent.cabal b/WinEvent/HGamer3D-WinEvent.cabal index 1e75855..9287ce3 100644 --- a/WinEvent/HGamer3D-WinEvent.cabal +++ b/WinEvent/HGamer3D-WinEvent.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-WinEvent -Version: 0.3.0 +Version: 0.4.0 Synopsis: Windowing and Event Functionality for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,9 +18,9 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, text, HGamer3D-Data >= 0.3.0 && < 0.4.0, HGamer3D-SDL2-Binding >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, text, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-SDL2-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.WinEvent + Exposed-modules: HGamer3D.WinEvent.Internal.Base, HGamer3D.WinEvent Other-modules: c-sources: diff --git a/WinEvent/HGamer3D/WinEvent.hs b/WinEvent/HGamer3D/WinEvent.hs index 14a9af5..fdf040c 100644 --- a/WinEvent/HGamer3D/WinEvent.hs +++ b/WinEvent/HGamer3D/WinEvent.hs @@ -16,20 +16,15 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Events.hs +-- WinEvents.hs --- | Windowing and Event functionality for HGamer3D +-- | Windowing and Event functionality for HGamer3D, public API. This module abstracts the functionality needed to create a window and to handle events from this window over different platforms. This module currently is not useful standalone, but is used in HGamer3D (main module) to construct initialization and game loop functionality. module HGamer3D.WinEvent ( + -- * Basic Data Types and Enums EnumWinEventInit (..), - SDLWindow, - initWinEvent, - attachToWindow, - openWindow, - pollWinEvent, - quitWinEvent, - showCursor, + SDLSystem, module HGamer3D.Bindings.SDL2.StructSDLEvent, module HGamer3D.Bindings.SDL2.EnumSDLEventType, module HGamer3D.Bindings.SDL2.EnumSDLKeymod, @@ -37,96 +32,22 @@ module HGamer3D.WinEvent module HGamer3D.Bindings.SDL2.EnumSDLWindowEventID, module HGamer3D.Bindings.SDL2.EnumSDLWindowFlags, - initHGamer3D, - exitHGamer3D, - loopHGamer3D + -- * Initialization and Game Loop Functions + initWinEvent, + freeWinEvent, + pollWinEvent, + + -- * Misc Functions + openWindow, ) where -import GHC.Ptr -import HGamer3D.Data - -import HGamer3D.Bindings.SDL2.ClassPtr -import HGamer3D.Bindings.SDL2.Utils - +import HGamer3D.WinEvent.Internal.Base import HGamer3D.Bindings.SDL2.EnumSDLEventType import HGamer3D.Bindings.SDL2.EnumSDLKeymod import HGamer3D.Bindings.SDL2.EnumSDLScancode import HGamer3D.Bindings.SDL2.EnumSDLWindowEventID import HGamer3D.Bindings.SDL2.EnumSDLWindowFlags - import HGamer3D.Bindings.SDL2.StructSDLEvent - -import HGamer3D.Bindings.SDL2.HeaderSDL -import HGamer3D.Bindings.SDL2.HeaderSDLVideo -import HGamer3D.Bindings.SDL2.HeaderSDLEvents -import HGamer3D.Bindings.SDL2.EnumSDLWindowFlags -import HGamer3D.Bindings.SDL2.HeaderSDLMouse -import HGamer3D.Bindings.SDL2.ClassHG3DUtilities - -import Foreign.Marshal.Utils -import Control.Monad -import Control.Applicative - --- Enum Definitions for initializing -data EnumWinEventInit = WEV_INIT_VIDEO | WEV_INIT_TIMER | WEV_INIT_EVENTS -instance Enum EnumWinEventInit where - toEnum 0x20 = WEV_INIT_VIDEO - toEnum 0x4000 = WEV_INIT_EVENTS - toEnum 0x01 = WEV_INIT_TIMER - - fromEnum WEV_INIT_VIDEO = 0x20 - fromEnum WEV_INIT_EVENTS = 0x4000 - fromEnum WEV_INIT_TIMER = 0x01 - --- show instance for SDLEvent -instance Show SDLEvent where - show (EvtQuit ts) = "Event-Quit" - show (EvtKeyUp ts window keyscan keycode keymode) = "Event-KeyUp " ++ (show (fromEnum keyscan)) - show (EvtKeyDown ts window keyscan keycode keymode) = "Event-KeyDown " ++ (show (fromEnum keyscan)) - show (EvtText ts window text) = "Event-Text " ++ text - show (EvtMouseButtonUp ts window mid button x y) = "Event-MouseButtonUp " ++ (show button) ++ " " ++ (show x) ++ " " ++ (show y) - show (EvtMouseButtonDown ts window mid button x y) = "Event-MouseButtonDown " ++ (show button) ++ " " ++ (show x) ++ " " ++ (show y) - show (EvtMouseMotion ts window mid x y rx ry) = "Event-MouseMotion " ++ (show x) ++ " " ++ (show y) ++ " r: " ++ (show rx) ++ " " ++ (show ry) - show (EvtWindow ts window weid x y) = "Event-Window " ++ (show (fromEnum weid)) ++ " " ++ (show x) ++ " " ++ (show y) - show _ = "Specific Event is not in show instance" - - -initWinEvent :: [EnumWinEventInit] -> IO Int -initWinEvent flags = do - res <- sdlInit $ sum (fmap fromEnum flags) - return res - - -attachToWindow :: Window -> IO (Ptr SDLWindow) -attachToWindow (Window handle) = do - res <- createWindowFromHandle handle - return $ res - -openWindow :: String -> Int -> Int -> Int -> Int -> [EnumSDLWindowFlags] -> IO (Ptr SDLWindow) -openWindow title x y w h flags = do - win <- sdlCreateWindow title x y w h (sum $ fmap fromEnum flags) - return win - -pollWinEvent :: IO (Maybe SDLEvent) -pollWinEvent = do - (sdlevt, res) <- sdlPollEvent - let r = case res of - 0 -> Nothing - 1 -> Just sdlevt - _ -> Nothing - return r - -quitWinEvent :: IO () -quitWinEvent = sdlQuit - -showCursor :: Bool -> IO Bool -showCursor flag = do - ival <- sdlShowCursor (fromBool flag) - return (toBool ival) - -initHGamer3D = initWinEvent -exitHGamer3D = quitWinEvent -loopHGamer3D = pollWinEvent diff --git a/WinEvent/HGamer3D/WinEvent/Internal/Base.hs b/WinEvent/HGamer3D/WinEvent/Internal/Base.hs new file mode 100644 index 0000000..09a4fd9 --- /dev/null +++ b/WinEvent/HGamer3D/WinEvent/Internal/Base.hs @@ -0,0 +1,145 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- WinEvent/Internal/Base.hs + + +-- | Windowing and Event functionality for HGamer3D, implementation module. This modules exposes internal data structures, public API is in HGamer3D.WinEvent. +module HGamer3D.WinEvent.Internal.Base +( + EnumWinEventInit (..), + + SDLSystem, + initWinEvent, + freeWinEvent, + + attachToWindow, + openWindow, + pollWinEvent, + showCursor, + + module HGamer3D.Bindings.SDL2.StructSDLEvent, + module HGamer3D.Bindings.SDL2.EnumSDLEventType, + module HGamer3D.Bindings.SDL2.EnumSDLKeymod, + module HGamer3D.Bindings.SDL2.EnumSDLScancode, + module HGamer3D.Bindings.SDL2.EnumSDLWindowEventID, + module HGamer3D.Bindings.SDL2.EnumSDLWindowFlags, +) + +where + +import GHC.Ptr +import HGamer3D.Data +import HGamer3D.Data.Window + +import HGamer3D.Bindings.SDL2.ClassPtr +import HGamer3D.Bindings.SDL2.Utils + + +import HGamer3D.Bindings.SDL2.EnumSDLEventType +import HGamer3D.Bindings.SDL2.EnumSDLKeymod +import HGamer3D.Bindings.SDL2.EnumSDLScancode +import HGamer3D.Bindings.SDL2.EnumSDLWindowEventID +import HGamer3D.Bindings.SDL2.EnumSDLWindowFlags + +import HGamer3D.Bindings.SDL2.StructSDLEvent + +import HGamer3D.Bindings.SDL2.HeaderSDL +import HGamer3D.Bindings.SDL2.HeaderSDLVideo +import HGamer3D.Bindings.SDL2.HeaderSDLEvents +import HGamer3D.Bindings.SDL2.EnumSDLWindowFlags +import HGamer3D.Bindings.SDL2.HeaderSDLMouse +import HGamer3D.Bindings.SDL2.ClassHG3DUtilities + +import Foreign.Marshal.Utils +import Control.Monad +import Control.Applicative + +data SDLSystem = SDLSystem (Ptr SDLWindow) + +-- WinEvent Initialization Flags +data EnumWinEventInit = WEV_INIT_VIDEO -- ^ initialize Video subsystem + | WEV_INIT_TIMER -- ^ initialize Timer subsystem + | WEV_INIT_EVENTS -- ^ initialize Event subsystem + +instance Enum EnumWinEventInit where + toEnum 0x20 = WEV_INIT_VIDEO + toEnum 0x4000 = WEV_INIT_EVENTS + toEnum 0x01 = WEV_INIT_TIMER + + fromEnum WEV_INIT_VIDEO = 0x20 + fromEnum WEV_INIT_EVENTS = 0x4000 + fromEnum WEV_INIT_TIMER = 0x01 + +-- show instance for SDLEvent +instance Show SDLEvent where + show (EvtQuit ts) = "Event-Quit" + show (EvtKeyUp ts window keyscan keycode keymode) = "Event-KeyUp " ++ (show (fromEnum keyscan)) + show (EvtKeyDown ts window keyscan keycode keymode) = "Event-KeyDown " ++ (show (fromEnum keyscan)) + show (EvtText ts window text) = "Event-Text " ++ text + show (EvtMouseButtonUp ts window mid button x y) = "Event-MouseButtonUp " ++ (show button) ++ " " ++ (show x) ++ " " ++ (show y) + show (EvtMouseButtonDown ts window mid button x y) = "Event-MouseButtonDown " ++ (show button) ++ " " ++ (show x) ++ " " ++ (show y) + show (EvtMouseMotion ts window mid x y rx ry) = "Event-MouseMotion " ++ (show x) ++ " " ++ (show y) ++ " r: " ++ (show rx) ++ " " ++ (show ry) + show (EvtWindow ts window weid x y) = "Event-Window " ++ (show (fromEnum weid)) ++ " " ++ (show x) ++ " " ++ (show y) + show _ = "Specific Event is not in show instance" + +-- | Initialization of WinEvent +initWinEvent :: [EnumWinEventInit] -- ^ Initialization Flags + -> IO Int -- ^ result != 0 in case of errors +initWinEvent flags = do + res <- sdlInit $ sum (fmap fromEnum flags) + return res + +-- | Un-initialize WinEvent and free resources +freeWinEvent :: IO () +freeWinEvent = sdlQuit + + +attachToWindow :: Window -> IO (SDLSystem) +attachToWindow (Window handle) = do + res <- createWindowFromHandle handle + return $ SDLSystem res + +-- | open new window +openWindow :: String -- ^ Window Display Name + -> Int -- ^ X coordinate of Window + -> Int -- ^ Y coordinate of Window + -> Int -- ^ Width of Window + -> Int -- ^ Height of Window + -> [EnumSDLWindowFlags] -- ^ initialization flags + -> IO (SDLSystem) +openWindow title x y w h flags = do + win <- sdlCreateWindow title x y w h (sum $ fmap fromEnum flags) + return $ SDLSystem win + +-- | query for events from windowing system +pollWinEvent :: IO (Maybe SDLEvent) +pollWinEvent = do + (sdlevt, res) <- sdlPollEvent + let r = case res of + 0 -> Nothing + 1 -> Just sdlevt + _ -> Nothing + return r + +-- | show / hide cursor, returns previous state +showCursor :: Bool -> IO Bool +showCursor flag = do + ival <- sdlShowCursor (fromBool flag) + return (toBool ival) + diff --git a/WinEvent/SConstruct b/WinEvent/SConstruct index 52ef589..25b9021 100644 --- a/WinEvent/SConstruct +++ b/WinEvent/SConstruct @@ -14,14 +14,23 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - Glob("HGamer3D/*"), + "HGamer3D/WinEvent.hs", + Glob("HGamer3D/WinEvent/Internal/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), + Glob("../Bindings/SDL2/hBuild/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", +"ghc-pkg unregister HGamer3D-Wire || true", +"ghc-pkg unregister HGamer3D-GUI || true", + "cabal configure --user", "cabal build", "cabal haddock", diff --git a/Wire/HGamer3D-Wire.cabal b/Wire/HGamer3D-Wire.cabal index c17730c..c6f53c7 100644 --- a/Wire/HGamer3D-Wire.cabal +++ b/Wire/HGamer3D-Wire.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-Wire -Version: 0.3.3 +Version: 0.4.0 Synopsis: Wire Functionality for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -18,7 +18,7 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, netwire >= 5, containers, transformers, mtl, HGamer3D-Data >= 0.3.0 && < 0.4.0, HGamer3D >= 0.3.0 && < 0.4.0, HGamer3D-GUI >= 0.3.0 && < 0.4.0, HGamer3D-InputSystem >= 0.3.0 && < 0.4.0, HGamer3D-Audio >= 0.3.0 && < 0.4.0, HGamer3D-WinEvent >= 0.3.0 && < 0.4.0 + Build-Depends: base >= 3 && < 5, netwire >= 5, containers, transformers, mtl, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0, HGamer3D-InputSystem >= 0.4.0 && < 0.5.0, HGamer3D-Audio >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0 Exposed-modules: HGamer3D.Wire.Types,HGamer3D.Wire.EntityComponentSystem,HGamer3D.Wire.ECSWire,HGamer3D.Wire.GUI,HGamer3D.Wire Other-modules: diff --git a/Wire/HGamer3D/Wire.hs b/Wire/HGamer3D/Wire.hs index b1c9877..8c6531c 100644 --- a/Wire/HGamer3D/Wire.hs +++ b/Wire/HGamer3D/Wire.hs @@ -35,7 +35,7 @@ import Control.Wire.Unsafe.Event as U import Prelude hiding ((.), id) -import HGamer3D +import HGamer3D.Graphics3D import HGamer3D.Audio import HGamer3D.InputSystem import HGamer3D.WinEvent hiding (initHGamer3D, loopHGamer3D, exitHGamer3D) diff --git a/Wire/HGamer3D/Wire/ECSWire.hs b/Wire/HGamer3D/Wire/ECSWire.hs index bbc4a93..a0d9ca5 100644 --- a/Wire/HGamer3D/Wire/ECSWire.hs +++ b/Wire/HGamer3D/Wire/ECSWire.hs @@ -23,7 +23,7 @@ import Control.Wire.Unsafe.Event as U import Prelude hiding ((.), id) -import HGamer3D +import HGamer3D.Graphics3D import HGamer3D.Audio import HGamer3D.InputSystem diff --git a/Wire/HGamer3D/Wire/EntityComponentSystem.hs b/Wire/HGamer3D/Wire/EntityComponentSystem.hs index 0410e7a..b1a9414 100644 --- a/Wire/HGamer3D/Wire/EntityComponentSystem.hs +++ b/Wire/HGamer3D/Wire/EntityComponentSystem.hs @@ -18,7 +18,7 @@ module HGamer3D.Wire.EntityComponentSystem where import HGamer3D.Wire.Types -import HGamer3D +import HGamer3D.Graphics3D import HGamer3D.Audio import HGamer3D.InputSystem diff --git a/Wire/HGamer3D/Wire/GUI.hs b/Wire/HGamer3D/Wire/GUI.hs index 4be604f..c8a1d21 100644 --- a/Wire/HGamer3D/Wire/GUI.hs +++ b/Wire/HGamer3D/Wire/GUI.hs @@ -47,7 +47,7 @@ module HGamer3D.Wire.GUI where -import HGamer3D +import HGamer3D.Graphics3D import HGamer3D.GUI import Control.Monad.Trans diff --git a/Wire/HGamer3D/Wire/Types.hs b/Wire/HGamer3D/Wire/Types.hs index 7acd6c3..82fffc5 100644 --- a/Wire/HGamer3D/Wire/Types.hs +++ b/Wire/HGamer3D/Wire/Types.hs @@ -12,7 +12,7 @@ import Data.List import Data.Maybe import qualified Data.Map as M -import HGamer3D +import HGamer3D.Graphics3D import HGamer3D.Audio import HGamer3D.InputSystem diff --git a/Wire/SConstruct b/Wire/SConstruct index 091f73c..caa3e3b 100644 --- a/Wire/SConstruct +++ b/Wire/SConstruct @@ -1,5 +1,5 @@ -# SConstruct file to build Haskell packages -# ######################################### +# SConstruct file to build Haskell packages for Wire Module +# ######################################################### # set environment ################# @@ -17,12 +17,24 @@ dependsOn = [ Glob("HGamer3D/*"), Glob("HGamer3D/Wire/*"), Glob("*.cabal"), - "LICENSE" + "LICENSE", + + Glob("../Data/dist/HGamer3D-*.tar.gz"), + Glob("../GUI/dist/HGamer3D-*.tar.gz"), + Glob("../WinEvent/dist/HGamer3D-*.tar.gz"), + Glob("../Graphics3D/dist/HGamer3D-*.tar.gz"), + Glob("../Audio/dist/HGamer3D-*.tar.gz"), + Glob("../Network/dist/HGamer3D-*.tar.gz"), + Glob("../InputSystem/dist/HGamer3D-*.tar.gz"), + Glob("../Schema/dist/HGamer3D-*.tar.gz"), ] target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] env.Command(target, dependsOn, [ + +"ghc-pkg unregister HGamer3D || true", + "cabal configure --user", "cabal build", "cabal haddock", From e07bfe82c6ce9f1be166e31ad429e37bb1e24cdb Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Thu, 10 Jul 2014 10:20:55 +0200 Subject: [PATCH 03/28] Merge feature-gui-0.4 --- Bindings-HBind-Source/CEGUI/CEGUI.cfg | 78 ++++++- .../Source/HG3DWindowStaticFunctions.cpp | 37 ++++ .../CEGUI/Source/HG3DWindowStaticFunctions.h | 9 + Bindings/CEGUI/cBuild/ClassDragContainer.cpp | 18 ++ .../cBuild/ClassHG3DWindowStaticFunctions.cpp | 58 ++++++ Bindings/CEGUI/cBuild/ClassListHeader.cpp | 41 ++++ Bindings/CEGUI/cBuild/ClassMenuItem.cpp | 18 ++ .../CEGUI/cBuild/ClassMultiColumnList.cpp | 30 +++ Bindings/CEGUI/cBuild/ClassPtr.cpp | 44 ++++ Bindings/CEGUI/cBuild/ClassUDim.cpp | 87 ++++++++ Bindings/CEGUI/cBuild/ClassUVector2.cpp | 67 ++++++ Bindings/CEGUI/cBuild/ClassWindow.cpp | 134 ++++++++++++ .../cBuild/HG3DWindowStaticFunctions.cpp | 37 ++++ Bindings/CEGUI/cBuild/SConstruct | 4 +- .../CEGUI/cBuild/include/ClassDragContainer.h | 7 + .../include/ClassHG3DWindowStaticFunctions.h | 20 ++ .../CEGUI/cBuild/include/ClassListHeader.h | 13 ++ Bindings/CEGUI/cBuild/include/ClassMenuItem.h | 7 + .../cBuild/include/ClassMultiColumnList.h | 10 + Bindings/CEGUI/cBuild/include/ClassPtr.h | 6 + Bindings/CEGUI/cBuild/include/ClassUDim.h | 42 ++++ Bindings/CEGUI/cBuild/include/ClassUVector2.h | 37 ++++ Bindings/CEGUI/cBuild/include/ClassWindow.h | 47 +++++ .../include/HG3DWindowStaticFunctions.h | 9 + .../CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal | 4 +- .../Bindings/CEGUI/ClassDragContainer.chs | 10 + .../CEGUI/ClassHG3DWindowStaticFunctions.chs | 30 +++ .../Bindings/CEGUI/ClassListHeader.chs | 29 +++ .../HGamer3D/Bindings/CEGUI/ClassMenuItem.chs | 10 + .../Bindings/CEGUI/ClassMultiColumnList.chs | 21 ++ .../HGamer3D/Bindings/CEGUI/ClassPtr.chs | 4 + .../HGamer3D/Bindings/CEGUI/ClassUDim.chs | 65 ++++++ .../HGamer3D/Bindings/CEGUI/ClassUVector2.chs | 53 +++++ .../HGamer3D/Bindings/CEGUI/ClassWindow.chs | 79 +++++++ .../CEGUI/hBuild/include/ClassDragContainer.h | 7 + .../include/ClassHG3DWindowStaticFunctions.h | 20 ++ .../CEGUI/hBuild/include/ClassListHeader.h | 13 ++ Bindings/CEGUI/hBuild/include/ClassMenuItem.h | 7 + .../hBuild/include/ClassMultiColumnList.h | 10 + Bindings/CEGUI/hBuild/include/ClassPtr.h | 6 + Bindings/CEGUI/hBuild/include/ClassUDim.h | 42 ++++ Bindings/CEGUI/hBuild/include/ClassUVector2.h | 37 ++++ Bindings/CEGUI/hBuild/include/ClassWindow.h | 47 +++++ .../include/HG3DWindowStaticFunctions.h | 9 + Examples/GUI/GUI-Widgets.hs | 195 ++++++++++-------- Examples/Graphics3D/BlueCube.hs | 6 +- GUI/HGamer3D/GUI.hs | 45 +++- GUI/HGamer3D/GUI/Internal/Base.hs | 42 ++++ GUI/HGamer3D/GUI/Internal/Properties.hs | 104 +++++++++- GUI/HGamer3D/GUI/Internal/Widgets.hs | 105 ++++++---- 50 files changed, 1720 insertions(+), 140 deletions(-) create mode 100644 Bindings/CEGUI/cBuild/ClassUDim.cpp create mode 100644 Bindings/CEGUI/cBuild/ClassUVector2.cpp create mode 100644 Bindings/CEGUI/cBuild/include/ClassUDim.h create mode 100644 Bindings/CEGUI/cBuild/include/ClassUVector2.h create mode 100644 Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassUDim.chs create mode 100644 Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassUVector2.chs create mode 100644 Bindings/CEGUI/hBuild/include/ClassUDim.h create mode 100644 Bindings/CEGUI/hBuild/include/ClassUVector2.h diff --git a/Bindings-HBind-Source/CEGUI/CEGUI.cfg b/Bindings-HBind-Source/CEGUI/CEGUI.cfg index d857b66..e3c4c50 100644 --- a/Bindings-HBind-Source/CEGUI/CEGUI.cfg +++ b/Bindings-HBind-Source/CEGUI/CEGUI.cfg @@ -127,6 +127,70 @@ items: values: [!!python/unicode 'class_c_e_g_u_i_1_1_scrolled_container_1a1e5ab5afbe02d2163310cc46b1361b60'] - class: ExcludedMethodConfiguration values: [!!python/unicode 'class_c_e_g_u_i_1_1_scrolled_container_1a4ccb923a4d259c801c138c426204e739'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1afe93569ee895698ab2b62c3e200b3540'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1a427643ce697abf30ab70a37855c30a7d'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1ab1f446182562f1f993c7f9d9318721e5'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1a939f60c652ab4f62eeb6b0463e563e29'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1ac654a8bf1f27fc57bbf1f627d46fea30'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1add23d17b65f026adeb751839fde7feae'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1a19410d37bc8bdc596fb6215259bf2529'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1a507120ccfb6b992d8280c35a7ee6c54b'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1ae5a100694035e596fb4463eed2751df3'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1a62c3d4f317f1665f3057a8eb4149812d'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1a2824650e471c4daa1d06640f8943cbcb'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim_1a59418170dc5681fccd4aaea2ad2125d8'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a8d963fc0eb68e55329b5732e67025657'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a1485d24b84557406c0cdf8093ca50fa7'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a5288fafb03d5e184836acea19e5b319c'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1accd050a01d78dad0c9da4539a5cd5c67'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a64ef9d9c881c4fccb47bcd92d36e7dc8'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a7285bb86a76051b522f9ac09e56c4508'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a063159ea5af56f5687916e7fc1f6d2fd'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1ae593c494bcfa61a647e38922fcd28cd9'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a9cb0c4f92bdacf32230860fec7a15102'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a4963c288fefe45d2f0679f1b942f7623'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1ad8caa966b91d6b402e502f64044a3d7c'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a7469e1add8da7734c7b0a166fa78959e'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1afa98b06cfb59f31ea2517a828e42ace9'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1afc45e498fc6b00a52ef629fac1991a67'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1ad50a3436d1027922b54f39a8222250da'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a0ccd14d5a4a1f8af5d5568b63f8946a9'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1a18343de9def4b0d7551fd4e73b401b1f'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1affec121f18de7cc0a935b97c3df0315f'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1af0be20e14a4179adca3aa53bb92e7ded'] + - class: ExcludedMethodConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2_1acf991b381015c890796c9faad58e552e'] /config/allitems: - class: StructConfiguration values: [!!python/unicode 'structhg3dclass__struct', !!python/unicode 'HG3DClass', @@ -515,6 +579,18 @@ items: - class: ClassConfiguration values: [!!python/unicode 'class_no_logger', !!python/unicode '', !!python/unicode '', false, !!python/unicode ''] + - class: ClassConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_dim', !!python/unicode 'UDim', + !!python/unicode 'cegui_udim', true, !!python/unicode ''] + - class: ClassConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_box', !!python/unicode '', !!python/unicode '', + false, !!python/unicode ''] + - class: ClassConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_vector2', !!python/unicode 'UVector2', + !!python/unicode 'cegui_uv2', true, !!python/unicode ''] + - class: ClassConfiguration + values: [!!python/unicode 'class_c_e_g_u_i_1_1_u_rect', !!python/unicode '', !!python/unicode '', + false, !!python/unicode ''] /config/base: class: BaseConfig values: [!!python/unicode 'HGamer3D - CEGUI Bindings', !!python/unicode 'HGamer3D'] @@ -866,7 +942,7 @@ items: values: [!!python/unicode 'CEGUITplWRFactoryRegisterer.h', !!python/unicode '.', false, !!python/unicode '944c838c-48cb-47b6-85a1-f656350f3fa5'] - class: HeaderFile - values: [!!python/unicode 'CEGUIUDim.h', !!python/unicode '.', false, !!python/unicode '944c838c-48cb-47b6-85a1-f656350f3fa5'] + values: [!!python/unicode 'CEGUIUDim.h', !!python/unicode '.', true, !!python/unicode '944c838c-48cb-47b6-85a1-f656350f3fa5'] - class: HeaderFile values: [!!python/unicode 'CEGUIVector.h', !!python/unicode '.', false, !!python/unicode '944c838c-48cb-47b6-85a1-f656350f3fa5'] - class: HeaderFile diff --git a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp index f08201e..57b661a 100644 --- a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp +++ b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp @@ -81,3 +81,40 @@ CEGUI::MultiColumnList* HG3DWindowStaticFunctions::castWindowToMultiColumnList(C return (CEGUI::MultiColumnList*)window; } + + +// functions for UDim and UVector2 + +float HG3DWindowStaticFunctions::udScale( const CEGUI::UDim* ud) +{ + return ud->d_scale; +} + +float HG3DWindowStaticFunctions::udOffset( const CEGUI::UDim* ud) +{ + return ud->d_offset; +} + +CEGUI::UDim* HG3DWindowStaticFunctions::v2X( const CEGUI::UVector2* uv2) +{ + return (new CEGUI::UDim(uv2->d_x)); +} + +CEGUI::UDim* HG3DWindowStaticFunctions::v2Y( const CEGUI::UVector2* uv2) +{ + return (new CEGUI::UDim(uv2->d_y)); +} + +CEGUI::UDim* HG3DWindowStaticFunctions::getWindowWidth(const CEGUI::Window* window) +{ + CEGUI::UDim* pud = new CEGUI::UDim(0.0, 0.0); + *pud = window->getWidth(); + return pud; +} + +CEGUI::UDim* HG3DWindowStaticFunctions::getWindowHeight(const CEGUI::Window* window) +{ + CEGUI::UDim* pud = new CEGUI::UDim(0.0, 0.0); + *pud = window->getHeight(); + return pud; +} diff --git a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h index 009b715..9143643 100644 --- a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h +++ b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h @@ -40,5 +40,14 @@ class HG3DWindowStaticFunctions static CEGUI::Slider* castWindowToSlider(CEGUI::Window * window); static CEGUI::Spinner* castWindowToSpinner(CEGUI::Window * window); static CEGUI::MultiColumnList* castWindowToMultiColumnList(CEGUI::Window * window); + + // utility functions for UDims and UVectors + static float udScale( const CEGUI::UDim* ud); + static float udOffset( const CEGUI::UDim* ud); + static CEGUI::UDim* v2X( const CEGUI::UVector2* uv2); + static CEGUI::UDim* v2Y( const CEGUI::UVector2* uv2); + + static CEGUI::UDim* getWindowWidth(const CEGUI::Window* window); + static CEGUI::UDim* getWindowHeight(const CEGUI::Window* window); }; diff --git a/Bindings/CEGUI/cBuild/ClassDragContainer.cpp b/Bindings/CEGUI/cBuild/ClassDragContainer.cpp index 1529079..c31d5c7 100644 --- a/Bindings/CEGUI/cBuild/ClassDragContainer.cpp +++ b/Bindings/CEGUI/cBuild/ClassDragContainer.cpp @@ -171,6 +171,24 @@ extern "C" CEGUI_LIB_EXPORT void cegui_drgcnt_pickUp(struct hg3dclass_struct * t *result_c = (int)result_cpp; }; +// Set the fixed mouse cursor dragging offset to be used for this DragContainer +extern "C" CEGUI_LIB_EXPORT void cegui_drgcnt_setFixedDragOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * offset_c) +{ + CEGUI::DragContainer * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::DragContainer")); + const CEGUI::UVector2 * offset_cpp = static_cast (getHG3DClassPtr(*offset_c, "CEGUI::UVector2")); + (thisclass_cpp->setFixedDragOffset(*offset_cpp)); +}; + +// Return the fixed mouse cursor dragging offset to be used for this DragContainer +extern "C" CEGUI_LIB_EXPORT void cegui_drgcnt_getFixedDragOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c) +{ + CEGUI::DragContainer * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::DragContainer")); + const CEGUI::UVector2 * result_cpp; + result_cpp = &(thisclass_cpp->getFixedDragOffset()); + *result_c = getHG3DClass_UVector2((void *) result_cpp); +; +}; + // Set whether the fixed dragging offset - as set with the setFixedDragOffset - function will be used, or whether the built-in positioning will be used. extern "C" CEGUI_LIB_EXPORT void cegui_drgcnt_setUsingFixedDragOffset(struct hg3dclass_struct * thisclass_c, const int enable_c) { diff --git a/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp b/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp index 5aa030c..34dea08 100644 --- a/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp +++ b/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp @@ -157,3 +157,61 @@ extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_castWindowToMultiColumnList(stru ; }; +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_udScale(struct hg3dclass_struct * ud_c, float * result_c) +{ + const CEGUI::UDim * ud_cpp = static_cast (getHG3DClassPtr(*ud_c, "CEGUI::UDim")); + float result_cpp; + result_cpp = (HG3DWindowStaticFunctions::udScale(ud_cpp)); + *result_c = (float)result_cpp; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_udOffset(struct hg3dclass_struct * ud_c, float * result_c) +{ + const CEGUI::UDim * ud_cpp = static_cast (getHG3DClassPtr(*ud_c, "CEGUI::UDim")); + float result_cpp; + result_cpp = (HG3DWindowStaticFunctions::udOffset(ud_cpp)); + *result_c = (float)result_cpp; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_v2X(struct hg3dclass_struct * uv2_c, struct hg3dclass_struct * result_c) +{ + const CEGUI::UVector2 * uv2_cpp = static_cast (getHG3DClassPtr(*uv2_c, "CEGUI::UVector2")); + CEGUI::UDim * result_cpp; + result_cpp = (HG3DWindowStaticFunctions::v2X(uv2_cpp)); + *result_c = getHG3DClass_UDim((void *) result_cpp); +; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_v2Y(struct hg3dclass_struct * uv2_c, struct hg3dclass_struct * result_c) +{ + const CEGUI::UVector2 * uv2_cpp = static_cast (getHG3DClassPtr(*uv2_c, "CEGUI::UVector2")); + CEGUI::UDim * result_cpp; + result_cpp = (HG3DWindowStaticFunctions::v2Y(uv2_cpp)); + *result_c = getHG3DClass_UDim((void *) result_cpp); +; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_getWindowWidth(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c) +{ + const CEGUI::Window * window_cpp = static_cast (getHG3DClassPtr(*window_c, "CEGUI::Window")); + CEGUI::UDim * result_cpp; + result_cpp = (HG3DWindowStaticFunctions::getWindowWidth(window_cpp)); + *result_c = getHG3DClass_UDim((void *) result_cpp); +; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_getWindowHeight(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c) +{ + const CEGUI::Window * window_cpp = static_cast (getHG3DClassPtr(*window_c, "CEGUI::Window")); + CEGUI::UDim * result_cpp; + result_cpp = (HG3DWindowStaticFunctions::getWindowHeight(window_cpp)); + *result_c = getHG3DClass_UDim((void *) result_cpp); +; +}; + diff --git a/Bindings/CEGUI/cBuild/ClassListHeader.cpp b/Bindings/CEGUI/cBuild/ClassListHeader.cpp index d3cdc47..0bdb570 100644 --- a/Bindings/CEGUI/cBuild/ClassListHeader.cpp +++ b/Bindings/CEGUI/cBuild/ClassListHeader.cpp @@ -258,6 +258,38 @@ extern "C" CEGUI_LIB_EXPORT void cegui_lsthdr_setColumnDraggingEnabled(struct hg (thisclass_cpp->setColumnDraggingEnabled(setting_cpp)); }; +// Add a new column segment to the end of the header. +extern "C" CEGUI_LIB_EXPORT void cegui_lsthdr_addColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c) +{ + CEGUI::ListHeader * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::ListHeader")); + CEGUI::String text_cpp = CEGUI::String((const char*) text_c); + uint id_cpp = (uint)id_c; + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + (thisclass_cpp->addColumn(text_cpp, id_cpp, *width_cpp)); +}; + +// Insert a new column segment at the specified position. +extern "C" CEGUI_LIB_EXPORT void cegui_lsthdr_insertColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c, unsigned int position_c) +{ + CEGUI::ListHeader * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::ListHeader")); + CEGUI::String text_cpp = CEGUI::String((const char*) text_c); + uint id_cpp = (uint)id_c; + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + uint position_cpp = (uint)position_c; + (thisclass_cpp->insertColumn(text_cpp, id_cpp, *width_cpp, position_cpp)); +}; + +// Insert a new column segment at the specified position. +extern "C" CEGUI_LIB_EXPORT void cegui_lsthdr_insertColumn2(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c, struct hg3dclass_struct * position_c) +{ + CEGUI::ListHeader * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::ListHeader")); + CEGUI::String text_cpp = CEGUI::String((const char*) text_c); + uint id_cpp = (uint)id_c; + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + const CEGUI::ListHeaderSegment * position_cpp = static_cast (getHG3DClassPtr(*position_c, "CEGUI::ListHeaderSegment")); + (thisclass_cpp->insertColumn(text_cpp, id_cpp, *width_cpp, *position_cpp)); +}; + // Removes a column segment from the ListHeader extern "C" CEGUI_LIB_EXPORT void cegui_lsthdr_removeColumn(struct hg3dclass_struct * thisclass_c, unsigned int column_c) { @@ -318,6 +350,15 @@ extern "C" CEGUI_LIB_EXPORT void cegui_lsthdr_setSegmentOffset(struct hg3dclass_ (thisclass_cpp->setSegmentOffset(offset_cpp)); }; +// Set the width of the specified column. +extern "C" CEGUI_LIB_EXPORT void cegui_lsthdr_setColumnWidth(struct hg3dclass_struct * thisclass_c, unsigned int column_c, struct hg3dclass_struct * width_c) +{ + CEGUI::ListHeader * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::ListHeader")); + uint column_cpp = (uint)column_c; + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + (thisclass_cpp->setColumnWidth(column_cpp, *width_cpp)); +}; + // Constructor for the list header base class. extern "C" CEGUI_LIB_EXPORT void cegui_lsthdr_construct(char * type_c, char * name_c, struct hg3dclass_struct * result_c) { diff --git a/Bindings/CEGUI/cBuild/ClassMenuItem.cpp b/Bindings/CEGUI/cBuild/ClassMenuItem.cpp index 53f49d0..68694b9 100644 --- a/Bindings/CEGUI/cBuild/ClassMenuItem.cpp +++ b/Bindings/CEGUI/cBuild/ClassMenuItem.cpp @@ -109,6 +109,24 @@ extern "C" CEGUI_LIB_EXPORT void cegui_mnitm_setAutoPopupTimeout(struct hg3dclas (thisclass_cpp->setAutoPopupTimeout(time_cpp)); }; +// Returns the current offset for popup placement. +extern "C" CEGUI_LIB_EXPORT void cegui_mnitm_getPopupOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c) +{ + CEGUI::MenuItem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::MenuItem")); + const CEGUI::UVector2 * result_cpp; + result_cpp = &(thisclass_cpp->getPopupOffset()); + *result_c = getHG3DClass_UVector2((void *) result_cpp); +; +}; + +// sets the current offset for popup placement. +extern "C" CEGUI_LIB_EXPORT void cegui_mnitm_setPopupOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * popupOffset_c) +{ + CEGUI::MenuItem * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::MenuItem")); + const CEGUI::UVector2 * popupOffset_cpp = static_cast (getHG3DClassPtr(*popupOffset_c, "CEGUI::UVector2")); + (thisclass_cpp->setPopupOffset(*popupOffset_cpp)); +}; + // Opens the PopupMenu. extern "C" CEGUI_LIB_EXPORT void cegui_mnitm_openPopupMenu(struct hg3dclass_struct * thisclass_c, int notify_c) { diff --git a/Bindings/CEGUI/cBuild/ClassMultiColumnList.cpp b/Bindings/CEGUI/cBuild/ClassMultiColumnList.cpp index c6d1eea..b8a1131 100644 --- a/Bindings/CEGUI/cBuild/ClassMultiColumnList.cpp +++ b/Bindings/CEGUI/cBuild/ClassMultiColumnList.cpp @@ -420,6 +420,27 @@ extern "C" CEGUI_LIB_EXPORT void cegui_mltclmlst_resetList(struct hg3dclass_stru (thisclass_cpp->resetList()); }; +// Add a column to the list box. +extern "C" CEGUI_LIB_EXPORT void cegui_mltclmlst_addColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int col_id_c, struct hg3dclass_struct * width_c) +{ + CEGUI::MultiColumnList * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::MultiColumnList")); + CEGUI::String text_cpp = CEGUI::String((const char*) text_c); + uint col_id_cpp = (uint)col_id_c; + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + (thisclass_cpp->addColumn(text_cpp, col_id_cpp, *width_cpp)); +}; + +// Insert a new column in the list. +extern "C" CEGUI_LIB_EXPORT void cegui_mltclmlst_insertColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int col_id_c, struct hg3dclass_struct * width_c, unsigned int position_c) +{ + CEGUI::MultiColumnList * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::MultiColumnList")); + CEGUI::String text_cpp = CEGUI::String((const char*) text_c); + uint col_id_cpp = (uint)col_id_c; + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + uint position_cpp = (uint)position_c; + (thisclass_cpp->insertColumn(text_cpp, col_id_cpp, *width_cpp, position_cpp)); +}; + // Removes a column from the list box. This will cause any ListboxItem extern "C" CEGUI_LIB_EXPORT void cegui_mltclmlst_removeColumn(struct hg3dclass_struct * thisclass_c, unsigned int col_idx_c) { @@ -613,6 +634,15 @@ extern "C" CEGUI_LIB_EXPORT void cegui_mltclmlst_handleUpdatedItemData(struct hg (thisclass_cpp->handleUpdatedItemData()); }; +// Set the width of the specified column header (and therefore the column itself). +extern "C" CEGUI_LIB_EXPORT void cegui_mltclmlst_setColumnHeaderWidth(struct hg3dclass_struct * thisclass_c, unsigned int col_idx_c, struct hg3dclass_struct * width_c) +{ + CEGUI::MultiColumnList * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::MultiColumnList")); + uint col_idx_cpp = (uint)col_idx_c; + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + (thisclass_cpp->setColumnHeaderWidth(col_idx_cpp, *width_cpp)); +}; + // Set whether user manipulation of the sort column and direction are enabled. extern "C" CEGUI_LIB_EXPORT void cegui_mltclmlst_setUserSortControlEnabled(struct hg3dclass_struct * thisclass_c, int setting_c) { diff --git a/Bindings/CEGUI/cBuild/ClassPtr.cpp b/Bindings/CEGUI/cBuild/ClassPtr.cpp index 653a3c2..f29c198 100644 --- a/Bindings/CEGUI/cBuild/ClassPtr.cpp +++ b/Bindings/CEGUI/cBuild/ClassPtr.cpp @@ -1348,6 +1348,50 @@ hg3dclass_struct getHG3DClass_Tree(void *ptrIn) return st; }; +// +// CEGUI::UDim +// + +// Ptr Caster +void *internalHG3D_UDim_PtrCaster(const char* className, void* ptrIn) { + if (strcmp(className, "CEGUI::UDim") == 0) { + return ptrIn; + }; + printf("PtrCaster not successful, Class: CEGUI::UDim is not a subclass of %s!\n",className); + return (void *)0; +}; + +// getHG3DClass +hg3dclass_struct getHG3DClass_UDim(void *ptrIn) +{ + hg3dclass_struct st; + st.ptr = ptrIn; + st.fptr = (void *)(&internalHG3D_UDim_PtrCaster); + return st; +}; + +// +// CEGUI::UVector2 +// + +// Ptr Caster +void *internalHG3D_UVector2_PtrCaster(const char* className, void* ptrIn) { + if (strcmp(className, "CEGUI::UVector2") == 0) { + return ptrIn; + }; + printf("PtrCaster not successful, Class: CEGUI::UVector2 is not a subclass of %s!\n",className); + return (void *)0; +}; + +// getHG3DClass +hg3dclass_struct getHG3DClass_UVector2(void *ptrIn) +{ + hg3dclass_struct st; + st.ptr = ptrIn; + st.fptr = (void *)(&internalHG3D_UVector2_PtrCaster); + return st; +}; + // // CEGUI::WidgetLookManager // diff --git a/Bindings/CEGUI/cBuild/ClassUDim.cpp b/Bindings/CEGUI/cBuild/ClassUDim.cpp new file mode 100644 index 0000000..c99d339 --- /dev/null +++ b/Bindings/CEGUI/cBuild/ClassUDim.cpp @@ -0,0 +1,87 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// ClassUDim.cpp + +// + +#include +#include +#include + +#include + #include + #include + #include + #include + #include "CEGUIDllDefines.h" + #include "ClassPtr.h" + #include "./CEGUI.h" +#include "./CEGUIString.h" +#include "RendererModules/Ogre/CEGUIOgreRenderer.h" +#include "./WindowManagerHG3D.h" +#include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" +#include "HG3DEventStaticFunctions.h" +#include "HG3DListboxStaticFunctions.h" +#include "HG3DEventController.h" +#include "HG3DEventModule.h" +#include "HG3DWindowStaticFunctions.h" + +using namespace CEGUI; + + + +// +extern "C" CEGUI_LIB_EXPORT void cegui_udim_construct(float scale_c, float offset_c, struct hg3dclass_struct * result_c) +{ + float scale_cpp = (float)scale_c; + float offset_cpp = (float)offset_c; + CEGUI::UDim * result_cpp; + result_cpp = (new CEGUI::UDim(scale_cpp, offset_cpp)); + *result_c = getHG3DClass_UDim((void *) result_cpp); +; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_udim_destruct(struct hg3dclass_struct * thisclass_c) +{ + CEGUI::UDim * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::UDim")); + (delete thisclass_cpp); +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_udim_asAbsolute(struct hg3dclass_struct * thisclass_c, float base_c, float * result_c) +{ + CEGUI::UDim * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::UDim")); + float base_cpp = (float)base_c; + float result_cpp; + result_cpp = (thisclass_cpp->asAbsolute(base_cpp)); + *result_c = (float)result_cpp; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_udim_asRelative(struct hg3dclass_struct * thisclass_c, float base_c, float * result_c) +{ + CEGUI::UDim * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::UDim")); + float base_cpp = (float)base_c; + float result_cpp; + result_cpp = (thisclass_cpp->asRelative(base_cpp)); + *result_c = (float)result_cpp; +}; + diff --git a/Bindings/CEGUI/cBuild/ClassUVector2.cpp b/Bindings/CEGUI/cBuild/ClassUVector2.cpp new file mode 100644 index 0000000..856fb43 --- /dev/null +++ b/Bindings/CEGUI/cBuild/ClassUVector2.cpp @@ -0,0 +1,67 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// ClassUVector2.cpp + +// + +#include +#include +#include + +#include + #include + #include + #include + #include + #include "CEGUIDllDefines.h" + #include "ClassPtr.h" + #include "./CEGUI.h" +#include "./CEGUIString.h" +#include "RendererModules/Ogre/CEGUIOgreRenderer.h" +#include "./WindowManagerHG3D.h" +#include "./SystemHG3D.h" +#include "HG3DCommandHandler.h" +#include "HG3DEventStaticFunctions.h" +#include "HG3DListboxStaticFunctions.h" +#include "HG3DEventController.h" +#include "HG3DEventModule.h" +#include "HG3DWindowStaticFunctions.h" + +using namespace CEGUI; + + + +// +extern "C" CEGUI_LIB_EXPORT void cegui_uv2_construct(struct hg3dclass_struct * x_c, struct hg3dclass_struct * y_c, struct hg3dclass_struct * result_c) +{ + const CEGUI::UDim * x_cpp = static_cast (getHG3DClassPtr(*x_c, "CEGUI::UDim")); + const CEGUI::UDim * y_cpp = static_cast (getHG3DClassPtr(*y_c, "CEGUI::UDim")); + CEGUI::UVector2 * result_cpp; + result_cpp = (new CEGUI::UVector2(*x_cpp, *y_cpp)); + *result_c = getHG3DClass_UVector2((void *) result_cpp); +; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_uv2_destruct(struct hg3dclass_struct * thisclass_c) +{ + CEGUI::UVector2 * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::UVector2")); + (delete thisclass_cpp); +}; + diff --git a/Bindings/CEGUI/cBuild/ClassWindow.cpp b/Bindings/CEGUI/cBuild/ClassWindow.cpp index 348d0a7..3c83493 100644 --- a/Bindings/CEGUI/cBuild/ClassWindow.cpp +++ b/Bindings/CEGUI/cBuild/ClassWindow.cpp @@ -1138,6 +1138,140 @@ extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setUserString(struct hg3dclass_struct (thisclass_cpp->setUserString(name_cpp, value_cpp)); }; +// Set the window area. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setArea(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * xpos_c, struct hg3dclass_struct * ypos_c, struct hg3dclass_struct * width_c, struct hg3dclass_struct * height_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UDim * xpos_cpp = static_cast (getHG3DClassPtr(*xpos_c, "CEGUI::UDim")); + const CEGUI::UDim * ypos_cpp = static_cast (getHG3DClassPtr(*ypos_c, "CEGUI::UDim")); + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + const CEGUI::UDim * height_cpp = static_cast (getHG3DClassPtr(*height_c, "CEGUI::UDim")); + (thisclass_cpp->setArea(*xpos_cpp, *ypos_cpp, *width_cpp, *height_cpp)); +}; + +// Set the window area. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setArea2(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * pos_c, struct hg3dclass_struct * size_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UVector2 * pos_cpp = static_cast (getHG3DClassPtr(*pos_c, "CEGUI::UVector2")); + const CEGUI::UVector2 * size_cpp = static_cast (getHG3DClassPtr(*size_c, "CEGUI::UVector2")); + (thisclass_cpp->setArea(*pos_cpp, *size_cpp)); +}; + +// Set the window's position. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * pos_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UVector2 * pos_cpp = static_cast (getHG3DClassPtr(*pos_c, "CEGUI::UVector2")); + (thisclass_cpp->setPosition(*pos_cpp)); +}; + +// Set the window's X position. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setXPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * x_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UDim * x_cpp = static_cast (getHG3DClassPtr(*x_c, "CEGUI::UDim")); + (thisclass_cpp->setXPosition(*x_cpp)); +}; + +// Set the window's Y position. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setYPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * y_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UDim * y_cpp = static_cast (getHG3DClassPtr(*y_c, "CEGUI::UDim")); + (thisclass_cpp->setYPosition(*y_cpp)); +}; + +// Set the window's size. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UVector2 * size_cpp = static_cast (getHG3DClassPtr(*size_c, "CEGUI::UVector2")); + (thisclass_cpp->setSize(*size_cpp)); +}; + +// Set the window's width. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setWidth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * width_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UDim * width_cpp = static_cast (getHG3DClassPtr(*width_c, "CEGUI::UDim")); + (thisclass_cpp->setWidth(*width_cpp)); +}; + +// Set the window's height. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setHeight(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * height_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UDim * height_cpp = static_cast (getHG3DClassPtr(*height_c, "CEGUI::UDim")); + (thisclass_cpp->setHeight(*height_cpp)); +}; + +// Set the window's maximum size. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setMaxSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UVector2 * size_cpp = static_cast (getHG3DClassPtr(*size_c, "CEGUI::UVector2")); + (thisclass_cpp->setMaxSize(*size_cpp)); +}; + +// Set the window's minimum size. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_setMinSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UVector2 * size_cpp = static_cast (getHG3DClassPtr(*size_c, "CEGUI::UVector2")); + (thisclass_cpp->setMinSize(*size_cpp)); +}; + +// Get the window's position. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_getPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UVector2 * result_cpp; + result_cpp = &(thisclass_cpp->getPosition()); + *result_c = getHG3DClass_UVector2((void *) result_cpp); +; +}; + +// Get the window's X position. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_getXPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UDim * result_cpp; + result_cpp = &(thisclass_cpp->getXPosition()); + *result_c = getHG3DClass_UDim((void *) result_cpp); +; +}; + +// Get the window's Y position. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_getYPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UDim * result_cpp; + result_cpp = &(thisclass_cpp->getYPosition()); + *result_c = getHG3DClass_UDim((void *) result_cpp); +; +}; + +// Get the window's maximum size. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_getMaxSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UVector2 * result_cpp; + result_cpp = &(thisclass_cpp->getMaxSize()); + *result_c = getHG3DClass_UVector2((void *) result_cpp); +; +}; + +// Get the window's minimum size. +extern "C" CEGUI_LIB_EXPORT void cegui_wnd_getMinSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c) +{ + CEGUI::Window * thisclass_cpp = static_cast (getHG3DClassPtr(*thisclass_c, "CEGUI::Window")); + const CEGUI::UVector2 * result_cpp; + result_cpp = &(thisclass_cpp->getMinSize()); + *result_c = getHG3DClass_UVector2((void *) result_cpp); +; +}; + // Causes the Window extern "C" CEGUI_LIB_EXPORT void cegui_wnd_render(struct hg3dclass_struct * thisclass_c) { diff --git a/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp b/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp index f08201e..57b661a 100644 --- a/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp +++ b/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp @@ -81,3 +81,40 @@ CEGUI::MultiColumnList* HG3DWindowStaticFunctions::castWindowToMultiColumnList(C return (CEGUI::MultiColumnList*)window; } + + +// functions for UDim and UVector2 + +float HG3DWindowStaticFunctions::udScale( const CEGUI::UDim* ud) +{ + return ud->d_scale; +} + +float HG3DWindowStaticFunctions::udOffset( const CEGUI::UDim* ud) +{ + return ud->d_offset; +} + +CEGUI::UDim* HG3DWindowStaticFunctions::v2X( const CEGUI::UVector2* uv2) +{ + return (new CEGUI::UDim(uv2->d_x)); +} + +CEGUI::UDim* HG3DWindowStaticFunctions::v2Y( const CEGUI::UVector2* uv2) +{ + return (new CEGUI::UDim(uv2->d_y)); +} + +CEGUI::UDim* HG3DWindowStaticFunctions::getWindowWidth(const CEGUI::Window* window) +{ + CEGUI::UDim* pud = new CEGUI::UDim(0.0, 0.0); + *pud = window->getWidth(); + return pud; +} + +CEGUI::UDim* HG3DWindowStaticFunctions::getWindowHeight(const CEGUI::Window* window) +{ + CEGUI::UDim* pud = new CEGUI::UDim(0.0, 0.0); + *pud = window->getHeight(); + return pud; +} diff --git a/Bindings/CEGUI/cBuild/SConstruct b/Bindings/CEGUI/cBuild/SConstruct index fa8c82b..27afe6f 100644 --- a/Bindings/CEGUI/cBuild/SConstruct +++ b/Bindings/CEGUI/cBuild/SConstruct @@ -40,14 +40,14 @@ if env["PLATFORM"] == "win32": env.Append(CPPPATH=["include","../Deps/include","../Deps/include/CEGUI","../Deps/dependencies/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3dcegui040", ["HG3DEventModule.cpp","ClassEventSet.cpp","ClassMenuItem.cpp","ClassHG3DListboxStaticFunctions.cpp","ClassWidgetLookManager.cpp","ClassHG3DEventStaticFunctions.cpp","ClassRadioButton.cpp","ClassMenuBase.cpp","HG3DCommandHandler.cpp","ClassProgressBar.cpp","ClassImageCodec.cpp","ClassCheckbox.cpp","ClassListboxItem.cpp","ClassItemEntry.cpp","ClassCombobox.cpp","ClassFrameWindow.cpp","ClassEditbox.cpp","ClassRenderer.cpp","ClassLogger.cpp","HG3DWindowStaticFunctions.cpp","ClassDefaultResourceProvider.cpp","ClassTooltip.cpp","ClassHG3DWindowStaticFunctions.cpp","ClassScheme.cpp","ClassSystemHG3D.cpp","ClassPropertySet.cpp","HG3DListboxStaticFunctions.cpp","ClassFont.cpp","ClassResourceProvider.cpp","HG3DEventController.cpp","ClassPushButton.cpp","ClassScrollbar.cpp","ClassWindow.cpp","ClassListbox.cpp","ClassScriptModule.cpp","ClassListHeader.cpp","ClassSlider.cpp","ClassItemListbox.cpp","ClassListboxTextItem.cpp","ClassDragContainer.cpp","ClassWindowManager.cpp","HG3DEventStaticFunctions.cpp","ClassWindowManagerHG3D.cpp","ClassScriptFunctor.cpp","ClassOgreResourceProvider.cpp","ClassTree.cpp","ClassTabButton.cpp","ClassDefaultLogger.cpp","ClassPtr.cpp","ClassOgreRenderer.cpp","ClassSystem.cpp","ClassListHeaderSegment.cpp","ClassHG3DEventController.cpp","ClassThumb.cpp","ClassScrolledContainer.cpp","ClassScrollablePane.cpp","ClassSpinner.cpp","ClassImageset.cpp","ClassMultiLineEditbox.cpp","ClassSchemeManager.cpp","ClassFontManager.cpp","ClassMultiColumnList.cpp","ClassEventArgs.cpp","ClassComboDropList.cpp","ClassXMLParser.cpp","ClassScrolledItemListBase.cpp"], LIBS = ["CEGUIBase.lib","CEGUIOgreRenderer.lib"]) + env.SharedLibrary("hg3dcegui040", ["HG3DEventModule.cpp","ClassEventSet.cpp","ClassMenuItem.cpp","ClassHG3DListboxStaticFunctions.cpp","ClassWidgetLookManager.cpp","ClassHG3DEventStaticFunctions.cpp","ClassRadioButton.cpp","ClassMenuBase.cpp","HG3DCommandHandler.cpp","ClassProgressBar.cpp","ClassImageCodec.cpp","ClassCheckbox.cpp","ClassUVector2.cpp","ClassListboxItem.cpp","ClassItemEntry.cpp","ClassCombobox.cpp","ClassFrameWindow.cpp","ClassEditbox.cpp","ClassRenderer.cpp","ClassLogger.cpp","HG3DWindowStaticFunctions.cpp","ClassDefaultResourceProvider.cpp","ClassTooltip.cpp","ClassHG3DWindowStaticFunctions.cpp","ClassScheme.cpp","ClassSystemHG3D.cpp","ClassPropertySet.cpp","HG3DListboxStaticFunctions.cpp","ClassFont.cpp","ClassResourceProvider.cpp","HG3DEventController.cpp","ClassPushButton.cpp","ClassScrollbar.cpp","ClassWindow.cpp","ClassListbox.cpp","ClassScriptModule.cpp","ClassListHeader.cpp","ClassSlider.cpp","ClassItemListbox.cpp","ClassListboxTextItem.cpp","ClassDragContainer.cpp","ClassWindowManager.cpp","HG3DEventStaticFunctions.cpp","ClassWindowManagerHG3D.cpp","ClassScriptFunctor.cpp","ClassOgreResourceProvider.cpp","ClassTree.cpp","ClassTabButton.cpp","ClassDefaultLogger.cpp","ClassPtr.cpp","ClassOgreRenderer.cpp","ClassSystem.cpp","ClassListHeaderSegment.cpp","ClassHG3DEventController.cpp","ClassThumb.cpp","ClassScrolledContainer.cpp","ClassScrollablePane.cpp","ClassSpinner.cpp","ClassImageset.cpp","ClassMultiLineEditbox.cpp","ClassSchemeManager.cpp","ClassFontManager.cpp","ClassMultiColumnList.cpp","ClassEventArgs.cpp","ClassComboDropList.cpp","ClassXMLParser.cpp","ClassUDim.cpp","ClassScrolledItemListBase.cpp"], LIBS = ["CEGUIBase.lib","CEGUIOgreRenderer.lib"]) env.Alias('install', libpath) env.Install(libpath, "hg3dcegui040.dll") else: env.Append(CPPPATH=["include","../Deps/include","../Deps/include/CEGUI","../Deps/dependencies/include"]) env.Append(LIBPATH=["lib","../Deps/lib","../Deps/lib"]) - env.SharedLibrary("hg3dcegui040", ["HG3DEventModule.cpp","ClassEventSet.cpp","ClassMenuItem.cpp","ClassHG3DListboxStaticFunctions.cpp","ClassWidgetLookManager.cpp","ClassHG3DEventStaticFunctions.cpp","ClassRadioButton.cpp","ClassMenuBase.cpp","HG3DCommandHandler.cpp","ClassProgressBar.cpp","ClassImageCodec.cpp","ClassCheckbox.cpp","ClassListboxItem.cpp","ClassItemEntry.cpp","ClassCombobox.cpp","ClassFrameWindow.cpp","ClassEditbox.cpp","ClassRenderer.cpp","ClassLogger.cpp","HG3DWindowStaticFunctions.cpp","ClassDefaultResourceProvider.cpp","ClassTooltip.cpp","ClassHG3DWindowStaticFunctions.cpp","ClassScheme.cpp","ClassSystemHG3D.cpp","ClassPropertySet.cpp","HG3DListboxStaticFunctions.cpp","ClassFont.cpp","ClassResourceProvider.cpp","HG3DEventController.cpp","ClassPushButton.cpp","ClassScrollbar.cpp","ClassWindow.cpp","ClassListbox.cpp","ClassScriptModule.cpp","ClassListHeader.cpp","ClassSlider.cpp","ClassItemListbox.cpp","ClassListboxTextItem.cpp","ClassDragContainer.cpp","ClassWindowManager.cpp","HG3DEventStaticFunctions.cpp","ClassWindowManagerHG3D.cpp","ClassScriptFunctor.cpp","ClassOgreResourceProvider.cpp","ClassTree.cpp","ClassTabButton.cpp","ClassDefaultLogger.cpp","ClassPtr.cpp","ClassOgreRenderer.cpp","ClassSystem.cpp","ClassListHeaderSegment.cpp","ClassHG3DEventController.cpp","ClassThumb.cpp","ClassScrolledContainer.cpp","ClassScrollablePane.cpp","ClassSpinner.cpp","ClassImageset.cpp","ClassMultiLineEditbox.cpp","ClassSchemeManager.cpp","ClassFontManager.cpp","ClassMultiColumnList.cpp","ClassEventArgs.cpp","ClassComboDropList.cpp","ClassXMLParser.cpp","ClassScrolledItemListBase.cpp"], LIBS = ["CEGUIBase-0.7.7","CEGUIOgreRenderer-0.7.7"]) + env.SharedLibrary("hg3dcegui040", ["HG3DEventModule.cpp","ClassEventSet.cpp","ClassMenuItem.cpp","ClassHG3DListboxStaticFunctions.cpp","ClassWidgetLookManager.cpp","ClassHG3DEventStaticFunctions.cpp","ClassRadioButton.cpp","ClassMenuBase.cpp","HG3DCommandHandler.cpp","ClassProgressBar.cpp","ClassImageCodec.cpp","ClassCheckbox.cpp","ClassUVector2.cpp","ClassListboxItem.cpp","ClassItemEntry.cpp","ClassCombobox.cpp","ClassFrameWindow.cpp","ClassEditbox.cpp","ClassRenderer.cpp","ClassLogger.cpp","HG3DWindowStaticFunctions.cpp","ClassDefaultResourceProvider.cpp","ClassTooltip.cpp","ClassHG3DWindowStaticFunctions.cpp","ClassScheme.cpp","ClassSystemHG3D.cpp","ClassPropertySet.cpp","HG3DListboxStaticFunctions.cpp","ClassFont.cpp","ClassResourceProvider.cpp","HG3DEventController.cpp","ClassPushButton.cpp","ClassScrollbar.cpp","ClassWindow.cpp","ClassListbox.cpp","ClassScriptModule.cpp","ClassListHeader.cpp","ClassSlider.cpp","ClassItemListbox.cpp","ClassListboxTextItem.cpp","ClassDragContainer.cpp","ClassWindowManager.cpp","HG3DEventStaticFunctions.cpp","ClassWindowManagerHG3D.cpp","ClassScriptFunctor.cpp","ClassOgreResourceProvider.cpp","ClassTree.cpp","ClassTabButton.cpp","ClassDefaultLogger.cpp","ClassPtr.cpp","ClassOgreRenderer.cpp","ClassSystem.cpp","ClassListHeaderSegment.cpp","ClassHG3DEventController.cpp","ClassThumb.cpp","ClassScrolledContainer.cpp","ClassScrollablePane.cpp","ClassSpinner.cpp","ClassImageset.cpp","ClassMultiLineEditbox.cpp","ClassSchemeManager.cpp","ClassFontManager.cpp","ClassMultiColumnList.cpp","ClassEventArgs.cpp","ClassComboDropList.cpp","ClassXMLParser.cpp","ClassUDim.cpp","ClassScrolledItemListBase.cpp"], LIBS = ["CEGUIBase-0.7.7","CEGUIOgreRenderer-0.7.7"]) env.Alias('install', libpath) env.Install(libpath, "libhg3dcegui040.so") diff --git a/Bindings/CEGUI/cBuild/include/ClassDragContainer.h b/Bindings/CEGUI/cBuild/include/ClassDragContainer.h index 4cb0508..5d58f7e 100644 --- a/Bindings/CEGUI/cBuild/include/ClassDragContainer.h +++ b/Bindings/CEGUI/cBuild/include/ClassDragContainer.h @@ -26,6 +26,7 @@ #include "ClassPtr.h" #include "ClassWindow.h" +#include "ClassUVector2.h" // Constructor for DragContainer @@ -70,6 +71,12 @@ void cegui_drgcnt_setStickyModeEnabled(struct hg3dclass_struct * thisclass_c, in // Immediately pick up the DragContainer void cegui_drgcnt_pickUp(struct hg3dclass_struct * thisclass_c, const int force_sticky_c, int * result_c); +// Set the fixed mouse cursor dragging offset to be used for this DragContainer +void cegui_drgcnt_setFixedDragOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * offset_c); + +// Return the fixed mouse cursor dragging offset to be used for this DragContainer +void cegui_drgcnt_getFixedDragOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + // Set whether the fixed dragging offset - as set with the setFixedDragOffset - function will be used, or whether the built-in positioning will be used. void cegui_drgcnt_setUsingFixedDragOffset(struct hg3dclass_struct * thisclass_c, const int enable_c); diff --git a/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h b/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h index 08ddf14..ecc4cff 100644 --- a/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h @@ -37,6 +37,8 @@ #include "ClassSlider.h" #include "ClassSpinner.h" #include "ClassMultiColumnList.h" +#include "ClassUDim.h" +#include "ClassUVector2.h" // @@ -72,4 +74,22 @@ void cegui_hg3dwsfs_castWindowToSpinner(struct hg3dclass_struct * window_c, stru // void cegui_hg3dwsfs_castWindowToMultiColumnList(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); +// +void cegui_hg3dwsfs_udScale(struct hg3dclass_struct * ud_c, float * result_c); + +// +void cegui_hg3dwsfs_udOffset(struct hg3dclass_struct * ud_c, float * result_c); + +// +void cegui_hg3dwsfs_v2X(struct hg3dclass_struct * uv2_c, struct hg3dclass_struct * result_c); + +// +void cegui_hg3dwsfs_v2Y(struct hg3dclass_struct * uv2_c, struct hg3dclass_struct * result_c); + +// +void cegui_hg3dwsfs_getWindowWidth(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); + +// +void cegui_hg3dwsfs_getWindowHeight(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); + #endif diff --git a/Bindings/CEGUI/cBuild/include/ClassListHeader.h b/Bindings/CEGUI/cBuild/include/ClassListHeader.h index 430e95e..87a2ea7 100644 --- a/Bindings/CEGUI/cBuild/include/ClassListHeader.h +++ b/Bindings/CEGUI/cBuild/include/ClassListHeader.h @@ -27,6 +27,7 @@ #include "ClassPtr.h" #include "ClassListHeaderSegment.h" #include "EnumSortDirection.h" +#include "ClassUDim.h" // Return the number of columns or segments attached to the header. @@ -98,6 +99,15 @@ void cegui_lsthdr_setColumnSizingEnabled(struct hg3dclass_struct * thisclass_c, // Set whether columns may be reordered by the user via drag and drop. void cegui_lsthdr_setColumnDraggingEnabled(struct hg3dclass_struct * thisclass_c, int setting_c); +// Add a new column segment to the end of the header. +void cegui_lsthdr_addColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c); + +// Insert a new column segment at the specified position. +void cegui_lsthdr_insertColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c, unsigned int position_c); + +// Insert a new column segment at the specified position. +void cegui_lsthdr_insertColumn2(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c, struct hg3dclass_struct * position_c); + // Removes a column segment from the ListHeader void cegui_lsthdr_removeColumn(struct hg3dclass_struct * thisclass_c, unsigned int column_c); @@ -119,6 +129,9 @@ void cegui_lsthdr_moveSegment2(struct hg3dclass_struct * thisclass_c, struct hg3 // Set the current base segment offset. (This implements scrolling of the header segments within the header area). void cegui_lsthdr_setSegmentOffset(struct hg3dclass_struct * thisclass_c, float offset_c); +// Set the width of the specified column. +void cegui_lsthdr_setColumnWidth(struct hg3dclass_struct * thisclass_c, unsigned int column_c, struct hg3dclass_struct * width_c); + // Constructor for the list header base class. void cegui_lsthdr_construct(char * type_c, char * name_c, struct hg3dclass_struct * result_c); diff --git a/Bindings/CEGUI/cBuild/include/ClassMenuItem.h b/Bindings/CEGUI/cBuild/include/ClassMenuItem.h index ab377f1..9586843 100644 --- a/Bindings/CEGUI/cBuild/include/ClassMenuItem.h +++ b/Bindings/CEGUI/cBuild/include/ClassMenuItem.h @@ -25,6 +25,7 @@ #define _DEFINED_HG3D_ClassMenuItem #include "ClassPtr.h" +#include "ClassUVector2.h" // return true if user is hovering over this widget (or it's pushed and user is not over it for highlight) @@ -48,6 +49,12 @@ void cegui_mnitm_getAutoPopupTimeout(struct hg3dclass_struct * thisclass_c, floa // Sets the time, which has to elapse before the popup window is opened/closed if the hovering state changes. void cegui_mnitm_setAutoPopupTimeout(struct hg3dclass_struct * thisclass_c, float time_c); +// Returns the current offset for popup placement. +void cegui_mnitm_getPopupOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// sets the current offset for popup placement. +void cegui_mnitm_setPopupOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * popupOffset_c); + // Opens the PopupMenu. void cegui_mnitm_openPopupMenu(struct hg3dclass_struct * thisclass_c, int notify_c); diff --git a/Bindings/CEGUI/cBuild/include/ClassMultiColumnList.h b/Bindings/CEGUI/cBuild/include/ClassMultiColumnList.h index 6a075de..d3145fb 100644 --- a/Bindings/CEGUI/cBuild/include/ClassMultiColumnList.h +++ b/Bindings/CEGUI/cBuild/include/ClassMultiColumnList.h @@ -31,6 +31,7 @@ #include "EnumSelectionMode.h" #include "ClassScrollbar.h" #include "ClassListHeader.h" +#include "ClassUDim.h" // Return whether user manipulation of the sort column and direction are enabled. @@ -147,6 +148,12 @@ void cegui_mltclmlst_initialiseComponents(struct hg3dclass_struct * thisclass_c) // Remove all items from the list. void cegui_mltclmlst_resetList(struct hg3dclass_struct * thisclass_c); +// Add a column to the list box. +void cegui_mltclmlst_addColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int col_id_c, struct hg3dclass_struct * width_c); + +// Insert a new column in the list. +void cegui_mltclmlst_insertColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int col_id_c, struct hg3dclass_struct * width_c, unsigned int position_c); + // Removes a column from the list box. This will cause any ListboxItem void cegui_mltclmlst_removeColumn(struct hg3dclass_struct * thisclass_c, unsigned int col_idx_c); @@ -213,6 +220,9 @@ void cegui_mltclmlst_setItemSelectState(struct hg3dclass_struct * thisclass_c, s // Inform the list box that one or more attached ListboxItems have been externally modified, and the list should re-sync its internal state and refresh the display as needed. void cegui_mltclmlst_handleUpdatedItemData(struct hg3dclass_struct * thisclass_c); +// Set the width of the specified column header (and therefore the column itself). +void cegui_mltclmlst_setColumnHeaderWidth(struct hg3dclass_struct * thisclass_c, unsigned int col_idx_c, struct hg3dclass_struct * width_c); + // Set whether user manipulation of the sort column and direction are enabled. void cegui_mltclmlst_setUserSortControlEnabled(struct hg3dclass_struct * thisclass_c, int setting_c); diff --git a/Bindings/CEGUI/cBuild/include/ClassPtr.h b/Bindings/CEGUI/cBuild/include/ClassPtr.h index 29389c5..04b3d70 100644 --- a/Bindings/CEGUI/cBuild/include/ClassPtr.h +++ b/Bindings/CEGUI/cBuild/include/ClassPtr.h @@ -182,6 +182,12 @@ hg3dclass_struct getHG3DClass_Tooltip(void *ptrIn); typedef void ClassTree; hg3dclass_struct getHG3DClass_Tree(void *ptrIn); +typedef void ClassUDim; +hg3dclass_struct getHG3DClass_UDim(void *ptrIn); + +typedef void ClassUVector2; +hg3dclass_struct getHG3DClass_UVector2(void *ptrIn); + typedef void ClassWidgetLookManager; hg3dclass_struct getHG3DClass_WidgetLookManager(void *ptrIn); diff --git a/Bindings/CEGUI/cBuild/include/ClassUDim.h b/Bindings/CEGUI/cBuild/include/ClassUDim.h new file mode 100644 index 0000000..024f7ea --- /dev/null +++ b/Bindings/CEGUI/cBuild/include/ClassUDim.h @@ -0,0 +1,42 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// ClassUDim.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_ClassUDim +#define _DEFINED_HG3D_ClassUDim + +#include "ClassPtr.h" + + +// +void cegui_udim_construct(float scale_c, float offset_c, struct hg3dclass_struct * result_c); + +// +void cegui_udim_destruct(struct hg3dclass_struct * thisclass_c); + +// +void cegui_udim_asAbsolute(struct hg3dclass_struct * thisclass_c, float base_c, float * result_c); + +// +void cegui_udim_asRelative(struct hg3dclass_struct * thisclass_c, float base_c, float * result_c); + +#endif diff --git a/Bindings/CEGUI/cBuild/include/ClassUVector2.h b/Bindings/CEGUI/cBuild/include/ClassUVector2.h new file mode 100644 index 0000000..c10f9c6 --- /dev/null +++ b/Bindings/CEGUI/cBuild/include/ClassUVector2.h @@ -0,0 +1,37 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// ClassUVector2.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_ClassUVector2 +#define _DEFINED_HG3D_ClassUVector2 + +#include "ClassPtr.h" +#include "ClassUDim.h" + + +// +void cegui_uv2_construct(struct hg3dclass_struct * x_c, struct hg3dclass_struct * y_c, struct hg3dclass_struct * result_c); + +// +void cegui_uv2_destruct(struct hg3dclass_struct * thisclass_c); + +#endif diff --git a/Bindings/CEGUI/cBuild/include/ClassWindow.h b/Bindings/CEGUI/cBuild/include/ClassWindow.h index bed6ac8..2eda730 100644 --- a/Bindings/CEGUI/cBuild/include/ClassWindow.h +++ b/Bindings/CEGUI/cBuild/include/ClassWindow.h @@ -30,6 +30,8 @@ #include "EnumVerticalAlignment.h" #include "EnumHorizontalAlignment.h" #include "ClassDragContainer.h" +#include "ClassUDim.h" +#include "ClassUVector2.h" #include "EnumWindowUpdateMode.h" @@ -396,6 +398,51 @@ void cegui_wnd_performChildWindowLayout(struct hg3dclass_struct * thisclass_c); // Sets the value a named user string, creating it as required. void cegui_wnd_setUserString(struct hg3dclass_struct * thisclass_c, char * name_c, char * value_c); +// Set the window area. +void cegui_wnd_setArea(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * xpos_c, struct hg3dclass_struct * ypos_c, struct hg3dclass_struct * width_c, struct hg3dclass_struct * height_c); + +// Set the window area. +void cegui_wnd_setArea2(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * pos_c, struct hg3dclass_struct * size_c); + +// Set the window's position. +void cegui_wnd_setPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * pos_c); + +// Set the window's X position. +void cegui_wnd_setXPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * x_c); + +// Set the window's Y position. +void cegui_wnd_setYPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * y_c); + +// Set the window's size. +void cegui_wnd_setSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c); + +// Set the window's width. +void cegui_wnd_setWidth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * width_c); + +// Set the window's height. +void cegui_wnd_setHeight(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * height_c); + +// Set the window's maximum size. +void cegui_wnd_setMaxSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c); + +// Set the window's minimum size. +void cegui_wnd_setMinSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c); + +// Get the window's position. +void cegui_wnd_getPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// Get the window's X position. +void cegui_wnd_getXPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// Get the window's Y position. +void cegui_wnd_getYPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// Get the window's maximum size. +void cegui_wnd_getMaxSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// Get the window's minimum size. +void cegui_wnd_getMinSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + // Causes the Window void cegui_wnd_render(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h b/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h index 009b715..9143643 100644 --- a/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h @@ -40,5 +40,14 @@ class HG3DWindowStaticFunctions static CEGUI::Slider* castWindowToSlider(CEGUI::Window * window); static CEGUI::Spinner* castWindowToSpinner(CEGUI::Window * window); static CEGUI::MultiColumnList* castWindowToMultiColumnList(CEGUI::Window * window); + + // utility functions for UDims and UVectors + static float udScale( const CEGUI::UDim* ud); + static float udOffset( const CEGUI::UDim* ud); + static CEGUI::UDim* v2X( const CEGUI::UVector2* uv2); + static CEGUI::UDim* v2Y( const CEGUI::UVector2* uv2); + + static CEGUI::UDim* getWindowWidth(const CEGUI::Window* window); + static CEGUI::UDim* getWindowHeight(const CEGUI::Window* window); }; diff --git a/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal b/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal index 3af3a66..5f4ff83 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal +++ b/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal @@ -16,12 +16,12 @@ Build-Type: Simple Cabal-Version: >=1.4 Homepage: http://www.hgamer3d.org Category: Game Engine, GUI -Extra-source-files: Setup.hs, include/colorvalue_struct.h, include/StructHG3DClass.h, include/ClassThumb.h, include/EnumTabPanePosition.h, include/hg3dstruct.h, include/vector4_struct.h, include/HG3DCommandHandler.h, include/ClassListboxItem.h, include/ClassEditbox.h, include/ClassSchemeManager.h, include/ClassSpinner.h, include/ClassItemListbox.h, include/EnumQuadSplitMode.h, include/ClassMultiLineEditbox.h, include/ClassMenuItem.h, include/radian_struct.h, include/ClassListHeaderSegment.h, include/ClassTree.h, include/ClassHG3DEventController.h, include/CEGUIDllDefines.h, include/ClassSlider.h, include/ClassListbox.h, include/SystemHG3D.h, include/ClassMultiColumnList.h, include/HG3DEventStaticFunctions.h, include/HG3DListboxStaticFunctions.h, include/ClassScrollablePane.h, include/vector2_struct.h, include/EnumTipState.h, include/ClassFont.h, include/ClassWindowManagerHG3D.h, include/ClassScheme.h, include/EnumSelectionMode.h, include/ClassFrameWindow.h, include/ClassWindowManager.h, include/ClassHG3DListboxStaticFunctions.h, include/sharedptr_struct.h, include/ClassHG3DEventStaticFunctions.h, include/HG3DEventController.h, include/ClassTabButton.h, include/ClassPushButton.h, include/ClassFontManager.h, include/EnumMouseButton.h, include/EnumWindowUpdateMode.h, include/ClassScrollbar.h, include/EnumFWSizingLocation.h, include/ClassDefaultResourceProvider.h, include/ClassItemEntry.h, include/EnumBlendMode.h, include/ClassPtr.h, include/ClassScrolledContainer.h, include/ClassDragContainer.h, include/ClassListboxTextItem.h, include/EnumSystemKey.h, include/ClassRadioButton.h, include/ClassXMLParser.h, include/ClassComboDropList.h, include/quaternion_struct.h, include/ClassScriptModule.h, include/ClassWindow.h, include/EnumHorizontalAlignment.h, include/EnumLoggingLevel.h, include/ClassEventSet.h, include/ClassRenderer.h, include/ClassOgreResourceProvider.h, include/ClassLogger.h, include/ClassResourceProvider.h, include/ClassImageCodec.h, include/vector3_struct.h, include/ClassScrolledItemListBase.h, include/ClassEventArgs.h, include/ClassPropertySet.h, include/EnumSortDirection.h, include/EnumKeyScan.h, include/EnumVerticalAlignment.h, include/ClassImageset.h, include/ClassProgressBar.h, include/ClassSystem.h, include/ClassDefaultLogger.h, include/ClassSystemHG3D.h, include/WindowManagerHG3D.h, include/HG3DEventModule.h, include/ClassMenuBase.h, include/ClassCheckbox.h, include/ClassCombobox.h, include/degree_struct.h, include/ClassWidgetLookManager.h, include/ClassListHeader.h, include/ClassTooltip.h, include/ClassOgreRenderer.h, include/EnumTextInputMode.h, include/ClassScriptFunctor.h, include/ClassHG3DWindowStaticFunctions.h, include/HG3DWindowStaticFunctions.h +Extra-source-files: Setup.hs, include/colorvalue_struct.h, include/StructHG3DClass.h, include/ClassThumb.h, include/EnumTabPanePosition.h, include/ClassUDim.h, include/hg3dstruct.h, include/vector4_struct.h, include/HG3DCommandHandler.h, include/ClassListboxItem.h, include/ClassEditbox.h, include/ClassSchemeManager.h, include/ClassSpinner.h, include/ClassItemListbox.h, include/EnumQuadSplitMode.h, include/ClassMultiLineEditbox.h, include/ClassMenuItem.h, include/radian_struct.h, include/ClassListHeaderSegment.h, include/ClassTree.h, include/ClassHG3DEventController.h, include/CEGUIDllDefines.h, include/ClassSlider.h, include/ClassListbox.h, include/SystemHG3D.h, include/ClassMultiColumnList.h, include/HG3DEventStaticFunctions.h, include/HG3DListboxStaticFunctions.h, include/ClassScrollablePane.h, include/ClassUVector2.h, include/vector2_struct.h, include/EnumTipState.h, include/ClassFont.h, include/ClassWindowManagerHG3D.h, include/ClassScheme.h, include/EnumSelectionMode.h, include/ClassFrameWindow.h, include/ClassWindowManager.h, include/ClassHG3DListboxStaticFunctions.h, include/sharedptr_struct.h, include/ClassHG3DEventStaticFunctions.h, include/HG3DEventController.h, include/ClassTabButton.h, include/ClassPushButton.h, include/ClassFontManager.h, include/EnumMouseButton.h, include/EnumWindowUpdateMode.h, include/ClassScrollbar.h, include/EnumFWSizingLocation.h, include/ClassDefaultResourceProvider.h, include/ClassItemEntry.h, include/EnumBlendMode.h, include/ClassPtr.h, include/ClassScrolledContainer.h, include/ClassDragContainer.h, include/ClassListboxTextItem.h, include/EnumSystemKey.h, include/ClassRadioButton.h, include/ClassXMLParser.h, include/ClassComboDropList.h, include/quaternion_struct.h, include/ClassScriptModule.h, include/ClassWindow.h, include/EnumHorizontalAlignment.h, include/EnumLoggingLevel.h, include/ClassEventSet.h, include/ClassRenderer.h, include/ClassOgreResourceProvider.h, include/ClassLogger.h, include/ClassResourceProvider.h, include/ClassImageCodec.h, include/vector3_struct.h, include/ClassScrolledItemListBase.h, include/ClassEventArgs.h, include/ClassPropertySet.h, include/EnumSortDirection.h, include/EnumKeyScan.h, include/EnumVerticalAlignment.h, include/ClassImageset.h, include/ClassProgressBar.h, include/ClassSystem.h, include/ClassDefaultLogger.h, include/ClassSystemHG3D.h, include/WindowManagerHG3D.h, include/HG3DEventModule.h, include/ClassMenuBase.h, include/ClassCheckbox.h, include/ClassCombobox.h, include/degree_struct.h, include/ClassWidgetLookManager.h, include/ClassListHeader.h, include/ClassTooltip.h, include/ClassOgreRenderer.h, include/EnumTextInputMode.h, include/ClassScriptFunctor.h, include/ClassHG3DWindowStaticFunctions.h, include/HG3DWindowStaticFunctions.h Library Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Bindings.CEGUI.Utils, HGamer3D.Bindings.CEGUI.StructHG3DClass, HGamer3D.Bindings.CEGUI.ClassPtr, HGamer3D.Bindings.CEGUI.EnumTextInputMode, HGamer3D.Bindings.CEGUI.EnumLoggingLevel, HGamer3D.Bindings.CEGUI.EnumWindowUpdateMode, HGamer3D.Bindings.CEGUI.EnumMouseButton, HGamer3D.Bindings.CEGUI.EnumTipState, HGamer3D.Bindings.CEGUI.EnumQuadSplitMode, HGamer3D.Bindings.CEGUI.EnumHorizontalAlignment, HGamer3D.Bindings.CEGUI.EnumKeyScan, HGamer3D.Bindings.CEGUI.EnumSelectionMode, HGamer3D.Bindings.CEGUI.EnumVerticalAlignment, HGamer3D.Bindings.CEGUI.EnumSortDirection, HGamer3D.Bindings.CEGUI.EnumTabPanePosition, HGamer3D.Bindings.CEGUI.EnumBlendMode, HGamer3D.Bindings.CEGUI.EnumFWSizingLocation, HGamer3D.Bindings.CEGUI.EnumSystemKey, HGamer3D.Bindings.CEGUI.ClassScrolledContainer, HGamer3D.Bindings.CEGUI.ClassSystem, HGamer3D.Bindings.CEGUI.ClassPushButton, HGamer3D.Bindings.CEGUI.ClassScheme, HGamer3D.Bindings.CEGUI.ClassWindowManager, HGamer3D.Bindings.CEGUI.ClassRadioButton, HGamer3D.Bindings.CEGUI.ClassMenuBase, HGamer3D.Bindings.CEGUI.ClassCombobox, HGamer3D.Bindings.CEGUI.ClassThumb, HGamer3D.Bindings.CEGUI.ClassSchemeManager, HGamer3D.Bindings.CEGUI.ClassEventArgs, HGamer3D.Bindings.CEGUI.ClassComboDropList, HGamer3D.Bindings.CEGUI.ClassImageset, HGamer3D.Bindings.CEGUI.ClassScriptFunctor, HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D, HGamer3D.Bindings.CEGUI.ClassScrollbar, HGamer3D.Bindings.CEGUI.ClassTree, HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions, HGamer3D.Bindings.CEGUI.ClassListHeaderSegment, HGamer3D.Bindings.CEGUI.ClassItemListbox, HGamer3D.Bindings.CEGUI.ClassCheckbox, HGamer3D.Bindings.CEGUI.ClassOgreResourceProvider, HGamer3D.Bindings.CEGUI.ClassHG3DEventController, HGamer3D.Bindings.CEGUI.ClassScrollablePane, HGamer3D.Bindings.CEGUI.ClassTooltip, HGamer3D.Bindings.CEGUI.ClassResourceProvider, HGamer3D.Bindings.CEGUI.ClassLogger, HGamer3D.Bindings.CEGUI.ClassListHeader, HGamer3D.Bindings.CEGUI.ClassPropertySet, HGamer3D.Bindings.CEGUI.ClassEventSet, HGamer3D.Bindings.CEGUI.ClassMultiColumnList, HGamer3D.Bindings.CEGUI.ClassFrameWindow, HGamer3D.Bindings.CEGUI.ClassOgreRenderer, HGamer3D.Bindings.CEGUI.ClassFont, HGamer3D.Bindings.CEGUI.ClassFontManager, HGamer3D.Bindings.CEGUI.ClassImageCodec, HGamer3D.Bindings.CEGUI.ClassDefaultResourceProvider, HGamer3D.Bindings.CEGUI.ClassWidgetLookManager, HGamer3D.Bindings.CEGUI.ClassScriptModule, HGamer3D.Bindings.CEGUI.ClassItemEntry, HGamer3D.Bindings.CEGUI.ClassRenderer, HGamer3D.Bindings.CEGUI.ClassTabButton, HGamer3D.Bindings.CEGUI.ClassMenuItem, HGamer3D.Bindings.CEGUI.ClassScrolledItemListBase, HGamer3D.Bindings.CEGUI.ClassDefaultLogger, HGamer3D.Bindings.CEGUI.ClassEditbox, HGamer3D.Bindings.CEGUI.ClassProgressBar, HGamer3D.Bindings.CEGUI.ClassMultiLineEditbox, HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions, HGamer3D.Bindings.CEGUI.ClassListboxTextItem, HGamer3D.Bindings.CEGUI.ClassSystemHG3D, HGamer3D.Bindings.CEGUI.ClassSlider, HGamer3D.Bindings.CEGUI.ClassDragContainer, HGamer3D.Bindings.CEGUI.ClassListboxItem, HGamer3D.Bindings.CEGUI.ClassXMLParser, HGamer3D.Bindings.CEGUI.ClassSpinner, HGamer3D.Bindings.CEGUI.ClassHG3DListboxStaticFunctions, HGamer3D.Bindings.CEGUI.ClassWindow, HGamer3D.Bindings.CEGUI.ClassListbox + Exposed-modules: HGamer3D.Bindings.CEGUI.Utils, HGamer3D.Bindings.CEGUI.StructHG3DClass, HGamer3D.Bindings.CEGUI.ClassPtr, HGamer3D.Bindings.CEGUI.EnumTextInputMode, HGamer3D.Bindings.CEGUI.EnumLoggingLevel, HGamer3D.Bindings.CEGUI.EnumWindowUpdateMode, HGamer3D.Bindings.CEGUI.EnumMouseButton, HGamer3D.Bindings.CEGUI.EnumTipState, HGamer3D.Bindings.CEGUI.EnumQuadSplitMode, HGamer3D.Bindings.CEGUI.EnumHorizontalAlignment, HGamer3D.Bindings.CEGUI.EnumKeyScan, HGamer3D.Bindings.CEGUI.EnumSelectionMode, HGamer3D.Bindings.CEGUI.EnumVerticalAlignment, HGamer3D.Bindings.CEGUI.EnumSortDirection, HGamer3D.Bindings.CEGUI.EnumTabPanePosition, HGamer3D.Bindings.CEGUI.EnumBlendMode, HGamer3D.Bindings.CEGUI.EnumFWSizingLocation, HGamer3D.Bindings.CEGUI.EnumSystemKey, HGamer3D.Bindings.CEGUI.ClassScrolledContainer, HGamer3D.Bindings.CEGUI.ClassSystem, HGamer3D.Bindings.CEGUI.ClassPushButton, HGamer3D.Bindings.CEGUI.ClassScheme, HGamer3D.Bindings.CEGUI.ClassWindowManager, HGamer3D.Bindings.CEGUI.ClassRadioButton, HGamer3D.Bindings.CEGUI.ClassMenuBase, HGamer3D.Bindings.CEGUI.ClassCombobox, HGamer3D.Bindings.CEGUI.ClassThumb, HGamer3D.Bindings.CEGUI.ClassSchemeManager, HGamer3D.Bindings.CEGUI.ClassEventArgs, HGamer3D.Bindings.CEGUI.ClassComboDropList, HGamer3D.Bindings.CEGUI.ClassImageset, HGamer3D.Bindings.CEGUI.ClassScriptFunctor, HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D, HGamer3D.Bindings.CEGUI.ClassScrollbar, HGamer3D.Bindings.CEGUI.ClassTree, HGamer3D.Bindings.CEGUI.ClassUDim, HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions, HGamer3D.Bindings.CEGUI.ClassListHeaderSegment, HGamer3D.Bindings.CEGUI.ClassUVector2, HGamer3D.Bindings.CEGUI.ClassItemListbox, HGamer3D.Bindings.CEGUI.ClassCheckbox, HGamer3D.Bindings.CEGUI.ClassOgreResourceProvider, HGamer3D.Bindings.CEGUI.ClassHG3DEventController, HGamer3D.Bindings.CEGUI.ClassScrollablePane, HGamer3D.Bindings.CEGUI.ClassTooltip, HGamer3D.Bindings.CEGUI.ClassResourceProvider, HGamer3D.Bindings.CEGUI.ClassLogger, HGamer3D.Bindings.CEGUI.ClassListHeader, HGamer3D.Bindings.CEGUI.ClassPropertySet, HGamer3D.Bindings.CEGUI.ClassEventSet, HGamer3D.Bindings.CEGUI.ClassMultiColumnList, HGamer3D.Bindings.CEGUI.ClassFrameWindow, HGamer3D.Bindings.CEGUI.ClassOgreRenderer, HGamer3D.Bindings.CEGUI.ClassFont, HGamer3D.Bindings.CEGUI.ClassFontManager, HGamer3D.Bindings.CEGUI.ClassImageCodec, HGamer3D.Bindings.CEGUI.ClassDefaultResourceProvider, HGamer3D.Bindings.CEGUI.ClassWidgetLookManager, HGamer3D.Bindings.CEGUI.ClassScriptModule, HGamer3D.Bindings.CEGUI.ClassItemEntry, HGamer3D.Bindings.CEGUI.ClassRenderer, HGamer3D.Bindings.CEGUI.ClassTabButton, HGamer3D.Bindings.CEGUI.ClassMenuItem, HGamer3D.Bindings.CEGUI.ClassScrolledItemListBase, HGamer3D.Bindings.CEGUI.ClassDefaultLogger, HGamer3D.Bindings.CEGUI.ClassEditbox, HGamer3D.Bindings.CEGUI.ClassProgressBar, HGamer3D.Bindings.CEGUI.ClassMultiLineEditbox, HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions, HGamer3D.Bindings.CEGUI.ClassListboxTextItem, HGamer3D.Bindings.CEGUI.ClassSystemHG3D, HGamer3D.Bindings.CEGUI.ClassSlider, HGamer3D.Bindings.CEGUI.ClassDragContainer, HGamer3D.Bindings.CEGUI.ClassListboxItem, HGamer3D.Bindings.CEGUI.ClassXMLParser, HGamer3D.Bindings.CEGUI.ClassSpinner, HGamer3D.Bindings.CEGUI.ClassHG3DListboxStaticFunctions, HGamer3D.Bindings.CEGUI.ClassWindow, HGamer3D.Bindings.CEGUI.ClassListbox Other-modules: ghc-options: diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassDragContainer.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassDragContainer.chs index 664af28..f779c00 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassDragContainer.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassDragContainer.chs @@ -113,6 +113,16 @@ import HGamer3D.Data.Angle fromBool `Bool' , alloca- `Bool' peekBoolUtil*} -> `()' #} +{- function setFixedDragOffset -} +{#fun cegui_drgcnt_setFixedDragOffset as setFixedDragOffset +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function getFixedDragOffset -} +{#fun cegui_drgcnt_getFixedDragOffset as getFixedDragOffset +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + {- function setUsingFixedDragOffset -} {#fun cegui_drgcnt_setUsingFixedDragOffset as setUsingFixedDragOffset { withHG3DClass* `HG3DClass' , diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs index 2b573b5..ecad584 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs @@ -96,3 +96,33 @@ import HGamer3D.Data.Angle { withHG3DClass* `HG3DClass' , alloca- `HG3DClass' peek*} -> `()' #} +{- function udScale -} +{#fun cegui_hg3dwsfs_udScale as udScale +{ withHG3DClass* `HG3DClass' , + alloca- `Float' peekFloatConv*} -> `()' #} + +{- function udOffset -} +{#fun cegui_hg3dwsfs_udOffset as udOffset +{ withHG3DClass* `HG3DClass' , + alloca- `Float' peekFloatConv*} -> `()' #} + +{- function v2X -} +{#fun cegui_hg3dwsfs_v2X as v2X +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function v2Y -} +{#fun cegui_hg3dwsfs_v2Y as v2Y +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function getWindowWidth -} +{#fun cegui_hg3dwsfs_getWindowWidth as getWindowWidth +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function getWindowHeight -} +{#fun cegui_hg3dwsfs_getWindowHeight as getWindowHeight +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassListHeader.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassListHeader.chs index bbb0d60..e80cbd1 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassListHeader.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassListHeader.chs @@ -164,6 +164,29 @@ import HGamer3D.Data.Angle { withHG3DClass* `HG3DClass' , fromBool `Bool' } -> `()' #} +{- function addColumn -} +{#fun cegui_lsthdr_addColumn as addColumn +{ withHG3DClass* `HG3DClass' , + withCString* `String' , + fromIntegral `Int' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function insertColumn -} +{#fun cegui_lsthdr_insertColumn as insertColumn +{ withHG3DClass* `HG3DClass' , + withCString* `String' , + fromIntegral `Int' , + withHG3DClass* `HG3DClass' , + fromIntegral `Int' } -> `()' #} + +{- function insertColumn2 -} +{#fun cegui_lsthdr_insertColumn2 as insertColumn2 +{ withHG3DClass* `HG3DClass' , + withCString* `String' , + fromIntegral `Int' , + withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + {- function removeColumn -} {#fun cegui_lsthdr_removeColumn as removeColumn { withHG3DClass* `HG3DClass' , @@ -203,6 +226,12 @@ import HGamer3D.Data.Angle { withHG3DClass* `HG3DClass' , realToFrac `Float' } -> `()' #} +{- function setColumnWidth -} +{#fun cegui_lsthdr_setColumnWidth as setColumnWidth +{ withHG3DClass* `HG3DClass' , + fromIntegral `Int' , + withHG3DClass* `HG3DClass' } -> `()' #} + {- function ListHeader -} {#fun cegui_lsthdr_construct as new { withCString* `String' , diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassMenuItem.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassMenuItem.chs index a7d7e71..f110ba7 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassMenuItem.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassMenuItem.chs @@ -76,6 +76,16 @@ import HGamer3D.Data.Angle { withHG3DClass* `HG3DClass' , realToFrac `Float' } -> `()' #} +{- function getPopupOffset -} +{#fun cegui_mnitm_getPopupOffset as getPopupOffset +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function setPopupOffset -} +{#fun cegui_mnitm_setPopupOffset as setPopupOffset +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + {- function openPopupMenu -} {#fun cegui_mnitm_openPopupMenu as openPopupMenu { withHG3DClass* `HG3DClass' , diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassMultiColumnList.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassMultiColumnList.chs index 2699715..847c08b 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassMultiColumnList.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassMultiColumnList.chs @@ -255,6 +255,21 @@ import HGamer3D.Data.Angle {#fun cegui_mltclmlst_resetList as resetList { withHG3DClass* `HG3DClass' } -> `()' #} +{- function addColumn -} +{#fun cegui_mltclmlst_addColumn as addColumn +{ withHG3DClass* `HG3DClass' , + withCString* `String' , + fromIntegral `Int' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function insertColumn -} +{#fun cegui_mltclmlst_insertColumn as insertColumn +{ withHG3DClass* `HG3DClass' , + withCString* `String' , + fromIntegral `Int' , + withHG3DClass* `HG3DClass' , + fromIntegral `Int' } -> `()' #} + {- function removeColumn -} {#fun cegui_mltclmlst_removeColumn as removeColumn { withHG3DClass* `HG3DClass' , @@ -378,6 +393,12 @@ import HGamer3D.Data.Angle {#fun cegui_mltclmlst_handleUpdatedItemData as handleUpdatedItemData { withHG3DClass* `HG3DClass' } -> `()' #} +{- function setColumnHeaderWidth -} +{#fun cegui_mltclmlst_setColumnHeaderWidth as setColumnHeaderWidth +{ withHG3DClass* `HG3DClass' , + fromIntegral `Int' , + withHG3DClass* `HG3DClass' } -> `()' #} + {- function setUserSortControlEnabled -} {#fun cegui_mltclmlst_setUserSortControlEnabled as setUserSortControlEnabled { withHG3DClass* `HG3DClass' , diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassPtr.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassPtr.chs index 5327d16..e9bee69 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassPtr.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassPtr.chs @@ -138,6 +138,10 @@ import HGamer3D.Data.Angle {#pointer *ClassTooltip as ClassTooltip#} {- class ClassTree -} {#pointer *ClassTree as ClassTree#} +{- class ClassUDim -} +{#pointer *ClassUDim as ClassUDim#} +{- class ClassUVector2 -} +{#pointer *ClassUVector2 as ClassUVector2#} {- class ClassWidgetLookManager -} {#pointer *ClassWidgetLookManager as ClassWidgetLookManager#} {- class ClassWindow -} diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassUDim.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassUDim.chs new file mode 100644 index 0000000..9b33660 --- /dev/null +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassUDim.chs @@ -0,0 +1,65 @@ +{-# LANGUAGE ForeignFunctionInterface #-} +{-# LANGUAGE TypeSynonymInstances #-} + +-- This source file is part of HGamer3D, a project to enable 3D game development +-- in Haskell. For the latest info, see http://www.hgamer3d.org . +-- + +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + + +-- ClassUDim.chs + +-- + +module HGamer3D.Bindings.CEGUI.ClassUDim where + +import Foreign +import Foreign.Ptr +import Foreign.C + +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Vector +import HGamer3D.Data.Colour +import HGamer3D.Data.Angle + +{# import HGamer3D.Bindings.CEGUI.Utils #} +{# import HGamer3D.Bindings.CEGUI.ClassPtr #} +{# import HGamer3D.Bindings.CEGUI.StructHG3DClass #} + +#include "ClassUDim.h" +{- function UDim2 -} +{#fun cegui_udim_construct as new +{ realToFrac `Float' , + realToFrac `Float' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function ~UDim -} +{#fun cegui_udim_destruct as delete +{ withHG3DClass* `HG3DClass' } -> `()' #} + +{- function asAbsolute -} +{#fun cegui_udim_asAbsolute as asAbsolute +{ withHG3DClass* `HG3DClass' , + realToFrac `Float' , + alloca- `Float' peekFloatConv*} -> `()' #} + +{- function asRelative -} +{#fun cegui_udim_asRelative as asRelative +{ withHG3DClass* `HG3DClass' , + realToFrac `Float' , + alloca- `Float' peekFloatConv*} -> `()' #} + diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassUVector2.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassUVector2.chs new file mode 100644 index 0000000..44ab56a --- /dev/null +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassUVector2.chs @@ -0,0 +1,53 @@ +{-# LANGUAGE ForeignFunctionInterface #-} +{-# LANGUAGE TypeSynonymInstances #-} + +-- This source file is part of HGamer3D, a project to enable 3D game development +-- in Haskell. For the latest info, see http://www.hgamer3d.org . +-- + +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + + +-- ClassUVector2.chs + +-- + +module HGamer3D.Bindings.CEGUI.ClassUVector2 where + +import Foreign +import Foreign.Ptr +import Foreign.C + +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Vector +import HGamer3D.Data.Colour +import HGamer3D.Data.Angle + +{# import HGamer3D.Bindings.CEGUI.Utils #} +{# import HGamer3D.Bindings.CEGUI.ClassPtr #} +{# import HGamer3D.Bindings.CEGUI.StructHG3DClass #} + +#include "ClassUVector2.h" +{- function UVector22 -} +{#fun cegui_uv2_construct as new +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function ~UVector2 -} +{#fun cegui_uv2_destruct as delete +{ withHG3DClass* `HG3DClass' } -> `()' #} + diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassWindow.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassWindow.chs index 057352b..048e2f1 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassWindow.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassWindow.chs @@ -656,6 +656,85 @@ import HGamer3D.Data.Angle withCString* `String' , withCString* `String' } -> `()' #} +{- function setArea -} +{#fun cegui_wnd_setArea as setArea +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setArea2 -} +{#fun cegui_wnd_setArea2 as setArea2 +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setPosition -} +{#fun cegui_wnd_setPosition as setPosition +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setXPosition -} +{#fun cegui_wnd_setXPosition as setXPosition +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setYPosition -} +{#fun cegui_wnd_setYPosition as setYPosition +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setSize -} +{#fun cegui_wnd_setSize as setSize +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setWidth -} +{#fun cegui_wnd_setWidth as setWidth +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setHeight -} +{#fun cegui_wnd_setHeight as setHeight +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setMaxSize -} +{#fun cegui_wnd_setMaxSize as setMaxSize +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function setMinSize -} +{#fun cegui_wnd_setMinSize as setMinSize +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + +{- function getPosition -} +{#fun cegui_wnd_getPosition as getPosition +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function getXPosition -} +{#fun cegui_wnd_getXPosition as getXPosition +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function getYPosition -} +{#fun cegui_wnd_getYPosition as getYPosition +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function getMaxSize -} +{#fun cegui_wnd_getMaxSize as getMaxSize +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function getMinSize -} +{#fun cegui_wnd_getMinSize as getMinSize +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + {- function render -} {#fun cegui_wnd_render as render { withHG3DClass* `HG3DClass' } -> `()' #} diff --git a/Bindings/CEGUI/hBuild/include/ClassDragContainer.h b/Bindings/CEGUI/hBuild/include/ClassDragContainer.h index 4cb0508..5d58f7e 100644 --- a/Bindings/CEGUI/hBuild/include/ClassDragContainer.h +++ b/Bindings/CEGUI/hBuild/include/ClassDragContainer.h @@ -26,6 +26,7 @@ #include "ClassPtr.h" #include "ClassWindow.h" +#include "ClassUVector2.h" // Constructor for DragContainer @@ -70,6 +71,12 @@ void cegui_drgcnt_setStickyModeEnabled(struct hg3dclass_struct * thisclass_c, in // Immediately pick up the DragContainer void cegui_drgcnt_pickUp(struct hg3dclass_struct * thisclass_c, const int force_sticky_c, int * result_c); +// Set the fixed mouse cursor dragging offset to be used for this DragContainer +void cegui_drgcnt_setFixedDragOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * offset_c); + +// Return the fixed mouse cursor dragging offset to be used for this DragContainer +void cegui_drgcnt_getFixedDragOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + // Set whether the fixed dragging offset - as set with the setFixedDragOffset - function will be used, or whether the built-in positioning will be used. void cegui_drgcnt_setUsingFixedDragOffset(struct hg3dclass_struct * thisclass_c, const int enable_c); diff --git a/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h b/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h index 08ddf14..ecc4cff 100644 --- a/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h @@ -37,6 +37,8 @@ #include "ClassSlider.h" #include "ClassSpinner.h" #include "ClassMultiColumnList.h" +#include "ClassUDim.h" +#include "ClassUVector2.h" // @@ -72,4 +74,22 @@ void cegui_hg3dwsfs_castWindowToSpinner(struct hg3dclass_struct * window_c, stru // void cegui_hg3dwsfs_castWindowToMultiColumnList(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); +// +void cegui_hg3dwsfs_udScale(struct hg3dclass_struct * ud_c, float * result_c); + +// +void cegui_hg3dwsfs_udOffset(struct hg3dclass_struct * ud_c, float * result_c); + +// +void cegui_hg3dwsfs_v2X(struct hg3dclass_struct * uv2_c, struct hg3dclass_struct * result_c); + +// +void cegui_hg3dwsfs_v2Y(struct hg3dclass_struct * uv2_c, struct hg3dclass_struct * result_c); + +// +void cegui_hg3dwsfs_getWindowWidth(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); + +// +void cegui_hg3dwsfs_getWindowHeight(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); + #endif diff --git a/Bindings/CEGUI/hBuild/include/ClassListHeader.h b/Bindings/CEGUI/hBuild/include/ClassListHeader.h index 430e95e..87a2ea7 100644 --- a/Bindings/CEGUI/hBuild/include/ClassListHeader.h +++ b/Bindings/CEGUI/hBuild/include/ClassListHeader.h @@ -27,6 +27,7 @@ #include "ClassPtr.h" #include "ClassListHeaderSegment.h" #include "EnumSortDirection.h" +#include "ClassUDim.h" // Return the number of columns or segments attached to the header. @@ -98,6 +99,15 @@ void cegui_lsthdr_setColumnSizingEnabled(struct hg3dclass_struct * thisclass_c, // Set whether columns may be reordered by the user via drag and drop. void cegui_lsthdr_setColumnDraggingEnabled(struct hg3dclass_struct * thisclass_c, int setting_c); +// Add a new column segment to the end of the header. +void cegui_lsthdr_addColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c); + +// Insert a new column segment at the specified position. +void cegui_lsthdr_insertColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c, unsigned int position_c); + +// Insert a new column segment at the specified position. +void cegui_lsthdr_insertColumn2(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int id_c, struct hg3dclass_struct * width_c, struct hg3dclass_struct * position_c); + // Removes a column segment from the ListHeader void cegui_lsthdr_removeColumn(struct hg3dclass_struct * thisclass_c, unsigned int column_c); @@ -119,6 +129,9 @@ void cegui_lsthdr_moveSegment2(struct hg3dclass_struct * thisclass_c, struct hg3 // Set the current base segment offset. (This implements scrolling of the header segments within the header area). void cegui_lsthdr_setSegmentOffset(struct hg3dclass_struct * thisclass_c, float offset_c); +// Set the width of the specified column. +void cegui_lsthdr_setColumnWidth(struct hg3dclass_struct * thisclass_c, unsigned int column_c, struct hg3dclass_struct * width_c); + // Constructor for the list header base class. void cegui_lsthdr_construct(char * type_c, char * name_c, struct hg3dclass_struct * result_c); diff --git a/Bindings/CEGUI/hBuild/include/ClassMenuItem.h b/Bindings/CEGUI/hBuild/include/ClassMenuItem.h index ab377f1..9586843 100644 --- a/Bindings/CEGUI/hBuild/include/ClassMenuItem.h +++ b/Bindings/CEGUI/hBuild/include/ClassMenuItem.h @@ -25,6 +25,7 @@ #define _DEFINED_HG3D_ClassMenuItem #include "ClassPtr.h" +#include "ClassUVector2.h" // return true if user is hovering over this widget (or it's pushed and user is not over it for highlight) @@ -48,6 +49,12 @@ void cegui_mnitm_getAutoPopupTimeout(struct hg3dclass_struct * thisclass_c, floa // Sets the time, which has to elapse before the popup window is opened/closed if the hovering state changes. void cegui_mnitm_setAutoPopupTimeout(struct hg3dclass_struct * thisclass_c, float time_c); +// Returns the current offset for popup placement. +void cegui_mnitm_getPopupOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// sets the current offset for popup placement. +void cegui_mnitm_setPopupOffset(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * popupOffset_c); + // Opens the PopupMenu. void cegui_mnitm_openPopupMenu(struct hg3dclass_struct * thisclass_c, int notify_c); diff --git a/Bindings/CEGUI/hBuild/include/ClassMultiColumnList.h b/Bindings/CEGUI/hBuild/include/ClassMultiColumnList.h index 6a075de..d3145fb 100644 --- a/Bindings/CEGUI/hBuild/include/ClassMultiColumnList.h +++ b/Bindings/CEGUI/hBuild/include/ClassMultiColumnList.h @@ -31,6 +31,7 @@ #include "EnumSelectionMode.h" #include "ClassScrollbar.h" #include "ClassListHeader.h" +#include "ClassUDim.h" // Return whether user manipulation of the sort column and direction are enabled. @@ -147,6 +148,12 @@ void cegui_mltclmlst_initialiseComponents(struct hg3dclass_struct * thisclass_c) // Remove all items from the list. void cegui_mltclmlst_resetList(struct hg3dclass_struct * thisclass_c); +// Add a column to the list box. +void cegui_mltclmlst_addColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int col_id_c, struct hg3dclass_struct * width_c); + +// Insert a new column in the list. +void cegui_mltclmlst_insertColumn(struct hg3dclass_struct * thisclass_c, char * text_c, unsigned int col_id_c, struct hg3dclass_struct * width_c, unsigned int position_c); + // Removes a column from the list box. This will cause any ListboxItem void cegui_mltclmlst_removeColumn(struct hg3dclass_struct * thisclass_c, unsigned int col_idx_c); @@ -213,6 +220,9 @@ void cegui_mltclmlst_setItemSelectState(struct hg3dclass_struct * thisclass_c, s // Inform the list box that one or more attached ListboxItems have been externally modified, and the list should re-sync its internal state and refresh the display as needed. void cegui_mltclmlst_handleUpdatedItemData(struct hg3dclass_struct * thisclass_c); +// Set the width of the specified column header (and therefore the column itself). +void cegui_mltclmlst_setColumnHeaderWidth(struct hg3dclass_struct * thisclass_c, unsigned int col_idx_c, struct hg3dclass_struct * width_c); + // Set whether user manipulation of the sort column and direction are enabled. void cegui_mltclmlst_setUserSortControlEnabled(struct hg3dclass_struct * thisclass_c, int setting_c); diff --git a/Bindings/CEGUI/hBuild/include/ClassPtr.h b/Bindings/CEGUI/hBuild/include/ClassPtr.h index 29389c5..04b3d70 100644 --- a/Bindings/CEGUI/hBuild/include/ClassPtr.h +++ b/Bindings/CEGUI/hBuild/include/ClassPtr.h @@ -182,6 +182,12 @@ hg3dclass_struct getHG3DClass_Tooltip(void *ptrIn); typedef void ClassTree; hg3dclass_struct getHG3DClass_Tree(void *ptrIn); +typedef void ClassUDim; +hg3dclass_struct getHG3DClass_UDim(void *ptrIn); + +typedef void ClassUVector2; +hg3dclass_struct getHG3DClass_UVector2(void *ptrIn); + typedef void ClassWidgetLookManager; hg3dclass_struct getHG3DClass_WidgetLookManager(void *ptrIn); diff --git a/Bindings/CEGUI/hBuild/include/ClassUDim.h b/Bindings/CEGUI/hBuild/include/ClassUDim.h new file mode 100644 index 0000000..024f7ea --- /dev/null +++ b/Bindings/CEGUI/hBuild/include/ClassUDim.h @@ -0,0 +1,42 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// ClassUDim.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_ClassUDim +#define _DEFINED_HG3D_ClassUDim + +#include "ClassPtr.h" + + +// +void cegui_udim_construct(float scale_c, float offset_c, struct hg3dclass_struct * result_c); + +// +void cegui_udim_destruct(struct hg3dclass_struct * thisclass_c); + +// +void cegui_udim_asAbsolute(struct hg3dclass_struct * thisclass_c, float base_c, float * result_c); + +// +void cegui_udim_asRelative(struct hg3dclass_struct * thisclass_c, float base_c, float * result_c); + +#endif diff --git a/Bindings/CEGUI/hBuild/include/ClassUVector2.h b/Bindings/CEGUI/hBuild/include/ClassUVector2.h new file mode 100644 index 0000000..c10f9c6 --- /dev/null +++ b/Bindings/CEGUI/hBuild/include/ClassUVector2.h @@ -0,0 +1,37 @@ +// This source file is part of HGamer3D, a project to enable 3D game development +// in Haskell. For the latest info, see http://www.hgamer3d.org . +// +// (c) 2011-2014 Peter Althainz +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// ClassUVector2.h + +// + +#include "wchar.h" +#ifndef _DEFINED_HG3D_ClassUVector2 +#define _DEFINED_HG3D_ClassUVector2 + +#include "ClassPtr.h" +#include "ClassUDim.h" + + +// +void cegui_uv2_construct(struct hg3dclass_struct * x_c, struct hg3dclass_struct * y_c, struct hg3dclass_struct * result_c); + +// +void cegui_uv2_destruct(struct hg3dclass_struct * thisclass_c); + +#endif diff --git a/Bindings/CEGUI/hBuild/include/ClassWindow.h b/Bindings/CEGUI/hBuild/include/ClassWindow.h index bed6ac8..2eda730 100644 --- a/Bindings/CEGUI/hBuild/include/ClassWindow.h +++ b/Bindings/CEGUI/hBuild/include/ClassWindow.h @@ -30,6 +30,8 @@ #include "EnumVerticalAlignment.h" #include "EnumHorizontalAlignment.h" #include "ClassDragContainer.h" +#include "ClassUDim.h" +#include "ClassUVector2.h" #include "EnumWindowUpdateMode.h" @@ -396,6 +398,51 @@ void cegui_wnd_performChildWindowLayout(struct hg3dclass_struct * thisclass_c); // Sets the value a named user string, creating it as required. void cegui_wnd_setUserString(struct hg3dclass_struct * thisclass_c, char * name_c, char * value_c); +// Set the window area. +void cegui_wnd_setArea(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * xpos_c, struct hg3dclass_struct * ypos_c, struct hg3dclass_struct * width_c, struct hg3dclass_struct * height_c); + +// Set the window area. +void cegui_wnd_setArea2(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * pos_c, struct hg3dclass_struct * size_c); + +// Set the window's position. +void cegui_wnd_setPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * pos_c); + +// Set the window's X position. +void cegui_wnd_setXPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * x_c); + +// Set the window's Y position. +void cegui_wnd_setYPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * y_c); + +// Set the window's size. +void cegui_wnd_setSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c); + +// Set the window's width. +void cegui_wnd_setWidth(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * width_c); + +// Set the window's height. +void cegui_wnd_setHeight(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * height_c); + +// Set the window's maximum size. +void cegui_wnd_setMaxSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c); + +// Set the window's minimum size. +void cegui_wnd_setMinSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * size_c); + +// Get the window's position. +void cegui_wnd_getPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// Get the window's X position. +void cegui_wnd_getXPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// Get the window's Y position. +void cegui_wnd_getYPosition(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// Get the window's maximum size. +void cegui_wnd_getMaxSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + +// Get the window's minimum size. +void cegui_wnd_getMinSize(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c); + // Causes the Window void cegui_wnd_render(struct hg3dclass_struct * thisclass_c); diff --git a/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h b/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h index 009b715..9143643 100644 --- a/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h @@ -40,5 +40,14 @@ class HG3DWindowStaticFunctions static CEGUI::Slider* castWindowToSlider(CEGUI::Window * window); static CEGUI::Spinner* castWindowToSpinner(CEGUI::Window * window); static CEGUI::MultiColumnList* castWindowToMultiColumnList(CEGUI::Window * window); + + // utility functions for UDims and UVectors + static float udScale( const CEGUI::UDim* ud); + static float udOffset( const CEGUI::UDim* ud); + static CEGUI::UDim* v2X( const CEGUI::UVector2* uv2); + static CEGUI::UDim* v2Y( const CEGUI::UVector2* uv2); + + static CEGUI::UDim* getWindowWidth(const CEGUI::Window* window); + static CEGUI::UDim* getWindowHeight(const CEGUI::Window* window); }; diff --git a/Examples/GUI/GUI-Widgets.hs b/Examples/GUI/GUI-Widgets.hs index 7acb603..76923c0 100644 --- a/Examples/GUI/GUI-Widgets.hs +++ b/Examples/GUI/GUI-Widgets.hs @@ -21,7 +21,6 @@ module Main where --- import HGamer3D -- this import HGamer3D with GUI and Graphics3d and WinEvents import HGamer3D.BaseAPI import Control.Monad.Trans @@ -31,48 +30,56 @@ printEvent :: GUIElement a -> GUIEvent -> IO () printEvent outbox event = do case event of GUIEvent tag sender window -> do - oldtext <- getGuiElProperty outbox "Text" - let evttext = tag - details <- case sender of - "CheckboxWidget" -> do - sel <- getGuiElProperty window "Selected" - return (sel) - "CheckboxWidget2" -> do - sel <- getGuiElProperty window "Selected" - return (sel) - "EditboxWidget" -> do - sel <- getGuiElProperty window "Text" - return ("\n " ++ sel) - "RadiobuttonWidget" -> do - sel <- getGuiElProperty window "Selected" - return (sel) - "RadiobuttonWidget2" -> do - sel <- getGuiElProperty window "Selected" - return (sel) - "SpinnerWidget" -> do - sel <- getGuiElProperty window "CurrentValue" - return (sel) - "SliderWidget" -> do - sel <- getGuiElProperty window "CurrentValue" - return (sel) - "ListboxWidget" -> do - mlb <- toListBox window - sel <- case mlb of - Just lb -> listboxGetSelectedText lb - Nothing -> return [""] - let sel' = if length sel>0 then foldl (\s1 s2 -> (s1 ++ "\n " ++ s2)) [] sel else "" - return (sel') - "ComboboxWidget" -> do - sel <- getGuiElProperty window "Text" - return (sel) - "ButtonWidget" -> do - return "Button clicked" - _ -> return "no details" - - let oldtext' = if length oldtext > 250 then drop 50 oldtext else oldtext - setGuiElProperty outbox "Text" (oldtext' ++ "\n" ++ evttext ++ ": " ++ details) - return () - _ -> do return () + newtext <- case tag of + + "reset-click" -> do + return "Reset Button Click" + "checkbox-one" -> do + cb <- toCheckBox window + sel <- getP cb pSelected + return ("Checkbox One: " ++ (show sel) ++ "\n") + "checkbox-two" -> do + cb <- toCheckBox window + sel <- getP cb pSelected + return ("Checkbox Two: " ++ (show sel) ++ "\n") + "editbox-done" -> do + sel <- getP window pText + return ("Edittext (Done): " ++ sel ++ "\n") + "editbox-change" -> do + sel <- getP window pText + return ("Edittext (Change): " ++ sel ++ "\n") + "radio-one" -> do + rb <- toRadioButton window + sel <- getP rb pSelected + return ("Radiobutton One: " ++ (show sel) ++ "\n") + "radio-two" -> do + rb <- toRadioButton window + sel <- getP rb pSelected + return ("Radiobutton Two: " ++ (show sel) ++ "\n") + "spinner-value" -> do + sp <- toSpinner window + sel <- getP sp pValue + return ("Spinner: " ++ (show sel) ++ "\n") + "slider-value" -> do + sl <- toSlider window + sel <- getP sl pValue + return ("Slider: " ++ (show sel) ++ "\n") + "listbox-change" -> do + lb <- toListBox window + sel <- listboxGetSelectedText lb + let sel' = if length sel>0 then foldl (\s1 s2 -> (s1 ++ "\n " ++ s2)) [] sel else "" + return ("Listbox:\n" ++ sel' ++ "\n") + "combo-done" -> do + sel <- getP window pText + return ("Combobox: " ++ sel ++ "\n") + + + oldtext <- getP outbox pText + let oldtext' = if length oldtext > 250 then drop 50 oldtext else oldtext + setP outbox [ pText =: (oldtext' ++ newtext)] + return () + _ -> do + return () checkEvents outtext g3ds guis = do @@ -82,7 +89,7 @@ checkEvents outtext g3ds guis = do else case evt of Just (EventGUI evts) -> do - mapM (\evt -> printEvent outtext evt) evts + mapM (printEvent outtext) evts return True Just (EventWindow (EvtQuit ts)) -> return False _ -> return True @@ -94,16 +101,6 @@ renderLoop cube outtext g3ds guis = do proceed <- checkEvents outtext g3ds guis if proceed then renderLoop cube outtext g3ds guis else return () - -registerWidgetEvent guis rootWindow widgetName eventName tagName = do - widget <- findChildGuiElRecursive rootWindow widgetName - case widget of - Just widgetOk -> do - registerGUIEvent guis widgetOk eventName tagName - return () - Nothing -> do - return () - main = do (g3ds, guis, camera, viewport) <- initHGamer3D "HGamer3D - GUI Widgets Example" True False True @@ -136,41 +133,65 @@ main = do guiwidgets <- loadGuiLayoutFromFile guis "gui-widgets.layout" "" sttext <- loadGuiLayoutFromFile guis "statictext.layout" "" addGuiElToDisplay guis guiwidgets - - -- add lists to listbox and combobox + +{- + -- test element creation + b1 <- button guis "TaharezLook" [pX =: (GUIDim 0.0 100.0), + pY =: (GUIDim 0.0 100.0), + pWidth =: (GUIDim 0.0 100.0), + pHeight =: (GUIDim 0.0 20.0), + pText =: "Cooler Button", + pVisible =: True, + pAlpha =: 1.0] + addGuiElToDisplay guis b1 + registerGUIEvent guis b1 "Clicked" "coolclick" +-} + + -- handling of single GUI elements + ---------------------------------- + + -- Outtext, output of events + outtext <- findEditText "OuttextWidget" guiwidgets + + -- Reset Button + resetButton <- findButton "ButtonWidget" guiwidgets + registerGUIEvent guis resetButton "Clicked" "reset-click" + + -- Checkbox One and Two + checkboxOne <- findCheckBox "CheckboxWidget" guiwidgets + checkboxTwo <- findCheckBox "CheckboxWidget2" guiwidgets + registerGUIEvent guis checkboxOne "CheckStateChanged" "checkbox-one" + registerGUIEvent guis checkboxTwo "CheckStateChanged" "checkbox-two" + + -- Editbox Widgets + editText <- findEditText "EditboxWidget" guiwidgets + registerGUIEvent guis editText "TextAccepted" "editbox-done" + registerGUIEvent guis editText "TextChanged" "editbox-change" + + -- Radiobutton One and Two + radioOne <- findRadioButton "RadiobuttonWidget" guiwidgets + radioTwo <- findRadioButton "RadiobuttonWidget2" guiwidgets + registerGUIEvent guis radioOne "SelectStateChanged" "radio-one" + registerGUIEvent guis radioTwo "SelectStateChanged" "radio-two" + + -- Spinner and Slider + spinner <- findSpinner "SpinnerWidget" guiwidgets + slider <- findSlider "SliderWidget" guiwidgets + registerGUIEvent guis spinner "ValueChanged" "spinner-value" + registerGUIEvent guis slider "ValueChanged" "slider-value" + + -- Listbox, Entry one, two, three, ... listbox <- findListBox "ListboxWidget" guiwidgets - outtext <- fmap fromJust ( findChildGuiElRecursive guiwidgets "OuttextWidget") - - case listbox of - Just widgetOk -> do - setGuiElProperty widgetOk "MultiSelect" "True" - mapM (listboxAddText widgetOk) ["Entry One", "Entry Two", "Entry Three", "Entry Four", "Entry Five", "Entry Six"] - return () - Nothing -> do - return () - + setGuiElProperty listbox "MultiSelect" "True" + mapM (listboxAddText listbox) ["Entry One", "Entry Two", "Entry Three", "Entry Four", "Entry Five", "Entry Six"] + registerGUIEvent guis listbox "ItemSelectionChanged" "listbox-change" + + -- Combobox, Choice one, two, three combobox <- findComboBox "ComboboxWidget" guiwidgets - case combobox of - Just widgetOk -> do - mapM (comboboxAddText widgetOk) ["Choice One", "Choice Two", "Choice Three"] - setGuiElProperty widgetOk "ReadOnly" "True" - return () - Nothing -> do - return () - - -- register the events needed - registerWidgetEvent guis guiwidgets "ButtonWidget" "Clicked" "bw click" - registerWidgetEvent guis guiwidgets "CheckboxWidget" "CheckStateChanged" "cbw" - registerWidgetEvent guis guiwidgets "CheckboxWidget2" "CheckStateChanged" "cbw2" - registerWidgetEvent guis guiwidgets "EditboxWidget" "TextAccepted" "ebw" - registerWidgetEvent guis guiwidgets "EditboxWidget" "TextChanged" "wbw2" - registerWidgetEvent guis guiwidgets "RadiobuttonWidget" "SelectStateChanged" "rbw" - registerWidgetEvent guis guiwidgets "RadiobuttonWidget2" "SelectStateChanged" "rbw2" - registerWidgetEvent guis guiwidgets "SpinnerWidget" "ValueChanged" "spw" - registerWidgetEvent guis guiwidgets "SliderWidget" "ValueChanged" "slw" - registerWidgetEvent guis guiwidgets "ListboxWidget" "ItemSelectionChanged" "lbw" - registerWidgetEvent guis guiwidgets "ComboboxWidget" "ListSelectionAccepted" "cbw" - + mapM (comboboxAddText combobox) ["Choice One", "Choice Two", "Choice Three"] + setGuiElProperty combobox "ReadOnly" "True" + registerGUIEvent guis combobox "ListSelectionAccepted" "combo-done" + -- start render loop renderLoop cube outtext g3ds guis freeHGamer3D g3ds guis diff --git a/Examples/Graphics3D/BlueCube.hs b/Examples/Graphics3D/BlueCube.hs index 11a665b..d731071 100644 --- a/Examples/Graphics3D/BlueCube.hs +++ b/Examples/Graphics3D/BlueCube.hs @@ -23,13 +23,13 @@ renderLoop cube g3ds = do -- rotate yaw cube (Rad 0.005) roll cube (Rad 0.002) - quit <- loopHGamer3D g3ds + quit <- stepGraphics3D g3ds if quit then return () else renderLoop cube g3ds main :: IO () main = do - (g3ds, camera, viewport) <- initHGamer3D "HGamer3D - BlueCube Example" "DefaultSceneManager" True True + (g3ds, camera, viewport, window) <- initGraphics3D "HGamer3D - BlueCube Example" "DefaultSceneManager" True True -- camera position let pos = Vec3 5.0 5.0 80.0 @@ -50,6 +50,6 @@ main = do -- start render loop renderLoop cube g3ds - exitHGamer3D g3ds + freeGraphics3D g3ds return () diff --git a/GUI/HGamer3D/GUI.hs b/GUI/HGamer3D/GUI.hs index 4705cd4..008bd20 100644 --- a/GUI/HGamer3D/GUI.hs +++ b/GUI/HGamer3D/GUI.hs @@ -29,6 +29,9 @@ module HGamer3D.GUI GUIElement, GUIEvent (..), EventFunction, + + GUIDim (..), + GUIVec2 (..), -- initGUI, -- freeGUI, @@ -40,8 +43,8 @@ module HGamer3D.GUI -- * Event Handling registerGUIEvent, - -- * Configuration: Layout, Font, Scheme, MouseCursor, Tooltip - loadGuiLayoutFromFile, + -- * Configuration: Font, Scheme, MouseCursor, Tooltip + loadGuiScheme, loadGuiFont, setGuiDefaultFont, @@ -54,6 +57,10 @@ module HGamer3D.GUI addGuiElToDisplay, removeGuiElFromDisplay, + -- * Change Gui Element Tree + addChildGuiEl, + removeChildGuiEl, + -- * Set specific GUI Element properties getGuiElProperty, setGuiElProperty, @@ -75,6 +82,21 @@ module HGamer3D.GUI GUISlider, GUISpinner, + -- * Create Widgets programmatically + + button, + radioButton, + checkBox, + editText, + comboBox, + listBox, + spinner, + slider, + + -- * Load Widgets from layout file + + loadGuiLayoutFromFile, + toButton, toRadioButton, toCheckBox, @@ -105,11 +127,14 @@ module HGamer3D.GUI comboboxRemoveAllText, -- * Property Types + GUIElementProperty, GUIButtonProperty, -GUIRadioButtonProperty, +GUIRadioButtonProperty, +GUIHasSelectionProperty, GUICheckBoxProperty, GUIEditTextProperty, +GUIHasValueProperty, GUISliderProperty, GUISpinnerProperty, @@ -118,14 +143,24 @@ GUISpinnerProperty, setP, getP, --- * GUI Element Properties, for all GUI elements +-- * GUI Widget General Properties + pText, pDisabled, pVisible, pAlpha, pTooltip, pAlwaysOnTop, - + +pX, +pY, +pWidth, +pHeight, + +pSelected, +pValue, + + ) where diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs index 41d744d..3a539aa 100644 --- a/GUI/HGamer3D/GUI/Internal/Base.hs +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -32,6 +32,17 @@ module HGamer3D.GUI.Internal.Base GUIEvent (..), EventFunction, + GEButton (..), + GERadioButton (..), + GECheckBox (..), + GEEditText (..), + + GEListBox (..), + GEComboBox (..), + + GESlider (..), + GESpinner (..), + -- * Initialization, Game Loop initGUI, freeGUI, @@ -55,6 +66,10 @@ module HGamer3D.GUI.Internal.Base addGuiElToDisplay, removeGuiElFromDisplay, + -- * Change Gui Element Tree + addChildGuiEl, + removeChildGuiEl, + -- * Set specific GUI Element properties getGuiElProperty, setGuiElProperty, @@ -135,6 +150,19 @@ data GUISystem = GUISystem { guiUniqueName::UniqueName } +-- type constructors for phantom types + +data GEButton = GEButton +data GERadioButton = GERadioButton +data GECheckBox = GECheckBox +data GEEditText = GEEditText + +data GEListBox = GEListBox +data GEComboBox = GEComboBox + +data GESlider = GESlider +data GESpinner = GESpinner + type EventFunction = IO () -- | The GUI Element, a window, a button, any widget or widget element, organized in a hierarchy @@ -207,6 +235,20 @@ hideGuiEl :: GUIElement a -- ^ GUI element to hide hideGuiEl (GUIElement window _) = do Window.hide window +-- | add a GUI element as a child to another GUI element +addChildGuiEl :: GUIElement a -- ^ parent GUI element + -> GUIElement b -- ^ child GUI element + -> IO () +addChildGuiEl (GUIElement parentW _) (GUIElement childW _) = do + Window.addChildWindow2 parentW childW + +-- | remove a GUI element as a child from the parent GUI element +removeChildGuiEl :: GUIElement a -- ^ parent GUI element + -> GUIElement b -- ^ child GUI element + -> IO () +removeChildGuiEl (GUIElement parentW _) (GUIElement childW _) = do + Window.removeChildWindow2 parentW childW + -- | get child gui element, throws an exception, if element not found in children, only searches the direct children of element. getChildGuiEl :: GUIElement a -- ^ GUI element, which childrens are searched for child element -> String -- ^ name of searched child element diff --git a/GUI/HGamer3D/GUI/Internal/Properties.hs b/GUI/HGamer3D/GUI/Internal/Properties.hs index c35fbde..9ceff09 100644 --- a/GUI/HGamer3D/GUI/Internal/Properties.hs +++ b/GUI/HGamer3D/GUI/Internal/Properties.hs @@ -27,12 +27,17 @@ module HGamer3D.GUI.Internal.Properties -- * Property Types GUIElementProperty, GUIButtonProperty, +GUIHasSelectionProperty, GUIRadioButtonProperty, GUICheckBoxProperty, GUIEditTextProperty, +GUIHasValueProperty, GUISliderProperty, GUISpinnerProperty, +GUIDim (..), +GUIVec2 (..), + -- * Property Functions (=:), setP, @@ -46,6 +51,14 @@ pAlpha, pTooltip, pAlwaysOnTop, +pX, +pY, +pWidth, +pHeight, + +pValue, +pSelected, + ) where @@ -59,16 +72,33 @@ import HGamer3D.Data import HGamer3D.Util import HGamer3D.GUI.Internal.Base -import HGamer3D.GUI.Internal.Widgets +--import HGamer3D.GUI.Internal.Widgets import HGamer3D.Data.HG3DClass +import qualified HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions as WinStat +import qualified HGamer3D.Bindings.CEGUI.ClassWindow as Win +import qualified HGamer3D.Bindings.CEGUI.ClassUDim as Ud + +data GUIDim = GUIDim { + gdScale :: Float, + gdOffset :: Float +} + +data GUIVec2 = GUIVec2 { + gv2X :: GUIDim, + gv2Y :: GUIDim +} type GUIElementProperty a b = (GUIElement a -> IO b, GUIElement a -> b -> IO ()) type GUIButtonProperty b = GUIElementProperty GEButton b -type GUIRadioButtonProperty b = GUIElementProperty GERadioButton b -type GUICheckBoxProperty b = GUIElementProperty GECheckBox b type GUIEditTextProperty b = GUIElementProperty GEEditText b -type GUISliderProperty b = GUIElementProperty GESlider b -type GUISpinnerProperty b = GUIElementProperty GESpinner b + +type GUIHasSelectionProperty a b = GUIElementProperty a b +type GUIRadioButtonProperty b = GUIHasSelectionProperty GERadioButton b +type GUICheckBoxProperty b = GUIHasSelectionProperty GECheckBox b + +type GUIHasValueProperty a b = GUIElementProperty a b +type GUISliderProperty b = GUIHasValueProperty GESlider b +type GUISpinnerProperty b = GUIHasValueProperty GESpinner b (=:) :: (GUIElementProperty a b) -> b -> (GUIElement a -> IO ()) (=:) prop val = (\val' guiel -> (snd prop) guiel val') val @@ -133,3 +163,67 @@ pAlwaysOnTop = _boolProp "AlwaysOnTop" pTooltip :: GUIElementProperty a String pTooltip = _stringProp "Tooltip" +pFont :: GUIElementProperty a String +pFont = _stringProp "Font" + +pX :: GUIElementProperty a GUIDim +pX = (getProp, setProp) where + getProp (GUIElement window _) = do + ud <- Win.getXPosition window + scale <- WinStat.udScale ud + offset <- WinStat.udOffset ud + return $ GUIDim scale offset + setProp (GUIElement window _) (GUIDim scale offset) = do + ud <- Ud.new scale offset + Win.setXPosition window ud + Ud.delete ud + return () + +pY :: GUIElementProperty a GUIDim +pY = (getProp, setProp) where + getProp (GUIElement window _) = do + ud <- Win.getYPosition window + scale <- WinStat.udScale ud + offset <- WinStat.udOffset ud + return $ GUIDim scale offset + setProp (GUIElement window _) (GUIDim scale offset) = do + ud <- Ud.new scale offset + Win.setYPosition window ud + Ud.delete ud + return () + +pWidth :: GUIElementProperty a GUIDim +pWidth = (getProp, setProp) where + getProp (GUIElement window _) = do + ud <- WinStat.getWindowWidth window + scale <- WinStat.udScale ud + offset <- WinStat.udOffset ud + Ud.delete ud + return $ GUIDim scale offset + setProp (GUIElement window _) (GUIDim scale offset) = do + ud <- Ud.new scale offset + Win.setWidth window ud + Ud.delete ud + return () + +pHeight :: GUIElementProperty a GUIDim +pHeight = (getProp, setProp) where + getProp (GUIElement window _) = do + ud <- WinStat.getWindowHeight window + scale <- WinStat.udScale ud + offset <- WinStat.udOffset ud + Ud.delete ud + return $ GUIDim scale offset + setProp (GUIElement window _) (GUIDim scale offset) = do + ud <- Ud.new scale offset + Win.setHeight window ud + Ud.delete ud + return () + +pSelected :: GUIHasSelectionProperty a Bool +pSelected = _boolProp "Selected" + +pValue :: GUIHasValueProperty a Float +pValue = _floatProp "Value" + + diff --git a/GUI/HGamer3D/GUI/Internal/Widgets.hs b/GUI/HGamer3D/GUI/Internal/Widgets.hs index d173284..234092c 100644 --- a/GUI/HGamer3D/GUI/Internal/Widgets.hs +++ b/GUI/HGamer3D/GUI/Internal/Widgets.hs @@ -25,26 +25,31 @@ module HGamer3D.GUI.Internal.Widgets ( GUIButton (..), + GUIEditText (..), + + GUIHasSelection (..), GUIRadioButton (..), GUICheckBox (..), - GUIEditText (..), + GUIListBox (..), GUIComboBox (..), + + GUIHasValue (..), GUISlider (..), GUISpinner (..), - GEButton (..), - GERadioButton (..), - GECheckBox (..), - GEEditText (..), - GEListBox (..), - GEComboBox (..), - GESlider (..), - GESpinner (..), - typeOfGuiEl, toGuiType, + button, + radioButton, + checkBox, + editText, + comboBox, + listBox, + spinner, + slider, + toButton, toRadioButton, toCheckBox, @@ -101,6 +106,7 @@ import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as HG3DWindowManager import GHC.Ptr import Data.List.Split +import Data.Maybe import HGamer3D.Data import HGamer3D.Util @@ -130,28 +136,20 @@ import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton import HGamer3D.GUI.Internal.Base +import HGamer3D.GUI.Internal.Properties import HGamer3D.Data.HG3DClass -data GEButton = GEButton -data GERadioButton = GERadioButton -data GECheckBox = GECheckBox - -data GEEditText = GEEditText - -data GEListBox = GEListBox -data GEComboBox = GEComboBox - -data GESlider = GESlider -data GESpinner = GESpinner - -- | GUI Element, Sybtype Button type GUIButton = GUIElement GEButton --- | GUI Element, Sybtype RadioButton -type GUIRadioButton = GUIElement GERadioButton +-- | GUI Elements, which have a selection +type GUIHasSelection a = GUIElement a -- | GUI Element, Sybtype CheckBox -type GUICheckBox = GUIElement GECheckBox +type GUICheckBox = GUIHasSelection GECheckBox + +-- | GUI Element, Sybtype RadioButton +type GUIRadioButton = GUIHasSelection GERadioButton -- | GUI Element, Sybtype EditText type GUIEditText = GUIElement GEEditText @@ -162,11 +160,14 @@ type GUIListBox = GUIElement GEListBox -- | GUI Element, Sybtype Combobox type GUIComboBox = GUIElement GEComboBox +-- | GUI Element, which have a value +type GUIHasValue a = GUIElement a + -- | GUI Element, Sybtype Slider -type GUISlider = GUIElement GESlider +type GUISlider = GUIHasValue GESlider -- | GUI Element, Sybtype Spinner -type GUISpinner = GUIElement GESpinner +type GUISpinner = GUIHasValue GESpinner -- | get Type of GUI element as string @@ -175,16 +176,51 @@ typeOfGuiEl :: GUIElement a -- ^ GUI element to enable typeOfGuiEl (GUIElement window _) = do Window.getType window -toGuiType :: String -> b -> GUIElement a -> IO (Maybe (GUIElement b)) +toGuiType :: String -> b -> GUIElement a -> IO (GUIElement b) toGuiType typestr cons guiel@(GUIElement window _) = do tp <- typeOfGuiEl guiel -- CEGUI Types as String have the format "WindowLook/Button" for example let tp' = (splitOn "/" tp) !! 1 let guiel' = case tp' of - typestr -> Just $ GUIElement window cons - _ -> Nothing + typestr -> GUIElement window cons + _ -> error ("HGamer3D.GUI.Internal.Widgets.toGuiType: " ++ typestr ++ " not found!") return guiel' +_createElement :: String -> (GUIElement a -> IO (GUIElement b)) -> GUISystem -> String -> [GUIElement b -> IO ()] -> IO (GUIElement b) +_createElement elType convFunc guis style proplist = do + let winMgr = guiWindowManager guis + let uname = guiUniqueName guis + elName <- nextUniqueName uname + window <- WindowManager.createWindow winMgr (style ++ "/" ++ elType) elName + el <- convFunc (GUIElement window undefined) + -- set the properties + setP el proplist + return el + +button :: GUISystem -> String -> [GUIButton -> IO ()] -> IO GUIButton +button = _createElement "Button" toButton + +radioButton :: GUISystem -> String -> [GUIRadioButton -> IO ()] -> IO GUIRadioButton +radioButton = _createElement "RadioButton" toRadioButton + +checkBox :: GUISystem -> String -> [GUICheckBox -> IO ()] -> IO GUICheckBox +checkBox = _createElement "Checkbox" toCheckBox + +editText :: GUISystem -> String -> [GUIEditText -> IO ()] -> IO GUIEditText +editText = _createElement "EditText" toEditText + +comboBox :: GUISystem -> String -> [GUIComboBox -> IO ()] -> IO GUIComboBox +comboBox = _createElement "Combobox" toComboBox + +listBox :: GUISystem -> String -> [GUIListBox -> IO ()] -> IO GUIListBox +listBox = _createElement "Listbox" toListBox + +spinner :: GUISystem -> String -> [GUISpinner -> IO ()] -> IO GUISpinner +spinner = _createElement "Spinner" toSpinner + +slider :: GUISystem -> String -> [GUISlider -> IO ()] -> IO GUISlider +slider = _createElement "Slider" toSlider + toButton = toGuiType "Button" GEButton toRadioButton = toGuiType "RadioButton" GERadioButton toCheckBox = toGuiType "Checkbox" GECheckBox @@ -197,15 +233,14 @@ toListBox = toGuiType "Listbox" GEListBox toSlider = toGuiType "Slider" GESlider toSpinner = toGuiType "Spinner" GESpinner -findElement :: (GUIElement a -> IO (Maybe (GUIElement b))) +findElement :: (GUIElement a -> IO (GUIElement b)) ->String -> GUIElement a - -> IO (Maybe (GUIElement b)) + -> IO (GUIElement b) findElement toNewType name topel = do mFound <- findChildGuiElRecursive topel name - case mFound of - Nothing -> return Nothing - Just guiel -> toNewType guiel + el <- toNewType (fromJust mFound) + return el findButton = findElement toButton findRadioButton = findElement toRadioButton From 267c36b7eed32c13c47818d1274c1a427d92f82d Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Thu, 10 Jul 2014 10:24:51 +0200 Subject: [PATCH 04/28] Conflicts: Examples/Graphics3D/BlueCube.hs --- Data/HGamer3D-Data.cabal | 3 +- Data/HGamer3D/Data.hs | 2 + Data/HGamer3D/Data/Transform3D.hs | 82 +++-- .../{Vector/Instances.hs => TypeSynonyms.hs} | 24 +- Data/HGamer3D/Data/Vector.hs | 127 ++++---- Examples/Graphics3D/BlueCube.hs | 18 +- GUI/HGamer3D/GUI/Internal/Base.hs | 19 +- Graphics3D/HGamer3D-Graphics3D.cabal | 3 +- Graphics3D/HGamer3D/Graphics3D.hs | 28 +- .../HGamer3D/Graphics3D/Internal/Base.hs | 228 +++++++------ .../HGamer3D/Graphics3D/Internal/Light.hs | 2 +- .../Graphics3D/Internal/PlatonShapes.hs | 26 +- .../HGamer3D/Graphics3D/Internal/Shapes.hs | 300 +++++++++++++++++- .../HGamer3D/Graphics3D}/Schema/Camera.hs | 25 +- .../HGamer3D/Graphics3D/Schema/Figure.hs | 23 +- .../HGamer3D/Graphics3D/Schema/Geometry.hs | 36 ++- .../HGamer3D/Graphics3D}/Schema/Light.hs | 23 +- .../HGamer3D/Graphics3D}/Schema/Material.hs | 20 +- .../HGamer3D/Graphics3D}/Schema/Parser.hs | 2 +- Main/HGamer3D.cabal | 17 +- .../Audio.hs => AudioModule/BaseAPI.hs} | 2 +- .../AudioModule/Internal/SystemAudio.hs | 179 +++++++++++ Main/HGamer3D/EcsAPI.hs | 66 ++++ .../BaseAPI.hs} | 2 +- Main/HGamer3D/Internal/ECS/Component.hs | 135 ++++++++ .../Wire.hs => Internal/ECS/ComponentType.hs} | 17 +- Main/HGamer3D/Internal/ECS/Entity.hs | 78 +++++ Main/HGamer3D/Internal/ECS/System.hs | 84 +++++ .../HGamer3D/Internal/ECS/SystemGraphics3D.hs | 181 +++++++++++ .../Schema.hs => Internal/Event.hs} | 17 +- Main/HGamer3D/Internal/GameLoop.hs | 50 +-- .../Network.hs => NetworkModule/BaseAPI.hs} | 3 +- Main/SConstruct | 2 + Schema/HGamer3D-Schema.cabal | 34 -- Schema/HGamer3D/Schema/Geometry.hs | 62 ---- Schema/HGamer3D/Schema/Node.hs | 67 ---- Schema/HGamer3D/Schema/Scene.hs | 47 --- Schema/LICENSE | 34 -- Schema/SConstruct | 37 --- Schema/Setup.hs | 22 -- 40 files changed, 1445 insertions(+), 682 deletions(-) rename Data/HGamer3D/Data/{Vector/Instances.hs => TypeSynonyms.hs} (64%) rename {Schema/HGamer3D => Graphics3D/HGamer3D/Graphics3D}/Schema/Camera.hs (66%) rename Schema/HGamer3D/Schema/Colour.hs => Graphics3D/HGamer3D/Graphics3D/Schema/Figure.hs (57%) rename Schema/HGamer3D/Schema/Texture.hs => Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs (60%) rename {Schema/HGamer3D => Graphics3D/HGamer3D/Graphics3D}/Schema/Light.hs (70%) rename {Schema/HGamer3D => Graphics3D/HGamer3D/Graphics3D}/Schema/Material.hs (67%) rename {Schema/HGamer3D => Graphics3D/HGamer3D/Graphics3D}/Schema/Parser.hs (99%) rename Main/HGamer3D/{Modules/Audio.hs => AudioModule/BaseAPI.hs} (95%) create mode 100644 Main/HGamer3D/AudioModule/Internal/SystemAudio.hs create mode 100644 Main/HGamer3D/EcsAPI.hs rename Main/HGamer3D/{Modules/InputSystem.hs => InputSystemModule/BaseAPI.hs} (95%) create mode 100644 Main/HGamer3D/Internal/ECS/Component.hs rename Main/HGamer3D/{Extensions/Wire.hs => Internal/ECS/ComponentType.hs} (74%) create mode 100644 Main/HGamer3D/Internal/ECS/Entity.hs create mode 100644 Main/HGamer3D/Internal/ECS/System.hs create mode 100644 Main/HGamer3D/Internal/ECS/SystemGraphics3D.hs rename Main/HGamer3D/{Extensions/Schema.hs => Internal/Event.hs} (78%) rename Main/HGamer3D/{Modules/Network.hs => NetworkModule/BaseAPI.hs} (95%) delete mode 100644 Schema/HGamer3D-Schema.cabal delete mode 100644 Schema/HGamer3D/Schema/Geometry.hs delete mode 100644 Schema/HGamer3D/Schema/Node.hs delete mode 100644 Schema/HGamer3D/Schema/Scene.hs delete mode 100644 Schema/LICENSE delete mode 100644 Schema/SConstruct delete mode 100644 Schema/Setup.hs diff --git a/Data/HGamer3D-Data.cabal b/Data/HGamer3D-Data.cabal index f6621cf..03b9b53 100644 --- a/Data/HGamer3D-Data.cabal +++ b/Data/HGamer3D-Data.cabal @@ -1,6 +1,5 @@ Name: HGamer3D-Data Version: 0.4.0 -tch and new HG3DClass Synopsis: Game Engine for the Haskell Programmer - Data Definitions and Utilities Description: HGamer3D is a game engine for developing 3D games in the programming @@ -20,7 +19,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, FindBin, directory, filepath, vect - Exposed-modules: HGamer3D.Data.Vector,HGamer3D.Data.Vector.Instances,HGamer3D.Data.Colour,HGamer3D.Data.HG3DClass,HGamer3D.Data.Angle,HGamer3D.Data.TimeMS,HGamer3D.Data.Transform3D,HGamer3D.Data.Geometry2D,HGamer3D.Data.Window,HGamer3D.Util.FileLocation, HGamer3D.Util.UniqueName, HGamer3D.Data, HGamer3D.Util + Exposed-modules: HGamer3D.Data.TypeSynonyms, HGamer3D.Data.Vector,HGamer3D.Data.Colour,HGamer3D.Data.HG3DClass,HGamer3D.Data.Angle,HGamer3D.Data.TimeMS,HGamer3D.Data.Transform3D,HGamer3D.Data.Geometry2D,HGamer3D.Data.Window,HGamer3D.Util.FileLocation, HGamer3D.Util.UniqueName, HGamer3D.Data, HGamer3D.Util Other-modules: c-sources: diff --git a/Data/HGamer3D/Data.hs b/Data/HGamer3D/Data.hs index f6c4b78..f8c8eb1 100644 --- a/Data/HGamer3D/Data.hs +++ b/Data/HGamer3D/Data.hs @@ -29,6 +29,7 @@ module HGamer3D.Data module HGamer3D.Data.TimeMS, module HGamer3D.Data.Vector, module HGamer3D.Data.Geometry2D, + module HGamer3D.Data.TypeSynonyms, Window, ) @@ -41,4 +42,5 @@ import HGamer3D.Data.TimeMS import HGamer3D.Data.Vector import HGamer3D.Data.Geometry2D import HGamer3D.Data.Window +import HGamer3D.Data.TypeSynonyms diff --git a/Data/HGamer3D/Data/Transform3D.hs b/Data/HGamer3D/Data/Transform3D.hs index 24442d5..613012d 100644 --- a/Data/HGamer3D/Data/Transform3D.hs +++ b/Data/HGamer3D/Data/Transform3D.hs @@ -23,9 +23,9 @@ module HGamer3D.Data.Transform3D ( -- * Types - Position (..), - Size (..), - Orientation (..), + HasPosition (..), + HasSize (..), + HasOrientation (..), -- * Functions translate, @@ -39,64 +39,58 @@ where import HGamer3D.Data.Vector import HGamer3D.Data.Angle +import HGamer3D.Data.TypeSynonyms --- | a type with a Position instance has a position -class Position t where +-- | a type with a HasPosition instance has a Position +class HasPosition t where -- | get position function - position :: t -> IO Vec3 + position :: t -> IO Position -- | set position function - positionTo :: t -> Vec3 -> IO () - --- | move the position -translate :: Position t => t -> Vec3 -> IO () -translate t v = do - p <- position t - positionTo t ( v &+ p ) - return () - --- | a type with a Size instance has a size -class Size t where + positionTo :: t -> Position -> IO () + +-- | a type with a HasSize instance has a Size +class HasSize t where -- | get scale function - size :: t -> IO Vec3 + size :: t -> IO Size -- | set scale function - sizeTo :: t -> Vec3 -> IO () + sizeTo :: t -> Size -> IO () --- | scale the size -scale :: Size t => t -> Vec3 -> IO () -scale t v = do - s <- size t - sizeTo t ( v &! s ) - return () - --- | a type with an Orientation instance has an oriented in space -class Orientation t where +-- | a type with an HasOrientation instance has an oriented in space +class HasOrientation t where -- | get orientation function - orientation :: t -> IO UnitQuaternion + orientation :: t -> IO Orientation -- | set orientation function - orientationTo :: t -> UnitQuaternion -> IO () + orientationTo :: t -> Orientation -> IO () + + +-- | move the position +translate :: Position -> Position -> Position +translate = (&+) + +-- | scale the size +scale :: Size -> Vec3 -> Size +scale = (&!) -- yaw, roll, pitch functions -- functions, to rotate on axis, relative to object -rotRelativeToObjectAxis :: Orientation t => t -> Vec3 -> Float -> IO () -rotRelativeToObjectAxis object axis val = do - qob <- orientation object - let odir = actU qob axis - let qrot = rotU odir val - let nrot = qrot .*. qob - orientationTo object nrot - return () +rotRelativeToObjectAxis :: Orientation -> Vec3 -> Float -> Orientation +rotRelativeToObjectAxis ori axis val = let + odir = actU ori axis + qrot = rotU odir val + nrot = qrot .*. ori + in nrot -- | rotate object on own axis (yaw) by angle -yaw :: Orientation t => t -> Angle -> IO () -yaw object val = rotRelativeToObjectAxis object vec3Y (fromAngle val) +yaw :: Orientation -> Angle -> Orientation +yaw ori val = rotRelativeToObjectAxis ori vec3Y (fromAngle val) -- | rotate object on own axis (roll) by angle -roll :: Orientation t => t -> Angle -> IO () -roll object val = rotRelativeToObjectAxis object vec3Z (fromAngle val) +roll :: Orientation -> Angle -> Orientation +roll ori val = rotRelativeToObjectAxis ori vec3Z (fromAngle val) -- | rotate object on own axis (pitch) by angle -pitch :: Orientation t => t -> Angle -> IO () -pitch object val = rotRelativeToObjectAxis object vec3X (fromAngle val) +pitch :: Orientation -> Angle -> Orientation +pitch ori val = rotRelativeToObjectAxis ori vec3X (fromAngle val) diff --git a/Data/HGamer3D/Data/Vector/Instances.hs b/Data/HGamer3D/Data/TypeSynonyms.hs similarity index 64% rename from Data/HGamer3D/Data/Vector/Instances.hs rename to Data/HGamer3D/Data/TypeSynonyms.hs index db0b511..2bbea1b 100644 --- a/Data/HGamer3D/Data/Vector/Instances.hs +++ b/Data/HGamer3D/Data/TypeSynonyms.hs @@ -2,7 +2,7 @@ -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -16,20 +16,18 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Vector2.hs +-- HGamer3D/Data/TypeSynonyms.hs -{-# LANGUAGE GeneralizedNewtypeDeriving #-} +-- | Module providing better type names for standard types in HGamer3D +module HGamer3D.Data.TypeSynonyms --- book: math3d vector lib --- |Includes the right pieces of the Vect libray of Balazs Komuves. --- see: +where -module HGamer3D.Data.Vector.Instances -( - module Data.Vect.Float.Instances, -) +import HGamer3D.Data.Vector + +-- | the Size, Position and Orientation types, implemented as a Vec3 and UnitQuaternion +type Size = Vec3 +type Position = Vec3 +type Orientation = UnitQuaternion -where -import Data.Vect.Float.Instances --- book: end diff --git a/Data/HGamer3D/Data/Vector.hs b/Data/HGamer3D/Data/Vector.hs index a5eec14..99b3003 100644 --- a/Data/HGamer3D/Data/Vector.hs +++ b/Data/HGamer3D/Data/Vector.hs @@ -1,57 +1,70 @@ --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Vector2.hs - -{-# LANGUAGE GeneralizedNewtypeDeriving #-} - --- | Vector library for HGamer3D -module HGamer3D.Data.Vector -( - - -- * the Vect libray of Balazs Komuves, see: - - module Data.Vect.Float, - module Data.Vect.Float.Util.Quaternion, - - -- * some constants - - vec2Zero, - vec2U, - - vec3Zero, - vec3U -) - -where - -import Data.Vect.Float -import Data.Vect.Float.Util.Quaternion - --- | the 2d zero vector -vec2Zero = Vec2 0.0 0.0 - --- | the 2d unity vector -vec2U = Vec2 1.0 1.0 - --- | the 3d Zero vector -vec3Zero = Vec3 0.0 0.0 0.0 - --- | the 3d Unity vector -vec3U = Vec3 1.0 1.0 1.0 - +{-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving, DeriveDataTypeable #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Data/Vector.hs + + +-- | Vector library for HGamer3D +module HGamer3D.Data.Vector +( + + -- * the Vect libray of Balazs Komuves, see: + + module Data.Vect.Float, + module Data.Vect.Float.Util.Quaternion, + + -- * some constants + + zeroVec3, + unitVec2, + + zeroVec3, + unitVec3 + +) + +where + +import Data.Typeable +import Data.Vect.Float +import Data.Vect.Float.Util.Quaternion + +deriving instance Eq UnitQuaternion +deriving instance Eq Vec2 +deriving instance Eq Vec3 +deriving instance Eq Vec4 + +deriving instance Typeable UnitQuaternion +deriving instance Typeable Vec2 +deriving instance Typeable Vec3 +deriving instance Typeable Vec4 + +-- | the 2d zero vector +zeroVec2 = Vec2 0.0 0.0 + +-- | the 2d unity vector +unitVec2 = Vec2 1.0 1.0 + +-- | the 3d Zero vector +zeroVec3 = Vec3 0.0 0.0 0.0 + +-- | the 3d Unity vector +unitVec3 = Vec3 1.0 1.0 1.0 + diff --git a/Examples/Graphics3D/BlueCube.hs b/Examples/Graphics3D/BlueCube.hs index d731071..cce2052 100644 --- a/Examples/Graphics3D/BlueCube.hs +++ b/Examples/Graphics3D/BlueCube.hs @@ -16,20 +16,19 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -import HGamer3D.Data -import HGamer3D.Graphics3D +import HGamer3D.BaseAPI -renderLoop cube g3ds = do +renderLoop cube g3ds guis = do -- rotate yaw cube (Rad 0.005) roll cube (Rad 0.002) - quit <- stepGraphics3D g3ds - if quit then return () else renderLoop cube g3ds + (ev, quit) <- stepHGamer3D g3ds guis + if quit then return () else renderLoop cube g3ds guis main :: IO () main = do - (g3ds, camera, viewport, window) <- initGraphics3D "HGamer3D - BlueCube Example" "DefaultSceneManager" True True + (g3ds, guis, camera, viewport) <- initHGamer3D "HGamer3D - BlueCube Example" True True True -- camera position let pos = Vec3 5.0 5.0 80.0 @@ -44,12 +43,13 @@ main = do -- create a shiny blue cube let blueMaterial = resourceMaterial "Colours/Blue" - cube <- object3DFromMesh g3ds cubeMesh (Just blueMaterial) False +-- cube <- object3DFromMesh g3ds cubeMesh (Just blueMaterial) False + cube <- object3DFromMesh g3ds cubeMesh Nothing False positionTo cube (Vec3 0.0 0.0 0.0) scale cube (Vec3 0.2 0.2 0.2) -- start render loop - renderLoop cube g3ds - freeGraphics3D g3ds + renderLoop cube g3ds guis + freeHGamer3D g3ds guis return () diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs index 3a539aa..12c0a57 100644 --- a/GUI/HGamer3D/GUI/Internal/Base.hs +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -46,7 +46,7 @@ module HGamer3D.GUI.Internal.Base -- * Initialization, Game Loop initGUI, freeGUI, - pollGUIEvents, + pollGUIEvent, -- * Event Handling registerGUIEvent, @@ -459,15 +459,14 @@ registerGUIEvent guis (GUIElement el _) eventToRegister registrationTag = do data GUIEvent = GUIEvent String String (GUIElement ()) -pollGUIEvents :: GUISystem -> IO [GUIEvent] -pollGUIEvents guis = do +pollGUIEvent :: GUISystem -> IO (Maybe GUIEvent) +pollGUIEvent guis = do let eventController = guiEventController guis processEvents <- HG3DEventController.eventsAvailable eventController - if processEvents then do - (name, sender, window) <- HG3DEventController.popEvent eventController - let evt = GUIEvent name sender (GUIElement window ()) - moreEvents <- pollGUIEvents guis - return $ (evt : moreEvents) - else do - return [] + if processEvents + then do + (name, sender, window) <- HG3DEventController.popEvent eventController + let evt = GUIEvent name sender (GUIElement window ()) + return $ Just evt + else return Nothing diff --git a/Graphics3D/HGamer3D-Graphics3D.cabal b/Graphics3D/HGamer3D-Graphics3D.cabal index 9ceeb8d..a415b8e 100644 --- a/Graphics3D/HGamer3D-Graphics3D.cabal +++ b/Graphics3D/HGamer3D-Graphics3D.cabal @@ -21,7 +21,8 @@ Library Build-Depends: base >= 3 && < 5, containers, mtl, transformers, filepath, directory, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Ogre-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D + Exposed-modules: HGamer3D.Graphics3D.Schema.Figure, HGamer3D.Graphics3D.Schema.Geometry, HGamer3D.Graphics3D.Schema.Camera, HGamer3D.Graphics3D.Schema.Light, HGamer3D.Graphics3D.Schema.Material, HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D + Other-modules: c-sources: diff --git a/Graphics3D/HGamer3D/Graphics3D.hs b/Graphics3D/HGamer3D/Graphics3D.hs index 3896a4c..447bcfa 100644 --- a/Graphics3D/HGamer3D/Graphics3D.hs +++ b/Graphics3D/HGamer3D/Graphics3D.hs @@ -22,20 +22,25 @@ module HGamer3D.Graphics3D ( - -- * Fundamental Types - - Graphics3DSystem, - Object3D, - Material, - Mesh, + -- * The Graphics System + Graphics3DSystem (..), Camera, Viewport, - - -- * Initialization and Game Loop Functions + -- * Initialization of Graphics3D and Game Loop Functions initGraphics3D, freeGraphics3D, stepGraphics3D, + + -- * The typeclass of (data) items, which can be put into the engine + Engine3DItem (..), + + -- * The 3D object as outer visible part of it + Object3D (..), + + sphere, + cube, + cuboid, -- * Light Light, @@ -45,7 +50,8 @@ module HGamer3D.Graphics3D spotLightSetDirection, setSpotLightAngle, directionalLight, - + + {- -- * Materials resourceMaterial, @@ -66,6 +72,8 @@ module HGamer3D.Graphics3D object3DFromMesh, object3DFromObjects, +-} + -- * Misc Functions cameraLookAt, @@ -84,7 +92,7 @@ where import HGamer3D.Graphics3D.Internal.Base import HGamer3D.Graphics3D.Internal.Light import HGamer3D.Graphics3D.Internal.Shapes - import HGamer3D.Graphics3D.Internal.PlatonShapes +-- import HGamer3D.Graphics3D.Internal.PlatonShapes diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs index f1f11fb..24d864d 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs @@ -4,7 +4,7 @@ -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -23,16 +23,27 @@ -- | Basic Types, Initialization and some global functions for the Graphics3D module. This is the internal implementation module. The external API is in HGamer3D.Graphics3D. module HGamer3D.Graphics3D.Internal.Base ( - -- * Fundamental Types - + -- * The Graphics and 3D Object System + Graphics3DSystem (..), Object3D (..), - Material (..), - resourceMaterial, - Mesh (..), + -- * Initialization of Graphics3D and Game Loop Functions + initGraphics3D, + freeGraphics3D, + stepGraphics3D, + + -- * some global functions + HGamer3D.Graphics3D.Internal.Base.setBackgroundColour, + addResourceLocationMedia, + addResourceZipfileMedia, + addResourceLocationGUI, + + -- * Camera functionality + Camera (..), + cameraLookAt, - -- * Internal Types, handling of Ogre Engine + -- * Internal Types, handling of the Ogre Engine SceneManager (..), ResourceGroupManager (..), RootObject (..), @@ -40,28 +51,19 @@ module HGamer3D.Graphics3D.Internal.Base ( LogManager (..), TextureManager (..), RenderTarget (..), - - -- * The Graphics System - Graphics3DSystem (..), - - -- * Initialization of Graphics3D and Game Loop Functions - initGraphics3D, - freeGraphics3D, - stepGraphics3D, - - -- * global functions - cameraLookAt, - HGamer3D.Graphics3D.Internal.Base.setBackgroundColour, - addResourceLocationMedia, - addResourceZipfileMedia, - addResourceLocationGUI, + -- * Internal Types 3D Object System + Engine3DItem (..), + OEntity (..), + ONode (..), + EngineData (..), -- * Internal Functionality graphics3DPumpWindowMessages, renderOneFrame, checkQuitReceived, - _getNode + _getNode, + ) where @@ -105,80 +107,14 @@ import Data.Maybe import HGamer3D.Data import HGamer3D.Util --- | The material. Define how an object is looking. Currently we have materials from resources -data Material = ResourceMaterial String -- ^ a named material, already installed as a resource - --- | give back a resource Material -resourceMaterial :: String -- ^ the name of the Material as a resource - -> Material -- ^ the created material -resourceMaterial name = ResourceMaterial name - --- | The mesh. A mesh in HGamer3D is just that, a mesh loaded from a template, a manual mesh, or loaded from file. It comes with default --- material, but 3D objects based on this can get other materials individually. -data Mesh = CubeMesh | -- ^ Cube Mesh-Type - PlaneMesh | -- ^ Plane Mesh-Type - SphereMesh | -- ^ Sphere Mesh-Type - ResourceMesh String | -- ^ Mesh resource loaded from file - ManualMesh String -- ^ Manual Mesh-Type, identified by name - --- | The basic 3D object. Each object is a single instance, which can be displayed, moved, scaled, rotated, ... --- Objects are created cloned from meshes (templates for ojbects) or manually, by manual object creation methods. -data Object3D = SingleObject3D Mesh HG3DClass | -- ^ a single object, consisting of a Mesh and a Node (Ogre) - CombinedObject3D [Object3D] HG3DClass -- ^ a combined object,consisting of many objects and a node for the combined one - -instance Position Object3D where - - position obj = do - pos <- Node.getPosition (_getNode obj) - return (pos) - - positionTo obj pos = do - Node.setPosition (_getNode obj) pos - return () - -instance Size Object3D where - - size obj = do - pos <- Node.getScale (_getNode obj) - return (pos) - - sizeTo obj pos = do - Node.setScale (_getNode obj) pos - return () - -instance Orientation Object3D where - - orientation obj = do - q <- Node.getOrientation (_getNode obj) - let uq = mkNormal q - return uq - - orientationTo obj uq = do - Node.setOrientation (_getNode obj) (fromNormal uq) - return () - -instance Position Camera where - - position (Camera c) = do - pos <- Camera.getPosition c - return (pos) - - positionTo (Camera c) pos = do - Camera.setPosition2 c pos - return () - -instance Orientation Camera where - - orientation (Camera c) = do - q <- Camera.getOrientation c - let uq = mkNormal q - return uq - - orientationTo (Camera c) uq = do - Camera.setOrientation c (fromNormal uq) - return () +import HGamer3D.Graphics3D.Schema.Material +import HGamer3D.Graphics3D.Schema.Geometry +import HGamer3D.Graphics3D.Schema.Figure +{- ------------------------------------------------------ + The Graphics3D Basic Types and Initilization + ------------------------------------------------------ -} data SceneManager = SceneManager HG3DClass data ResourceGroupManager = ResourceGroupManager HG3DClass @@ -332,16 +268,108 @@ initGraphics3D windowName sceneManagerType fConfig fLog = do return $ (Graphics3DSystem (RootObject root) (SceneManager sceneManager) (ResourceGroupManager rgm) (LogManager lmgr) (TextureManager tm) (RenderTarget renderWindow) uniqueName, (Camera camera), (Viewport viewport), (Window windowHandle)) +{- ------------------------------------------------------ + The Type Class for the 3D objects, + implemented from pure data + ------------------------------------------------------ -} + +-- | Typed Ogre Classes: Entity +data OEntity = OE HG3DClass -- this object is an Ogre Entity + +-- | Typed Ogre Classes: Node +data ONode = ON HG3DClass -- this object is an Ogre Node + +-- | Data Tree for Engine Specific Data +data EngineData = EDEntityNode OEntity ONode + | EDNodeAndSub ONode [EngineData] + +-- | 3D Object is implemented as NodeTree of Ogre Classes and Pure Data representation. +-- This is the entity, which is living in the 3D engine. +data Object3D a = Object3D EngineData a + +-- | A type class which defines transformations from data to engine entities and back +class Engine3DItem a where + object3D :: Graphics3DSystem -> a -> IO (Object3D a) + update3D :: Graphics3DSystem -> Object3D a -> a -> IO (Object3D a) + remove3D :: Graphics3DSystem -> (Object3D a) -> IO () + +_getNode :: EngineData -> ONode +_getNode edata = case edata of + (EDEntityNode _ node) -> node + (EDNodeAndSub node _) -> node + +_getNode' :: Object3D a -> HG3DClass +_getNode' (Object3D edata _) = case edata of + (EDEntityNode (OE entity) (ON node)) -> node + (EDNodeAndSub (ON node) _) -> node + +instance HasPosition (Object3D a) where + + position obj = do + pos <- Node.getPosition (_getNode' obj) + return (pos) + + positionTo obj pos = do + Node.setPosition (_getNode' obj) pos + return () + +instance HasSize (Object3D a) where + + size obj = do + pos <- Node.getScale (_getNode' obj) + return (pos) + + sizeTo obj pos = do + Node.setScale (_getNode' obj) pos + return () + +instance HasOrientation (Object3D a) where + + orientation obj = do + q <- Node.getOrientation (_getNode' obj) + let uq = mkNormal q + return uq + + orientationTo obj uq = do + Node.setOrientation (_getNode' obj) (fromNormal uq) + return () + +{- ------------------------------------------------------ + The Camera and its functions + ------------------------------------------------------ -} + +instance HasPosition Camera where + + position (Camera c) = do + pos <- Camera.getPosition c + return (pos) + + positionTo (Camera c) pos = do + Camera.setPosition2 c pos + return () + +instance HasOrientation Camera where + + orientation (Camera c) = do + q <- Camera.getOrientation c + let uq = mkNormal q + return uq + + orientationTo (Camera c) uq = do + Camera.setOrientation c (fromNormal uq) + return () + -- | set the direction in a way, that the camera looks toward a specified point - cameraLookAt :: Camera -> Vec3 -> IO () cameraLookAt (Camera c) v = do Camera.lookAt c v return () --- specific single function --- +{- ------------------------------------------------------ + Misc global functions + ------------------------------------------------------ -} + -- | sets the background colour of the 3d drawing window setBackgroundColour :: Viewport -> Colour -> IO () @@ -379,7 +407,3 @@ addResourceLocationGUI g3ds path category = do ResourceGroupManager.addResourceLocation rgm path "FileSystem" category False ResourceGroupManager.initialiseResourceGroup rgm category -_getNode :: Object3D -> HG3DClass -_getNode (SingleObject3D entity node) = node -_getNode (CombinedObject3D objects node) = node - diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs index 8ffc667..954b0c7 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs @@ -93,7 +93,7 @@ import Control.Monad.State.Class -- | The light. data Light = Light HG3DClass deriving (Show) -instance Position Light where +instance HasPosition Light where position (Light l) = do pos <- Light.getPosition l diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs index 9a143df..5e1476a 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs @@ -23,8 +23,8 @@ -- | Create platonic shapes, ikosaeder and dodekaeder, implementation module. Public API is in HGamer3D.Graphics3D. module HGamer3D.Graphics3D.Internal.PlatonShapes ( - ikosaederMesh, - dodekaederMesh + ikosaeder, + dodekaeder ) where @@ -75,7 +75,6 @@ import Control.Monad.Trans import Control.Monad.IO.Class import Control.Monad.State.Class - vminus = Vec3 (-1.0) (-1.0) (-1.0) getNormOfFace vertices (a, b, c) = normalize cross @@ -124,10 +123,10 @@ _createPlatonObject g3ds colour vertices faces iColor = do -- | create an ikoaeder mesh - from the mesh more objects can be created -ikosaederMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Colour -- ^ colour of the ikosaeder - -> IO Mesh -- ^ created mesh object -ikosaederMesh g3ds colour = do +ikosaeder :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D + -> Colour -- ^ colour of the ikosaeder + -> IO HG3DClass -- ^ created mesh object as entity +ikosaeder g3ds colour = do let (SceneManager scm) = (g3dsSceneManager g3ds) uid <- nextUniqueName (g3dsUniqueName g3ds) @@ -163,14 +162,15 @@ ikosaederMesh g3ds colour = do mo <- _createPlatonObject g3ds colour vertices faces 0 ManualObject.convertToMesh mo meshName "General" - return $ ManualMesh meshName + entity <- SceneManager.createEntity3 scm meshName + return $ entity -- | create a dodekaeder mesh -dodekaederMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D +dodekaeder :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D -> Colour -- ^ colour of the dodekaeder - -> IO Mesh -- ^ created dodekaeder mesh -dodekaederMesh g3ds colour = do + -> IO HG3DClass -- ^ created dodekaeder mesh as entity +dodekaeder g3ds colour = do let (SceneManager scm) = (g3dsSceneManager g3ds) uid <- nextUniqueName (g3dsUniqueName g3ds) @@ -228,5 +228,5 @@ dodekaederMesh g3ds colour = do mo <- _createPlatonObject g3ds colour vertices faces2 0 ManualObject.convertToMesh mo meshName "General" - mesh <- SceneManager.createEntity3 scm meshName - return $ ManualMesh meshName + entity <- SceneManager.createEntity3 scm meshName + return $ entity diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs index 95d3b4f..84ebc38 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs @@ -22,7 +22,14 @@ -- | Creating and managing 3D objects functionality for Graphics3D module, internal implemenatation module. Public API is HGamer3D.Graphics3D. module HGamer3D.Graphics3D.Internal.Shapes ( + + -- * helpers to construct simple geometries + sphere, + cube, + cuboid + -- * +{- -- * Mesh creation functions, standard meshes sphereMesh, cubeMesh, @@ -37,7 +44,7 @@ module HGamer3D.Graphics3D.Internal.Shapes ( -- * clone objects from meshes object3DFromMesh, object3DFromObjects, - +-} ) where @@ -88,18 +95,294 @@ import Control.Monad import Control.Monad.Trans import Control.Monad.State.Class +import HGamer3D.Graphics3D.Schema.Material +import HGamer3D.Graphics3D.Schema.Geometry +import HGamer3D.Graphics3D.Schema.Figure + +import HGamer3D.Graphics3D.Internal.PlatonShapes + + +{- ------------------------------------------------------------------------------- + EngineItem for Geometry + ------------------------------------------------------------------------------- -} + +-- helper functions + +_createGeometry :: Graphics3DSystem -> Geometry -> IO OEntity +_createGeometry g3ds geo = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + entity <- case geo of + ResourceGeometry s -> SceneManager.createEntity3 scm s + Cube -> SceneManager.createEntity6 scm PT_CUBE + Sphere -> SceneManager.createEntity6 scm PT_SPHERE + Ikosaeder -> ikosaeder g3ds white + Dodekaeder -> dodekaeder g3ds white + Plane -> SceneManager.createEntity6 scm PT_PLANE + _ -> error "HGamer3D.Graphics3D.Internal.Shapes._createMesh: Geo not implemented" + return $ OE entity + +_getRootNode :: Graphics3DSystem -> IO ONode +_getRootNode g3ds = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + rootNode <- SceneManager.getRootSceneNode scm + return (ON rootNode) + +_createSubNode :: ONode -> IO ONode +_createSubNode (ON parent) = SceneNode.createChildSceneNode parent zeroVec3 unitQ >>= (return . ON) + +_buildTV :: OEntity -> IO () +_buildTV (OE entity) = HG3DUtils.buildTangentVectors entity + +_addEntityToNode :: Graphics3DSystem -> ONode -> OEntity -> IO () +_addEntityToNode g3ds(ON node) (OE meshEntity) = SceneNode.attachObject node meshEntity + +_exchangeEntityInNode :: Graphics3DSystem -> ONode -> OEntity -> OEntity -> IO () +_exchangeEntityInNode g3ds (ON meshNode) (OE oldMeshEntity) (OE newMeshEntity) = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + SceneNode.detachObject2 meshNode oldMeshEntity + SceneManager.destroyEntity scm oldMeshEntity + SceneNode.attachObject meshNode newMeshEntity + +_removeEntityAndNode :: Graphics3DSystem -> ONode -> OEntity -> ONode -> IO () +_removeEntityAndNode g3ds (ON parent) (OE meshEntity ) (ON meshNode) = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + rootNode <- SceneManager.getRootSceneNode scm + SceneNode.detachObject2 meshNode meshEntity + SceneManager.destroyEntity scm meshEntity + Node.removeChild2 parent meshNode + SceneManager.destroySceneNode2 scm meshNode + +-- instance definition + +instance Engine3DItem Geometry where + + object3D g3ds geo = do + meshEntity <- _createGeometry g3ds geo + meshNode <- (_getRootNode g3ds >>= _createSubNode) + _addEntityToNode g3ds meshNode meshEntity + _buildTV meshEntity + return (Object3D (EDEntityNode meshEntity meshNode) geo) + + update3D g3ds (Object3D (EDEntityNode meshEntity meshNode) oldGeo) geo = do + let (ON node) = meshNode + meshEntity' <- if oldGeo /= geo + then do + newMeshEntity <- _createGeometry g3ds geo + _exchangeEntityInNode g3ds meshNode meshEntity newMeshEntity + return newMeshEntity + else + return meshEntity + return (Object3D (EDEntityNode meshEntity' meshNode) geo) + + remove3D g3ds (Object3D (EDEntityNode meshEntity meshNode) geo) = do + rootNode <- _getRootNode g3ds + _removeEntityAndNode g3ds rootNode meshEntity meshNode + + + +{- ------------------------------------------------------------------------------- + EngineItem for Figure + ------------------------------------------------------------------------------- -} + +_createResourceFigure :: Graphics3DSystem -> String -> IO OEntity +_createResourceFigure g3ds name = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + -- create the entity from the mesh + entity <- SceneManager.createEntity3 scm name + return $ OE entity + +_setNodeP :: EngineData -> Position -> IO () +_setNodeP edata pos = do + let (ON node) = _getNode edata + Node.setPosition node pos - --- set the material of an Ogre entity, used during mesh creation -_setMaterial :: HG3DClass -- ^ 3d object - -> Material -- ^ material - -> IO () -_setMaterial entity material = do +_setNodeO :: EngineData -> Orientation -> IO () +_setNodeO edata ori = do + let (ON node) = _getNode edata + Node.setOrientation node (fromNormal ori) + +_setNodeS :: EngineData -> Size -> IO () +_setNodeS edata size = do + let (ON node) = _getNode edata + Node.setScale node size + +_setNodePOS :: EngineData -> Position -> Orientation -> Size -> IO () +_setNodePOS edata pos ori size = do + let (ON node) = _getNode edata + Node.setPosition node pos + Node.setOrientation node (fromNormal ori) + Node.setScale node size + +_setMaterial :: OEntity -> Material -> IO () +_setMaterial (OE entity) material = do case material of (ResourceMaterial name) -> do Entity.setMaterialName entity name "General" - return () + _ -> error "HGamer3D.Graphics3D.Internal.Shapes._setMaterial: Material not implemented" + +_createFigure :: Graphics3DSystem -> ONode -> Figure -> IO (EngineData) +_createFigure g3ds parent fig = do + node <- _createSubNode parent + case fig of + SimpleFigure geo mat -> do + meshEntity <- _createGeometry g3ds geo + _buildTV meshEntity + _setMaterial meshEntity mat + _addEntityToNode g3ds node meshEntity + return (EDEntityNode meshEntity node) + ResourceFigure name -> do + meshEntity <- _createResourceFigure g3ds name + _buildTV meshEntity + _addEntityToNode g3ds node meshEntity + return (EDEntityNode meshEntity node) + CombinedFigure arrSubs -> do + resArr <- mapM (\(pos, ori, size, fig) -> do + newData <- _createFigure g3ds node fig + _setNodePOS newData pos ori size + return newData) arrSubs + return (EDNodeAndSub node resArr) + +data UpdateActions = ResetMaterial + | ResetGeometry + | ResetResource + | CompareSub + | Rebuild + | DoNothing + + deriving (Eq, Show) + + +_updateFigure :: Graphics3DSystem -> ONode -> EngineData -> Figure -> Figure -> IO (EngineData) +_updateFigure g3ds parent edata oldFig newFig = do + let node = _getNode edata + + -- check, which action is needed + + let action = case oldFig of + SimpleFigure oldGeo oldMat -> case newFig of + SimpleFigure newGeo newMat -> if newGeo == oldGeo + then + if newMat == oldMat + then DoNothing + else ResetMaterial + else ResetGeometry + ResourceFigure name -> ResetResource + CombinedFigure _ -> Rebuild + ResourceFigure oldName -> case newFig of + ResourceFigure newName -> if newName == oldName + then DoNothing + else ResetResource + SimpleFigure newGeo newMat -> ResetGeometry + CombinedFigure _ -> Rebuild + CombinedFigure oldSubs -> case newFig of + SimpleFigure _ _ -> Rebuild + ResourceFigure _ -> Rebuild + CombinedFigure newSubs -> if (length oldSubs) == (length newSubs) + then CompareSub + else Rebuild + + edataNew <- + -- perform the single actions, we can keep existing node and single EngineData item form + if action == ResetMaterial || action == ResetGeometry || action == ResetResource + then do + let (EDEntityNode eOld nOld) = edata + case action of + ResetMaterial -> do + let (SimpleFigure geo mat) = newFig + _setMaterial eOld mat + return edata + ResetGeometry -> do + let (SimpleFigure geo mat) = newFig + eNew <- _createGeometry g3ds geo + _buildTV eNew + _setMaterial eNew mat + _exchangeEntityInNode g3ds nOld eOld eNew + return (EDEntityNode eNew nOld) + ResetResource -> do + let (ResourceFigure name) = newFig + eNew <- _createResourceFigure g3ds name + _buildTV eNew + _exchangeEntityInNode g3ds nOld eOld eNew + return (EDEntityNode eNew nOld) + + -- perform the actions, we compare two equal length subarrays + else if action == CompareSub + then do + let (CombinedFigure oldSubs) = oldFig + let (CombinedFigure newSubs) = newFig + let (EDNodeAndSub node' edOldArr) = edata + outArr <- mapM ( \(oldED, (posO, oriO, sizeO, oldFig), (posN, oriN, sizeN, newFig)) -> do + newED <- _updateFigure g3ds node' oldED oldFig newFig + if posO /= posN then _setNodeP newED posN else return () + if oriO /= oriN then _setNodeO newED oriN else return () + if sizeO /= sizeN then _setNodeS newED sizeN else return () + return newED + ) (zip3 edOldArr oldSubs newSubs) + return (EDNodeAndSub node' outArr) + + -- perform the actions, do a complete rebuild, since structure does not match + else if action == Rebuild + then do + -- delete old structure (to be done) + _removeFigure g3ds parent edata + -- create new structure, this is the easy part + _createFigure g3ds parent newFig + + -- no action needed, all the same + else if action == DoNothing + then return edata + + else return $ error ("HGamer3D.Graphics3D.Internal.Shapes._updateFigure: build action not known " ++ (show action)) + + return edataNew + +_removeFigure :: Graphics3DSystem -> ONode -> EngineData -> IO () +_removeFigure g3ds parent edata = do + case edata of + EDEntityNode e n -> _removeEntityAndNode g3ds parent e n + EDNodeAndSub n subs -> (mapM (\edata' -> _removeFigure g3ds n edata') subs) >> return () + +instance Engine3DItem Figure where + + object3D g3ds fig = do + rootNode <- _getRootNode g3ds + edata <- _createFigure g3ds rootNode fig + return $ Object3D edata fig + + update3D g3ds ob3d newFig = do + rootNode <- _getRootNode g3ds + let (Object3D oldEdata oldFig) = ob3d + newEdata <- _updateFigure g3ds rootNode oldEdata oldFig newFig + return $ Object3D newEdata newFig + + remove3D g3ds ob3d = do + rootNode <- _getRootNode g3ds + let (Object3D edata fig) = ob3d + _removeFigure g3ds rootNode edata + return () + + +{- ------------------------------------------------------------------------------- + intelligent constructors for simple geometries + ------------------------------------------------------------------------------- -} + +sphere :: Graphics3DSystem -> Float -> Material -> IO (Object3D Figure) +sphere g3ds radius material = object3D g3ds (CombinedFigure [ + (zeroVec3, unitU, Vec3 radius radius radius, + SimpleFigure Sphere material) ]) + +cube :: Graphics3DSystem -> Float -> Material -> IO (Object3D Figure) +cube g3ds len material = object3D g3ds (CombinedFigure [ + (zeroVec3, unitU, Vec3 len len len, + SimpleFigure Cube material) ]) + +cuboid :: Graphics3DSystem -> Vec3 -> Material -> IO (Object3D Figure) +cuboid g3ds vec material = object3D g3ds (CombinedFigure [ + (zeroVec3, unitU, vec, SimpleFigure Cube material) ]) + + +{- -- | creates a Sphere Mesh, from which Spheres can be cloned sphereMesh :: Mesh -- ^ the mesh created @@ -299,3 +582,4 @@ rainbowCubeMesh g3ds = do ManualObject.convertToMesh mo meshName "General" return $ ManualMesh meshName +-} diff --git a/Schema/HGamer3D/Schema/Camera.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs similarity index 66% rename from Schema/HGamer3D/Schema/Camera.hs rename to Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs index 65aca15..10ece66 100644 --- a/Schema/HGamer3D/Schema/Camera.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs @@ -1,10 +1,10 @@ -{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} +{-# LANGUAGE DeriveDataTypeable #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -18,28 +18,25 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Camera.hs +-- HGamer3D/Graphics3D/Schema/Camera.hs -- | Types which describe the Scene, the high level of a Scene Tree -module HGamer3D.Schema.Camera +module HGamer3D.Graphics3D.Schema.Camera where +import Data.Typeable + import HGamer3D.Data as Dat -import HGamer3D.Util -import Control.Lens -- | The camera type data Camera = Camera { - _frustum :: Frustum -- ^ Frustum of the camera - } deriving (Eq, Show) + frustum :: Frustum -- ^ Frustum of the camera + } deriving (Eq, Show, Typeable) data Frustum = Frustum { - _nearDistance :: Float, - _farDistance :: Float, - _fieldOfViewHorizontal :: Dat.Angle } deriving (Eq, Show) - -$(makeLenses ''Camera) -$(makeLenses ''Frustum) + nearDistance :: Float, + farDistance :: Float, + fieldOfViewHorizontal :: Dat.Angle } deriving (Eq, Show, Typeable) diff --git a/Schema/HGamer3D/Schema/Colour.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Figure.hs similarity index 57% rename from Schema/HGamer3D/Schema/Colour.hs rename to Graphics3D/HGamer3D/Graphics3D/Schema/Figure.hs index 84b5761..39201bf 100644 --- a/Schema/HGamer3D/Schema/Colour.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Figure.hs @@ -1,10 +1,10 @@ -{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} +{-# Language StandaloneDeriving, DeriveDataTypeable #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -18,17 +18,22 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Colour.hs +-- HGamer3D/Graphics3D/Schema/Figure.hs --- | Types which describe Colourss, Colour is defined in HGamer3D.Data but we need the ColourSlot -module HGamer3D.Schema.Colour +-- | data types which describe a combined geometry together with materials, a complete figure + +module HGamer3D.Graphics3D.Schema.Figure where +import Data.Typeable import qualified HGamer3D.Data as D -import Control.Lens --- | Slot, a name for a colour, to cross-reference materials in Nodes, ... -type ColourSlot = String - +import HGamer3D.Graphics3D.Schema.Geometry +import HGamer3D.Graphics3D.Schema.Material + +data Figure = SimpleFigure Geometry Material + | ResourceFigure String + | CombinedFigure [(D.Position, D.Orientation, D.Size, Figure)] + deriving (Eq, Show, Typeable) diff --git a/Schema/HGamer3D/Schema/Texture.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs similarity index 60% rename from Schema/HGamer3D/Schema/Texture.hs rename to Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs index d79b55f..fb115b0 100644 --- a/Schema/HGamer3D/Schema/Texture.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs @@ -1,10 +1,10 @@ -{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} +{-# Language StandaloneDeriving, DeriveDataTypeable #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -18,22 +18,34 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Texture.hs +-- HGamer3D/Graphics3D/Schema/Geometry.hs --- | Types which describe Textures -module HGamer3D.Schema.Texture +-- | data types which describe the Geometry + +module HGamer3D.Graphics3D.Schema.Geometry where +import Data.Typeable import qualified HGamer3D.Data as D -import Control.Lens --- | Slot, a name for a texture, to cross-reference materials in Nodes, ... -type TextureSlot = String +data Geometry = + + -- loaded from resources + ResourceGeometry String + + -- Primitive 3D Geometries + | Cube + | Sphere + | Cylinder + + -- Platon Geometries + | Ikosaeder + | Dodekaeder --- | The Texture itself -data Texture = ResourceTexture String -- ^ the name given the material resource in the resource system - deriving (Eq, Show) + -- 2D Geometries + | Plane + | Line -$(makePrisms ''Texture) + deriving (Eq, Show, Typeable) diff --git a/Schema/HGamer3D/Schema/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs similarity index 70% rename from Schema/HGamer3D/Schema/Light.hs rename to Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs index 6e783d2..760194e 100644 --- a/Schema/HGamer3D/Schema/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs @@ -1,10 +1,10 @@ -{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} +{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -18,30 +18,27 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Scene.hs +-- HGamer3D/Graphics3D/Schema/Light.hs --- | Types which describe the Scene, the high level of a Scene Tree -module HGamer3D.Schema.Light +-- | Types which describe Light +module HGamer3D.Graphics3D.Schema.Light where +import Data.Typeable + import HGamer3D.Data as Dat -import HGamer3D.Util -import Control.Lens -- | The Light data type data Light = PLight PointLight -- ^ a point light | SLight SpotLight -- ^ a spot light - deriving (Eq, Show) + deriving (Eq, Show, Typeable) data PointLight = PointLight { - } deriving (Eq, Show) + } deriving (Eq, Show, Typeable) data SpotLight = SpotLight { - } deriving (Eq, Show) + } deriving (Eq, Show, Typeable) -$(makePrisms ''Light) -$(makeLenses ''PointLight) -$(makeLenses ''SpotLight) diff --git a/Schema/HGamer3D/Schema/Material.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Material.hs similarity index 67% rename from Schema/HGamer3D/Schema/Material.hs rename to Graphics3D/HGamer3D/Graphics3D/Schema/Material.hs index 95e220c..76411a5 100644 --- a/Schema/HGamer3D/Schema/Material.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Material.hs @@ -1,10 +1,10 @@ -{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} +{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -18,23 +18,19 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Material.hs +-- HGamer3D/Graphics3D/Schema/Material.hs --- | Types which describe Materials -module HGamer3D.Schema.Material +-- | data types which describe Materials +module HGamer3D.Graphics3D.Schema.Material where import qualified HGamer3D.Data as D -import Control.Lens - --- | Slot, a name for a material, to cross-reference materials in Nodes, ... -type MaterialSlot = String +import Data.Typeable -- | The material itself -data Material = ResourceMaterial String -- ^ the name given the material resource in the reource system - deriving (Eq, Show) +data Material = ResourceMaterial String -- ^ the name given the material resource in the resource system + deriving (Eq, Show, Typeable) -$(makePrisms ''Material) diff --git a/Schema/HGamer3D/Schema/Parser.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Parser.hs similarity index 99% rename from Schema/HGamer3D/Schema/Parser.hs rename to Graphics3D/HGamer3D/Graphics3D/Schema/Parser.hs index 05cde18..4411cf6 100644 --- a/Schema/HGamer3D/Schema/Parser.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Parser.hs @@ -19,7 +19,7 @@ -- Parser.hs -- | The Parser to implement a DSL for describing the Scene inclusive all nodes in text -module HGamer3D.Schema.Parser ( +module HGamer3D.Graphics3D.Schema.Parser ( parseScene ) diff --git a/Main/HGamer3D.cabal b/Main/HGamer3D.cabal index a38c02c..12acae9 100644 --- a/Main/HGamer3D.cabal +++ b/Main/HGamer3D.cabal @@ -30,14 +30,10 @@ Flag InputSystem Description: Enable Joystick, Mouse, Keyboard Polling Default: True -Flag Extensions - Description: API extensions - Default: True - Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 + Build-Depends: base >= 3 && < 5, clock, containers, hashtables, hashable, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Internal.GameLoop, HGamer3D.BaseAPI + Exposed-modules: HGamer3D.Internal.ECS.Component, HGamer3D.Internal.ECS.ComponentType, HGamer3D.Internal.ECS.Entity, HGamer3D.Internal.ECS.System, HGamer3D.Internal.ECS.SystemGraphics3D, HGamer3D.Internal.GameLoop, HGamer3D.Internal.Event, HGamer3D.BaseAPI Other-modules: c-sources: @@ -51,16 +47,13 @@ Library if flag(audio) build-depends: HGamer3D-Audio >= 0.4 && < 0.5 - exposed-modules: HGamer3D.Modules.Audio + exposed-modules: HGamer3D.AudioModule.BaseAPI if flag(network) build-depends: HGamer3D-Network >= 0.4 && < 0.5 - exposed-modules: HGamer3D.Modules.Network + exposed-modules: HGamer3D.NetworkModule.BaseAPI if flag(inputsystem) build-depends: HGamer3D-InputSystem >= 0.4 && < 0.5 - exposed-modules: HGamer3D.Modules.InputSystem + exposed-modules: HGamer3D.InputSystemModule.BaseAPI - if flag(extensions) - build-depends: HGamer3D-Wire >= 0.4.0 && < 0.5.0, HGamer3D-Schema >= 0.4.0 && < 0.5.0 - exposed-modules: HGamer3D.Extensions.Schema, HGamer3D.Extensions.Wire \ No newline at end of file diff --git a/Main/HGamer3D/Modules/Audio.hs b/Main/HGamer3D/AudioModule/BaseAPI.hs similarity index 95% rename from Main/HGamer3D/Modules/Audio.hs rename to Main/HGamer3D/AudioModule/BaseAPI.hs index fff9985..4315ef3 100644 --- a/Main/HGamer3D/Modules/Audio.hs +++ b/Main/HGamer3D/AudioModule/BaseAPI.hs @@ -19,7 +19,7 @@ -- HGamer3D Modules/Audio Module -- -module HGamer3D.Modules.Audio +module HGamer3D.AudioModule.BaseAPI ( module HGamer3D.Audio diff --git a/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs b/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs new file mode 100644 index 0000000..a9c81a6 --- /dev/null +++ b/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs @@ -0,0 +1,179 @@ +{-# Language StandaloneDeriving #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Internal/ECS/SystemGraphics3D.hs + +-- | the Graphics3D System of the Entity-Component-System World + +module HGamer3D.AudioModule.Internal.SystemAudio + +where + +import Control.Concurrent.MVar +import HGamer3D.Internal.ECS.Component +import qualified Data.Map as M +import Data.Maybe +import Data.Typeable +import Data.Dynamic + +import HGamer3D.Internal.ECS.Entity +import HGamer3D.Internal.ECS.Component +import HGamer3D.Internal.ECS.ComponentType +import HGamer3D.Internal.ECS.System + +import Data.Hashable +import qualified Data.HashTable.IO as HT + +import qualified HGamer3D.BaseAPI as BA + +import HGamer3D.Graphics3D.Schema.Figure +import HGamer3D.Graphics3D.Schema.Geometry +import HGamer3D.Graphics3D.Schema.Material + + +-- the system of entity component system, in general a system has internal state +-- entities can be added to it and the system has a step function, to run it +-- Systems are self-contained, so they can be run in a thread and manage their state themselves + +type IdHashTable v = HT.BasicHashTable ComponentId v + +data ECSGraphics3D = ECSGraphics3D { + g3d :: (BA.Graphics3DSystem, BA.GUISystem, BA.Camera, BA.Viewport), + figures :: MVar [(Component, Maybe Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori, size)] + figCache :: IdHashTable ( + BA.Object3D Figure, + StampedValue Figure, + Maybe (StampedValue BA.Position), + Maybe (StampedValue BA.Orientation), + Maybe (StampedValue BA.Size) + ) + } + +instance System ECSGraphics3D where + + addEntity ecsg3d entity = do + oldList <- takeMVar (figures ecsg3d) + let mFig = entity #? CTFig + let newList = case mFig of + Just fig -> let + (p, o, s) = (entity #? CTPos, entity #? CTOri, entity #? CTSiz) + in ((fig, p, o, s) : oldList) + Nothing -> oldList + putMVar (figures ecsg3d) newList + return ecsg3d + + removeEntity ecsg3d entity = return ecsg3d + +{- + removeEntity ecsg3d entity = do + let (g3ds, guis, camera, viewport) = g3d + let removeFunction mvList cache = do + oldList <- takeMVar mvList + + let newList = filter ( (/=) +-} + + initializeSystem = do + g3d <- BA.initHGamer3D "HGamer3D - System" True True True + setupBasicCamera g3d + figures <- newMVar [] + figCache <- HT.new + return $ (ECSGraphics3D g3d figures figCache) + + + stepSystem ecsg3d = do + let (g3ds, guis, camera, viewport) = (g3d ecsg3d) + -- update 3d objects + cList <- takeMVar (figures ecsg3d) + mapM (\(cf, mcp, mco, mcs) -> do + -- handle changes per single entity item + figTVal <- readC cf >>= return . fromJust + let newFig = fromStamped figTVal + mCache <- HT.lookup (figCache ecsg3d) (idC cf) + -- first create/update the figure object + newOb <- case mCache of + Nothing -> BA.object3D g3ds newFig + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if oldFig /= figTVal then BA.update3D g3ds oldOb newFig else return oldOb + -- then handle the POS information - Position + newPos <- case mcp of + Just cp -> do + cpTVal <- readC cp >>= return . fromJust + let cpVal = fromStamped cpTVal + case mCache of + Nothing -> BA.positionTo newOb cpVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mPos) /= cpTVal then BA.positionTo newOb cpVal else return () + return $ Just cpTVal + Nothing -> return Nothing + -- then handle the POS information - Orientation + newOri <- case mco of + Just co -> do + coTVal <- readC co >>= return . fromJust + let coVal = fromStamped coTVal + case mCache of + Nothing -> BA.orientationTo newOb coVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mOri) /= coTVal then BA.orientationTo newOb coVal else return () + return $ Just coTVal + Nothing -> return Nothing + -- then handle the POS information - Size + newSiz <- case mcs of + Just cs -> do + csTVal <- readC cs >>= return . fromJust + let csVal = fromStamped csTVal + case mCache of + Nothing -> BA.sizeTo newOb csVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mSiz) /= csTVal then BA.sizeTo newOb csVal else return () + return $ Just csTVal + Nothing -> return Nothing + -- insert new values into cache + HT.insert (figCache ecsg3d) (idC cf) (newOb, figTVal, newPos, newOri, newSiz) + ) cList + putMVar (figures ecsg3d) cList + -- run graphics + (evt, qFlag) <- BA.stepHGamer3D g3ds guis + return (ecsg3d, qFlag) + + shutdownSystem ecsg3d = do + let (g3ds, guis, camera, viewport) = (g3d ecsg3d) + BA.freeHGamer3D g3ds guis + return () + +runECSGraphics3D :: BA.TimeMS -> IO ECSGraphics3D +runECSGraphics3D sleepT = runSystem sleepT + + +setupBasicCamera g3d = do + let (g3ds, guis, camera, viewport) = g3d + -- camera position + let pos = BA.Vec3 5.0 5.0 80.0 + BA.positionTo camera pos + let at = BA.Vec3 0.0 0.0 (-300.0) + BA.cameraLookAt camera at + + -- define light + + BA.setAmbientLight g3ds BA.white + BA.pointLight g3ds BA.white (BA.Vec3 10.0 10.0 20.0) + + -- GUI Code starts here, display hg3d logo + BA.loadGuiScheme guis "hg3d.scheme" + logo <- BA.loadGuiLayoutFromFile guis "hgamer3d.layout" "" + BA.addGuiElToDisplay guis logo + + return () diff --git a/Main/HGamer3D/EcsAPI.hs b/Main/HGamer3D/EcsAPI.hs new file mode 100644 index 0000000..d7ce5f7 --- /dev/null +++ b/Main/HGamer3D/EcsAPI.hs @@ -0,0 +1,66 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D EcsAPI Module +-- + +-- | HGamer3D - A game engine for the Haskell Programmer, this module includes the common modules for the ECS API. +-- ECS is the Entity - Component - System + +module HGamer3D.EcsAPI +( + -- $Ecs + + -- * Component + -- $Component + + -- * Entity + -- $Entity + + -- * System + -- $System + + + +) where + + + + +{- $Ecs +An Entity-Component-System is a specific architecture for building the object model of a game engine. It has been evolved to address some shortcomings of the traditional OO style of building game objects, which led to large and inflexible object inheritance trees, which did not cover well the needs of flexible game entity organization. Interestingly whereas the traditional OO model does not have a good and usable representation in the functional world, the ECS system does, since it is founded on a data driven model, something which plays well with functional architectures. + +A full explanation of ECS is beyond this documentation, you can easily find it by searching for the term in the Internet. Here we describe shortly the implementation of the ECS model in HGamer3D. + +The components of an ECS are describing the basic data building blocks, from which game entities are build. Typical components for a game entity are for example its 3D picture, its position, the sounds associated with it, its animations, its hit count and health and so on. Important to acknowledge is that a component is only the data part of that, not the behaviour part as in OO objects. Due to the modular structure of components, they might be also referred to as properties. Game entities now are build, by assigning an identity to the entity and by giving it a number of components or properties. This architecture by composition gives much more flexible systems, than designing large object hierarchies. Finally the behaviour of the entities in different contexts are implemented in the so called systems. +-} + +{- $Entity + +-} + +{- $Component +The component implements something like the most granular modifiable state in the game engine world. This state is accessible by multiple threads and it has an associated id, with which it can be uniquely identified. (The id is implemented as a StableName). Since the overall mechanism is somehow poll based, we need a mechanism to determine changed values fast, this is done by the timestamp mechanism, which allows, to detect changed values fast in exchange to a small penalty on the cost of doing a change. +-} + + +-} + +{- $System + +-} diff --git a/Main/HGamer3D/Modules/InputSystem.hs b/Main/HGamer3D/InputSystemModule/BaseAPI.hs similarity index 95% rename from Main/HGamer3D/Modules/InputSystem.hs rename to Main/HGamer3D/InputSystemModule/BaseAPI.hs index 89d6f68..03c288c 100644 --- a/Main/HGamer3D/Modules/InputSystem.hs +++ b/Main/HGamer3D/InputSystemModule/BaseAPI.hs @@ -19,7 +19,7 @@ -- HGamer3D Modules/InputSystem Module -- -module HGamer3D.Modules.InputSystem +module HGamer3D.InputSystemModule.BaseAPI ( module HGamer3D.InputSystem diff --git a/Main/HGamer3D/Internal/ECS/Component.hs b/Main/HGamer3D/Internal/ECS/Component.hs new file mode 100644 index 0000000..0469415 --- /dev/null +++ b/Main/HGamer3D/Internal/ECS/Component.hs @@ -0,0 +1,135 @@ +{-# Language StandaloneDeriving, DeriveDataTypeable, DeriveGeneric, PatternGuards #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Component.hs + +-- | the Component in Entity-Component-System + +module HGamer3D.Internal.ECS.Component + +( + -- * Time Stamp Mechanism + StampedValue, + fromStamped, + + -- * The component + ComponentId, + Component (..), + + newC, + readC, + updateC, + isTypeC, + idC, + + _pushEvent, + _popEvents + +) + +where + +import Data.Dynamic +import Data.Typeable +import Control.Concurrent.MVar +import System.Mem.StableName +import GHC.Generics (Generic) +import Data.Hashable +import System.Clock + +import HGamer3D.Internal.Event + +deriving instance Generic TimeSpec +instance Hashable TimeSpec + +data StampedValue a = SV a Int + deriving (Typeable) + +instance Eq a => Eq (StampedValue a) where + (==) (SV val1 h1) (SV val2 h2) = if h1 == h2 then True else val1 == val2 + +_stamp :: a -> IO (StampedValue a) +_stamp val = do + tstamp <- (getTime Monotonic >>= return . hash) + return $ SV val tstamp + +fromStamped :: StampedValue a -> a +fromStamped (SV val _) = val + +type ComponentId = StableName Dynamic + +data Component = Component { + componentData :: Dynamic, + componentId :: ComponentId, + componentType :: TypeRep, + componentEvents :: MVar [HG3DEvent] +} + +instance Eq Component where + c1 == c2 = (idC c1) == (idC c2) + +newC :: Typeable a => a -> IO Component +newC val = do + tval <- _stamp val + mv <- newMVar tval + let dyn = toDyn mv + ident <- makeStableName dyn + evts <- newMVar [] + return (Component dyn ident (typeOf val) evts) + +readC :: Typeable a => Component -> IO (Maybe (StampedValue a)) +readC (Component dyn _ _ _) + | Just mv <- fromDynamic dyn = do + val <- takeMVar mv + putMVar mv val + return $ Just val + | otherwise = do + return Nothing + +isTypeC :: Typeable a => a -> Component -> Bool +isTypeC val (Component dyn _ tr _) = (typeOf val == tr) + +updateC :: Typeable a => Component -> (a -> a) -> IO () +updateC (Component dyn _ _ _) f + | Just mv <- fromDynamic dyn = do + val <- (takeMVar mv >>= (return . fromStamped)) + newTVal <- _stamp (f val) + putMVar mv newTVal + return () + | otherwise = do + return () + +idC :: Component -> ComponentId +idC (Component _ ident _ _) = ident + +_pushEvent :: Component -> HG3DEvent -> IO () +_pushEvent c evt = do + let mv = (componentEvents c) + evts <- takeMVar mv + putMVar mv (evts ++ [evt]) + +_popEvents :: Component -> IO [HG3DEvent] +_popEvents c = do + let mv = (componentEvents c) + evts <- takeMVar mv + putMVar mv [] + return evts + + diff --git a/Main/HGamer3D/Extensions/Wire.hs b/Main/HGamer3D/Internal/ECS/ComponentType.hs similarity index 74% rename from Main/HGamer3D/Extensions/Wire.hs rename to Main/HGamer3D/Internal/ECS/ComponentType.hs index 51c3b09..f4ba09a 100644 --- a/Main/HGamer3D/Extensions/Wire.hs +++ b/Main/HGamer3D/Internal/ECS/ComponentType.hs @@ -16,13 +16,18 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- HGamer3D Extensions/Wire Module +-- HGamer3D/Internal/ECS/ComponentType Module -- -module HGamer3D.Extensions.Wire +module HGamer3D.Internal.ECS.ComponentType -( - module HGamer3D.Wire -) where +where - import HGamer3D.Wire +data ComponentType = CTPos + | CTOri + | CTSiz + | CTFig + + deriving (Eq, Ord, Show) + + diff --git a/Main/HGamer3D/Internal/ECS/Entity.hs b/Main/HGamer3D/Internal/ECS/Entity.hs new file mode 100644 index 0000000..79c97ff --- /dev/null +++ b/Main/HGamer3D/Internal/ECS/Entity.hs @@ -0,0 +1,78 @@ +{-# Language StandaloneDeriving #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Entity.hs + +-- | the Entity in Entity-Component-System + +module HGamer3D.Internal.ECS.Entity + +( + -- * Entity + Entity, + sendEvent, + + entity, + (#:), + (#?), + (#) + +) + +where + +import HGamer3D.Internal.ECS.ComponentType +import HGamer3D.Internal.Event + +import Control.Concurrent.MVar +import HGamer3D.Internal.ECS.Component +import qualified Data.Map as M +import Data.Maybe +import Data.Typeable + +data Entity = Entity (M.Map ComponentType Component) + +-- +-- pure Data functions, creating, traversing and getting components from entities +-- + +entity :: [(ComponentType, IO Component)] -> IO Entity +entity inList = do + outList <- mapM (\(c, val) -> do + val' <- val + return (c, val')) inList + return $ Entity (M.fromList outList) + +sendEvent :: Entity -> HG3DEvent -> IO () +sendEvent (Entity map) event = mapM (\(ct, c) -> _pushEvent c event) (M.toList map) >> return () + +(#:) :: Typeable a => ComponentType -> a -> (ComponentType, IO Component) +(#:) ec val = (ec, newC val) + +(#?) :: Entity -> ComponentType -> Maybe Component +(Entity map) #? name = M.lookup name map +infix 8 #? + +(#) :: Entity -> ComponentType -> Component +e # name = fromJust (e #? name) +infix 8 # + + + diff --git a/Main/HGamer3D/Internal/ECS/System.hs b/Main/HGamer3D/Internal/ECS/System.hs new file mode 100644 index 0000000..ace675f --- /dev/null +++ b/Main/HGamer3D/Internal/ECS/System.hs @@ -0,0 +1,84 @@ +{-# Language StandaloneDeriving #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- System.hs + +-- | the System in Entity-Component-System + +module HGamer3D.Internal.ECS.System + +where + +import Control.Concurrent +import Control.Concurrent.MVar +import HGamer3D.Internal.ECS.Component +import qualified Data.Map as M +import Data.Maybe +import Data.Typeable + +import HGamer3D.Data as D +import HGamer3D.Internal.ECS.Entity + +import System.Clock +import System.Mem.StableName +import Data.Hashable + +-- the system of entity component system, in general a system has internal state +-- entities can be added to it and the system has a step function, to run it + +class System a where + addEntity :: a -> Entity -> IO a + removeEntity :: a -> Entity -> IO a + stepSystem :: a -> IO (a, Bool) + initializeSystem :: IO a + shutdownSystem :: a -> IO () + + runSystem :: D.TimeMS -> IO a + runSystem stepT = do + mv <- newEmptyMVar + forkOS $ (\mv' -> do + status <- initializeSystem + putMVar mv' status + let runS s = do + let (TimeMS msecStepT) = stepT + nowT <- getTime Monotonic + (s', qFlag) <- stepSystem s + if qFlag then do + shutdownSystem s' + return () + else do + nowT' <- getTime Monotonic + let diffSec = (fromIntegral ((sec nowT') - (sec nowT)))::Integer + let diffNSec = (fromIntegral ((nsec nowT') - (nsec nowT)))::Integer + let diffMSec = diffSec * 1000 + (diffNSec `div` 1000000) + let msecDelay = (fromIntegral msecStepT) - diffMSec + if msecDelay > 0 then do + threadDelay ((fromIntegral msecDelay) * 1000) + else do + return () + runS s' + runS status + ) mv + status' <- takeMVar mv + return status' + + + + diff --git a/Main/HGamer3D/Internal/ECS/SystemGraphics3D.hs b/Main/HGamer3D/Internal/ECS/SystemGraphics3D.hs new file mode 100644 index 0000000..e94e5e1 --- /dev/null +++ b/Main/HGamer3D/Internal/ECS/SystemGraphics3D.hs @@ -0,0 +1,181 @@ +{-# Language StandaloneDeriving #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Internal/ECS/SystemGraphics3D.hs + +-- | the Graphics3D System of the Entity-Component-System World + +module HGamer3D.Internal.ECS.SystemGraphics3D + +where + +import Control.Concurrent.MVar +import HGamer3D.Internal.ECS.Component +import qualified Data.Map as M +import Data.Maybe +import Data.Typeable +import Data.Dynamic + +import HGamer3D.Internal.ECS.Entity +import HGamer3D.Internal.ECS.Component +import HGamer3D.Internal.ECS.ComponentType +import HGamer3D.Internal.ECS.System + +import Data.Hashable +import qualified Data.HashTable.IO as HT + +import qualified HGamer3D.BaseAPI as BA + +import HGamer3D.Graphics3D.Schema.Figure +import HGamer3D.Graphics3D.Schema.Geometry +import HGamer3D.Graphics3D.Schema.Material + + +-- the system of entity component system, in general a system has internal state +-- entities can be added to it and the system has a step function, to run it +-- Systems are self-contained, so they can be run in a thread and manage their state themselves + +type IdHashTable v = HT.BasicHashTable ComponentId v + +data ECSGraphics3D = ECSGraphics3D { + g3d :: (BA.Graphics3DSystem, BA.GUISystem, BA.Camera, BA.Viewport), + figures :: MVar [(Component, Maybe Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori, size)] + figCache :: IdHashTable ( + BA.Object3D Figure, + StampedValue Figure, + Maybe (StampedValue BA.Position), + Maybe (StampedValue BA.Orientation), + Maybe (StampedValue BA.Size) + ) + } + +instance System ECSGraphics3D where + + addEntity ecsg3d entity = do + oldList <- takeMVar (figures ecsg3d) + let mFig = entity #? CTFig + let newList = case mFig of + Just fig -> let + (p, o, s) = (entity #? CTPos, entity #? CTOri, entity #? CTSiz) + in ((fig, p, o, s) : oldList) + Nothing -> oldList + putMVar (figures ecsg3d) newList + return ecsg3d + + removeEntity ecsg3d entity = return ecsg3d + +{- + removeEntity ecsg3d entity = do + let (g3ds, guis, camera, viewport) = g3d + let removeFunction mvList cache = do + oldList <- takeMVar mvList + + let newList = filter ( (/=) +-} + + initializeSystem = do + g3d <- BA.initHGamer3D "HGamer3D - System" True True True + setupBasicCamera g3d + figures <- newMVar [] + figCache <- HT.new + return $ (ECSGraphics3D g3d figures figCache) + + + stepSystem ecsg3d = do + let (g3ds, guis, camera, viewport) = (g3d ecsg3d) + -- update 3d objects + cList <- takeMVar (figures ecsg3d) + mapM (\(cf, mcp, mco, mcs) -> do + -- empty event queues + _popEvents cf + -- handle changes per single entity item + figTVal <- readC cf >>= return . fromJust + let newFig = fromStamped figTVal + mCache <- HT.lookup (figCache ecsg3d) (idC cf) + -- first create/update the figure object + newOb <- case mCache of + Nothing -> BA.object3D g3ds newFig + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if oldFig /= figTVal then BA.update3D g3ds oldOb newFig else return oldOb + -- then handle the POS information - Position + newPos <- case mcp of + Just cp -> do + cpTVal <- readC cp >>= return . fromJust + let cpVal = fromStamped cpTVal + case mCache of + Nothing -> BA.positionTo newOb cpVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mPos) /= cpTVal then BA.positionTo newOb cpVal else return () + return $ Just cpTVal + Nothing -> return Nothing + -- then handle the POS information - Orientation + newOri <- case mco of + Just co -> do + coTVal <- readC co >>= return . fromJust + let coVal = fromStamped coTVal + case mCache of + Nothing -> BA.orientationTo newOb coVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mOri) /= coTVal then BA.orientationTo newOb coVal else return () + return $ Just coTVal + Nothing -> return Nothing + -- then handle the POS information - Size + newSiz <- case mcs of + Just cs -> do + csTVal <- readC cs >>= return . fromJust + let csVal = fromStamped csTVal + case mCache of + Nothing -> BA.sizeTo newOb csVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mSiz) /= csTVal then BA.sizeTo newOb csVal else return () + return $ Just csTVal + Nothing -> return Nothing + -- insert new values into cache + HT.insert (figCache ecsg3d) (idC cf) (newOb, figTVal, newPos, newOri, newSiz) + ) cList + putMVar (figures ecsg3d) cList + -- run graphics + (evt, qFlag) <- BA.stepHGamer3D g3ds guis + return (ecsg3d, qFlag) + + shutdownSystem ecsg3d = do + let (g3ds, guis, camera, viewport) = (g3d ecsg3d) + BA.freeHGamer3D g3ds guis + return () + +runSystemGraphics3D :: BA.TimeMS -> IO ECSGraphics3D +runSystemGraphics3D sleepT = runSystem sleepT + + +setupBasicCamera g3d = do + let (g3ds, guis, camera, viewport) = g3d + -- camera position + let pos = BA.Vec3 5.0 5.0 80.0 + BA.positionTo camera pos + let at = BA.Vec3 0.0 0.0 (-300.0) + BA.cameraLookAt camera at + + -- define light + + BA.setAmbientLight g3ds BA.white + BA.pointLight g3ds BA.white (BA.Vec3 10.0 10.0 20.0) + + -- GUI Code starts here, display hg3d logo + BA.loadGuiScheme guis "hg3d.scheme" + logo <- BA.loadGuiLayoutFromFile guis "hgamer3d.layout" "" + BA.addGuiElToDisplay guis logo + + return () diff --git a/Main/HGamer3D/Extensions/Schema.hs b/Main/HGamer3D/Internal/Event.hs similarity index 78% rename from Main/HGamer3D/Extensions/Schema.hs rename to Main/HGamer3D/Internal/Event.hs index 8be8d41..56ca2da 100644 --- a/Main/HGamer3D/Extensions/Schema.hs +++ b/Main/HGamer3D/Internal/Event.hs @@ -16,13 +16,18 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- HGamer3D Extensions/Schema Module +-- HGamer3D/Internal/Event Module -- -module HGamer3D.Extensions.Schema +module HGamer3D.Internal.Event -( - module HGamer3D.Schema -) where +where - import HGamer3D.Schema +import HGamer3D.WinEvent +import HGamer3D.GUI + +data HG3DEvent = WindowEvt SDLEvent + | GUIEvt GUIEvent + + + diff --git a/Main/HGamer3D/Internal/GameLoop.hs b/Main/HGamer3D/Internal/GameLoop.hs index d192ddc..22097ec 100644 --- a/Main/HGamer3D/Internal/GameLoop.hs +++ b/Main/HGamer3D/Internal/GameLoop.hs @@ -37,44 +37,52 @@ module HGamer3D.Internal.GameLoop import HGamer3D.Graphics3D import HGamer3D.WinEvent import HGamer3D.GUI + + import HGamer3D.Internal.Event -- need a couple of internal functions from base modules, to implement game loop import HGamer3D.Graphics3D.Internal.Base (renderOneFrame, graphics3DPumpWindowMessages, checkQuitReceived) - import HGamer3D.GUI.Internal.Base (pollGUIEvents, initGUI, injectWinEventToGUI) + import HGamer3D.GUI.Internal.Base (pollGUIEvent, initGUI, injectWinEventToGUI) import HGamer3D.WinEvent.Internal.Base (attachToWindow) import qualified System.Info as SI - data HG3DEvent = EventWindow SDLEvent | EventGUI [GUIEvent] - freeHGamer3D :: Graphics3DSystem -> GUISystem -> IO () freeHGamer3D g3ds guis = do freeGraphics3D g3ds - -- the game loops works in a way, that window events are much faster processed then + -- | Game Loop + -- The game loop works in a way, that window events are much faster processed then -- update of rendering -> all events needs to be cleared, then next renderOneFrame is processed - - stepHGamer3D :: Graphics3DSystem -> GUISystem -> IO (Maybe HG3DEvent, Bool) + -- after that the call returns. + stepHGamer3D :: Graphics3DSystem -- ^ the Graphics System + -> GUISystem -- ^ the GUI System + -> IO ([HG3DEvent], Bool) -- ^ list of Events received, quit flag (True if quit received) + stepHGamer3D g3ds guis = do - + + let oneStep quitReceived events = do -- this one is quite tricky, on Linux we need to call the message loop in addition to WinEvent! if SI.os /= "mingw32" then graphics3DPumpWindowMessages else return () i <- checkQuitReceived - - evt <- pollWinEvent - case evt of - Just sdlEvt -> do - injectWinEventToGUI guis sdlEvt -- inject event into gui - return (Just (EventWindow sdlEvt), (i == 1) ) - _ -> do - gevts <- pollGUIEvents guis - if length gevts > 0 then - return (Just (EventGUI gevts), (i == 1) ) - else do - renderOneFrame g3ds - return (Nothing, (i == 1) ) - + let quitReceived' = quitReceived || (i == 1) + mWinEvt <- pollWinEvent + case mWinEvt of + Just winEvt -> do + injectWinEventToGUI guis winEvt -- inject event into gui + let events' = events ++ [WindowEvt winEvt] + oneStep quitReceived' events' + Nothing -> do + mGuiEvt <- pollGUIEvent guis + case mGuiEvt of + Just guiEvt -> do + let events' = events ++ [GUIEvt guiEvt] + oneStep quitReceived' events' + Nothing -> do + renderOneFrame g3ds + return (events, quitReceived') + oneStep False [] initHGamer3D :: String -- ^ Window Title -> Bool -- ^ Flag show config dialogue diff --git a/Main/HGamer3D/Modules/Network.hs b/Main/HGamer3D/NetworkModule/BaseAPI.hs similarity index 95% rename from Main/HGamer3D/Modules/Network.hs rename to Main/HGamer3D/NetworkModule/BaseAPI.hs index f51b42d..40872aa 100644 --- a/Main/HGamer3D/Modules/Network.hs +++ b/Main/HGamer3D/NetworkModule/BaseAPI.hs @@ -19,10 +19,11 @@ -- HGamer3D Modules/Network Module -- -module HGamer3D.Modules.Network +module HGamer3D.NetworkModule.BaseAPI ( module HGamer3D.Network + ) where import HGamer3D.Network diff --git a/Main/SConstruct b/Main/SConstruct index 87020aa..b16db7b 100644 --- a/Main/SConstruct +++ b/Main/SConstruct @@ -17,7 +17,9 @@ dependsOn = [ "HGamer3D/BaseAPI.hs", Glob("HGamer3D/Modules/*"), Glob("HGamer3D/Extensions/*"), + Glob("HGamer3D/Schema/*"), Glob("HGamer3D/Internal/*"), + Glob("HGamer3D/Internal/ECS/*"), Glob("*.cabal"), "LICENSE", diff --git a/Schema/HGamer3D-Schema.cabal b/Schema/HGamer3D-Schema.cabal deleted file mode 100644 index 4dcf75c..0000000 --- a/Schema/HGamer3D-Schema.cabal +++ /dev/null @@ -1,34 +0,0 @@ -Name: HGamer3D-Schema -Version: 0.4.0 -Synopsis: Game Engine for the Haskell Programmer - Data Scheme Definitions -Description: - HGamer3D is a game engine for developing 3D games in the programming - language Haskell. HGamer3D is available on Windows and Linux. - - This module provides functional data structures for all aspects of the framework, being really a "schema" for HGamer3D. - -License: OtherLicense -License-file: LICENSE -Author: Peter Althainz -Maintainer: althainz@gmail.com -Build-Type: Simple -Cabal-Version: >=1.4 -Homepage: http://www.hgamer3d.org -Category: Game Engine -Extra-source-files: Setup.hs - -Library - Build-Depends: base >= 3 && < 5, containers, mtl, template-haskell, indents, parsec, lens, HGamer3D-Data >= 0.4.0 && < 0.5.0 - - Exposed-modules: HGamer3D.Schema.Scene, HGamer3D.Schema.Geometry, HGamer3D.Schema.Material, HGamer3D.Schema.Colour, HGamer3D.Schema.Texture, HGamer3D.Schema.Node, HGamer3D.Schema.Camera, HGamer3D.Schema.Light, HGamer3D.Schema.Parser - - Other-modules: - - c-sources: - - ghc-options: - cc-options: -Wno-attributes - hs-source-dirs: . - Include-dirs: . - build-depends: - extra-libraries: diff --git a/Schema/HGamer3D/Schema/Geometry.hs b/Schema/HGamer3D/Schema/Geometry.hs deleted file mode 100644 index 51afd78..0000000 --- a/Schema/HGamer3D/Schema/Geometry.hs +++ /dev/null @@ -1,62 +0,0 @@ -{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} - --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Scene.hs - --- | Types which describe the Geometry -module HGamer3D.Schema.Geometry - -where - -import qualified HGamer3D.Data as D - -import Control.Lens - -import HGamer3D.Data.Vector.Instances - --- | Geometry Type -data Geometry = MeshGeometry Mesh -- ^ a Mesh as Geometry - | LineGeometry Line -- ^ a Line as Geometry - | PrimitiveGeometry Primitive -- ^ a Geometry Primitive, like Cube or Sphere - deriving (Eq, Show) - --- | Primitive Geometries, Solids -data Primitive = Cuboid Float - | Cube D.Vec3 - | Sphere Float - | Cylinder D.Vec2 - | Cone D.Vec2 - | SquarePyramid D.Vec2 - | TriangularPyramid D.Vec2 - deriving (Eq, Show) - --- | A Mesh -data Mesh = ResourceMesh String - deriving (Eq, Show) - --- | A Line -data Line = Line D.Vec3 D.Vec3 deriving (Eq, Show) - -$(makePrisms ''Geometry) -$(makePrisms ''Primitive) -$(makePrisms ''Mesh) -$(makePrisms ''Line) - - diff --git a/Schema/HGamer3D/Schema/Node.hs b/Schema/HGamer3D/Schema/Node.hs deleted file mode 100644 index 5f0d24e..0000000 --- a/Schema/HGamer3D/Schema/Node.hs +++ /dev/null @@ -1,67 +0,0 @@ -{-# LANGUAGE FlexibleContexts, StandaloneDeriving, TemplateHaskell #-} - --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Node.hs - --- | Types which describe Materials -module HGamer3D.Schema.Node - -where - -import qualified HGamer3D.Data as Dat -import HGamer3D.Data.Vector.Instances -import qualified Data.Map as Map -import Control.Lens - -import qualified HGamer3D.Schema.Material as Mat -import qualified HGamer3D.Schema.Texture as Tex -import qualified HGamer3D.Schema.Colour as Col -import qualified HGamer3D.Schema.Light as Li -import qualified HGamer3D.Schema.Camera as Cam -import qualified HGamer3D.Schema.Scene as Sc -import qualified HGamer3D.Schema.Geometry as Geo - -deriving instance Eq Dat.UnitQuaternion - - --- | a SceneNode, making up the scene hierarchy and their spacial layout -data Node = Node { - _position :: Dat.Vec3, - _size :: Dat.Vec3, - _orientation :: Dat.UnitQuaternion, - - _materials :: Map.Map Mat.MaterialSlot Mat.Material, -- ^ slots for Materials, referenced by Geometries - _textures :: Map.Map Tex.TextureSlot Tex.Texture, -- ^ slots for Textures, referenced by Materials and Geometries directly - _colours :: Map.Map Col.ColourSlot Dat.Colour, -- ^ slots for Colours, referenced by Materials and Geometries directly - - _attributes :: [NodeAttribute], -- ^ attributes are the "content" of the node - _children :: [Node] -- ^ child nodes, make up the hierarchy - } deriving (Eq, Show) - -data NodeAttribute = SceneAttribute Sc.Scene -- ^ A node, which contains all scene info, like coordinate system - | CameraAttribute Cam.Camera -- ^ Camera - | LightAttribute Li.Light -- ^ Light - | GeometryAttribute Geo.Geometry -- ^ All types of Geometry: Meshes, Lines, ... - deriving (Eq, Show) - -$(makeLenses ''Node) -$(makePrisms ''NodeAttribute) - - diff --git a/Schema/HGamer3D/Schema/Scene.hs b/Schema/HGamer3D/Schema/Scene.hs deleted file mode 100644 index d938844..0000000 --- a/Schema/HGamer3D/Schema/Scene.hs +++ /dev/null @@ -1,47 +0,0 @@ -{-# LANGUAGE FlexibleContexts, StandaloneDeriving, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, TemplateHaskell #-} - --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Scene.hs - --- | Types which describe the Scene, the high level of a Scene Tree -module HGamer3D.Schema.Scene - -where - -import HGamer3D.Data -import HGamer3D.Util - -import Control.Lens - --- | The type of coordinate system -data CoordinateSystem = YUpRight -- ^ Y achsis up, right handed, like many 3D modelling programs and game engines (Ogre) - | ZUpRight -- ^ Z achsis up, right handed, like Blender and typical CAD programs - | YUpLeft -- ^ Y achsis up, z into the screen, this is a left handed coordinate system (exotic) - deriving (Eq, Show) - --- | The Scene, high level construct of scene tree -data Scene = Scene { - _sceneCoordinate :: CoordinateSystem -- ^ the coordinate system, used in this scene -} deriving (Eq, Show) - -$(makePrisms ''CoordinateSystem) -$(makeFields ''Scene) - - diff --git a/Schema/LICENSE b/Schema/LICENSE deleted file mode 100644 index ab17386..0000000 --- a/Schema/LICENSE +++ /dev/null @@ -1,34 +0,0 @@ -LICENSE -------- - -(c) 2011-2014 Peter Althainz - - -HGamer3D (http://www.hgamer3d.org) ----------------------------------- - -HGamer3D is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - -Source Code ------------ -You can obtain the latest version of the source code under http://www.bitbucket.org/althainz/HGamer3D - - -Open Source Software Used - Module HGamer3D.Data ------------------------------------------------- - -HGamer3D uses a number of open source software libraries. You are responsible to comply to the licenses of those packages and the licenses of software used by those packages if you use HGamer3D. - -The HGamer3D.Data module uses the following Haskell libraries from Hackage: - -base, license: BSD3 -FindBin, license: BSD3 -directory, license: BSD3 -filepath, license: BSD3 -vect, license: license: BSD3 - diff --git a/Schema/SConstruct b/Schema/SConstruct deleted file mode 100644 index e839647..0000000 --- a/Schema/SConstruct +++ /dev/null @@ -1,37 +0,0 @@ -# SConstruct file to build Haskell packages for Schema Module -# ########################################################### - -# set environment -################# -from os.path import expanduser -import os -home = expanduser("~") -env = Environment() -env["ENV"]["PATH"] = os.environ.get("PATH") -env["ENV"]["HOME"] = os.environ.get("HOME") - -# Gather main dependencies -########################## - -dependsOn = [ - Glob("HGamer3D/*"), - Glob("HGamer3D/Scheme/*"), - Glob("*.cabal"), - "LICENSE", - - Glob("../Data/dist/HGamer3D-*.tar.gz"), -] - -target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] - -env.Command(target, dependsOn, [ - -"ghc-pkg unregister HGamer3D || true", -"ghc-pkg unregister HGamer3D-Wire || true", - -"cabal configure --user", -"cabal build", -"cabal haddock", -"cabal install --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", -"cabal sdist" -]) diff --git a/Schema/Setup.hs b/Schema/Setup.hs deleted file mode 100644 index 5c383dc..0000000 --- a/Schema/Setup.hs +++ /dev/null @@ -1,22 +0,0 @@ --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Setup.hs - -import Distribution.Simple -main = defaultMain From d77fed64ea5a2d67c93d4d57fa75585c03c4b4e7 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Thu, 10 Jul 2014 11:18:17 +0200 Subject: [PATCH 05/28] fixed GUI-Widget example --- Examples/GUI/GUI-Widgets.hs | 39 ++++++++++++++++--------------- Graphics3D/HGamer3D/Graphics3D.hs | 29 +++++------------------ Main/HGamer3D/BaseAPI.hs | 3 ++- 3 files changed, 28 insertions(+), 43 deletions(-) diff --git a/Examples/GUI/GUI-Widgets.hs b/Examples/GUI/GUI-Widgets.hs index 76923c0..7e3f766 100644 --- a/Examples/GUI/GUI-Widgets.hs +++ b/Examples/GUI/GUI-Widgets.hs @@ -83,27 +83,30 @@ printEvent outbox event = do checkEvents outtext g3ds guis = do - (evt, qFlag) <- stepHGamer3D g3ds guis + (evts, qFlag) <- stepHGamer3D g3ds guis if qFlag then return False - else - case evt of - Just (EventGUI evts) -> do - mapM (printEvent outtext) evts - return True - Just (EventWindow (EvtQuit ts)) -> return False - _ -> return True + else do + qList <- mapM (\evt -> do + case evt of + (GUIEvt guiEvt) -> do + printEvent outtext guiEvt + return False + (WindowEvt (EvtQuit ts)) -> return True + _ -> return False + ) evts + return $ length (filter id qList) == 0 -renderLoop cube outtext g3ds guis = do +renderLoop cubeF outtext g3ds guis = do -- rotate - yaw cube (Rad 0.005) - roll cube (Rad 0.002) + orientation cubeF >>= \o -> return (yaw o (Rad 0.005)) >>= orientationTo cubeF + orientation cubeF >>= \o -> return (roll o (Rad 0.002)) >>= orientationTo cubeF proceed <- checkEvents outtext g3ds guis - if proceed then renderLoop cube outtext g3ds guis else return () + if proceed then renderLoop cubeF outtext g3ds guis else return () main = do - (g3ds, guis, camera, viewport) <- initHGamer3D "HGamer3D - GUI Widgets Example" True False True + (g3ds, guis, camera, viewport) <- initHGamer3D "HGamer3D - GUI Widgets Example" True True True -- camera position let pos = Vec3 5.0 5.0 80.0 @@ -117,11 +120,9 @@ main = do pointLight g3ds white (Vec3 10.0 10.0 20.0) -- create a shiny blue cube - let cube = cubeMesh - let blueMat = resourceMaterial "Colours/Blue" - cube <- object3DFromMesh g3ds cube (Just blueMat) False - positionTo cube (Vec3 0.0 0.0 0.0) - scale cube (Vec3 0.2 0.2 0.2) + cubeFigure <- cube g3ds 0.2 (ResourceMaterial "Colours/Blue") + positionTo cubeFigure (Vec3 0.0 0.0 0.0) + sizeTo cubeFigure (Vec3 0.2 0.2 0.2) -- GUI Code starts here, display hg3d logo loadGuiScheme guis "hg3d.scheme" @@ -193,6 +194,6 @@ main = do registerGUIEvent guis combobox "ListSelectionAccepted" "combo-done" -- start render loop - renderLoop cube outtext g3ds guis + renderLoop cubeFigure outtext g3ds guis freeHGamer3D g3ds guis return () diff --git a/Graphics3D/HGamer3D/Graphics3D.hs b/Graphics3D/HGamer3D/Graphics3D.hs index 447bcfa..d060090 100644 --- a/Graphics3D/HGamer3D/Graphics3D.hs +++ b/Graphics3D/HGamer3D/Graphics3D.hs @@ -42,7 +42,7 @@ module HGamer3D.Graphics3D cube, cuboid, - -- * Light + -- * Light Light, HGamer3D.Graphics3D.Internal.Light.setAmbientLight, pointLight, @@ -51,28 +51,8 @@ module HGamer3D.Graphics3D setSpotLightAngle, directionalLight, - {- - -- * Materials - resourceMaterial, - - -- * Meshes - sphereMesh, - cubeMesh, - planeMesh, - resourceMesh, - - colouredCubeMesh, - colouredLineMesh, - rainbowCubeMesh, - - ikosaederMesh, - dodekaederMesh, - - -- * Graphics Objects - object3DFromMesh, - object3DFromObjects, - --} + -- * Material + Material (..), -- * Misc Functions @@ -92,6 +72,9 @@ where import HGamer3D.Graphics3D.Internal.Base import HGamer3D.Graphics3D.Internal.Light import HGamer3D.Graphics3D.Internal.Shapes + + import HGamer3D.Graphics3D.Schema.Material + -- import HGamer3D.Graphics3D.Internal.PlatonShapes diff --git a/Main/HGamer3D/BaseAPI.hs b/Main/HGamer3D/BaseAPI.hs index 4b64277..5b94d8b 100644 --- a/Main/HGamer3D/BaseAPI.hs +++ b/Main/HGamer3D/BaseAPI.hs @@ -45,4 +45,5 @@ module HGamer3D.BaseAPI import HGamer3D.WinEvent import HGamer3D.GUI - import HGamer3D.Internal.GameLoop + import HGamer3D.Internal.GameLoop + import HGamer3D.Internal.Event From 87defd9a79f68ae2aac0b5cb53877824eeb473f4 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Thu, 10 Jul 2014 20:07:29 +0200 Subject: [PATCH 06/28] AudioSystem first try --- Audio/HGamer3D-Audio.cabal | 4 +- Audio/HGamer3D/Audio.hs | 7 +- Audio/HGamer3D/Audio/Internal/Base.hs | 50 ++++- Audio/HGamer3D/Audio/Schema/AudioListener.hs | 34 ++++ Audio/HGamer3D/Audio/Schema/AudioSource.hs | 50 +++++ Main/HGamer3D.cabal | 2 +- Main/HGamer3D/AudioModule/EcsAPI.hs | 35 ++++ .../AudioModule/Internal/SystemAudio.hs | 183 ++++++------------ Main/HGamer3D/Internal/ECS/ComponentType.hs | 13 +- Main/HGamer3D/Internal/Event.hs | 6 +- 10 files changed, 252 insertions(+), 132 deletions(-) create mode 100644 Audio/HGamer3D/Audio/Schema/AudioListener.hs create mode 100644 Audio/HGamer3D/Audio/Schema/AudioSource.hs create mode 100644 Main/HGamer3D/AudioModule/EcsAPI.hs diff --git a/Audio/HGamer3D-Audio.cabal b/Audio/HGamer3D-Audio.cabal index d9de1d5..f17b6fb 100644 --- a/Audio/HGamer3D-Audio.cabal +++ b/Audio/HGamer3D-Audio.cabal @@ -18,9 +18,9 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-SFML-Binding >= 0.4.0 && < 0.5.0 + Build-Depends: base >= 3 && < 5, containers, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-SFML-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Audio.Internal.Base, HGamer3D.Audio + Exposed-modules: HGamer3D.Audio.Schema.AudioSource, HGamer3D.Audio.Schema.AudioListener, HGamer3D.Audio.Internal.Base, HGamer3D.Audio Other-modules: c-sources: diff --git a/Audio/HGamer3D/Audio.hs b/Audio/HGamer3D/Audio.hs index bb8b248..f8bc1b0 100644 --- a/Audio/HGamer3D/Audio.hs +++ b/Audio/HGamer3D/Audio.hs @@ -26,6 +26,7 @@ module HGamer3D.Audio -- * Audio Data Types module HGamer3D.Bindings.SFML.EnumSoundSourceStatus, AudioSource, + AudioSlots, -- * Audio Listener Functions setAudioMainVolume, @@ -63,7 +64,11 @@ module HGamer3D.Audio setAudioSourceMinDistance, setAudioSourcePositionDependent, - isAudioSourcePositionDependent + isAudioSourcePositionDependent, + + audioSlots, + updateAudioSlots + ) diff --git a/Audio/HGamer3D/Audio/Internal/Base.hs b/Audio/HGamer3D/Audio/Internal/Base.hs index b5e3995..6a7c7a7 100644 --- a/Audio/HGamer3D/Audio/Internal/Base.hs +++ b/Audio/HGamer3D/Audio/Internal/Base.hs @@ -29,6 +29,7 @@ module HGamer3D.Audio.Internal.Base module HGamer3D.Bindings.SFML.EnumSoundSourceStatus, AudioSource (..), + AudioSlots (..), -- * Audio Listener Functions setAudioMainVolume, @@ -66,8 +67,11 @@ module HGamer3D.Audio.Internal.Base setAudioSourceMinDistance, setAudioSourcePositionDependent, - isAudioSourcePositionDependent - + isAudioSourcePositionDependent, + + -- * Audio Source ECS functions + audioSlots, + updateAudioSlots ) where @@ -93,13 +97,18 @@ import qualified HGamer3D.Bindings.SFML.ClassSoundStream as SoundStream import HGamer3D.Bindings.SFML.EnumSoundSourceStatus import HGamer3D.Bindings.SFML.EnumSoundSourceStatus +import qualified HGamer3D.Audio.Schema.AudioSource as AS +import qualified HGamer3D.Audio.Schema.AudioListener as AL + import Control.Monad +import qualified Data.Map as M +import Data.Maybe -- Source types data AudioSource = Music HG3DClass | Sound HG3DClass HG3DClass - +data AudioSlots = AudioSlots (M.Map String AudioSource) AS.AudioSlots -- Listener Functions @@ -301,3 +310,38 @@ isAudioSourcePositionDependent :: AudioSource -> IO Bool isAudioSourcePositionDependent (Music s) = SoundSource.isRelativeToListener s isAudioSourcePositionDependent (Sound s b) = SoundSource.isRelativeToListener s + +-- | create AudioSlots from pure data definition out of Schema +audioSlots :: AS.AudioSlots -> IO AudioSlots +audioSlots schema@(AS.AudioSlots asList) = do + let makeSource asource = do + -- create source + (source, parameter) <- case asource of + AS.MusicSource name parameter -> musicAudioSource name >>= \s -> return (fromJust s, parameter) + AS.SoundSource name parameter -> soundAudioSource name >>= \s -> return (fromJust s, parameter) + -- set all parameters + setAudioSourceVolume source (AS.volume parameter) + setAudioSourceLoop source (AS.loopFlag parameter) + setAudioSourcePositionDependent source (AS.positionFlag parameter) + setAudioSourcePitch source (AS.pitch parameter) + setAudioSourceAttenuation source (AS.attenuation parameter) + setAudioSourceMinDistance source (AS.minDistance parameter) + return source + + obList <- mapM (\(s, as) -> makeSource as >>= \ob -> return (s, ob)) asList + return $ AudioSlots (M.fromList obList) schema + +-- | update AudioSlots from change in data definition +updateAudioSlots :: AudioSlots -> AS.AudioSlots -> IO AudioSlots +updateAudioSlots inSlots newSlots = return inSlots + + +instance HasPosition AudioSource where + position = getAudioSourcePosition + positionTo = setAudioSourcePosition + +instance HasPosition AudioSlots where + position (AudioSlots map _) = position (snd ((M.toList map) !! 0)) + positionTo (AudioSlots map _) pos = (mapM (\as -> positionTo as pos) (fmap snd (M.toList map))) >> return () + + diff --git a/Audio/HGamer3D/Audio/Schema/AudioListener.hs b/Audio/HGamer3D/Audio/Schema/AudioListener.hs new file mode 100644 index 0000000..51eb450 --- /dev/null +++ b/Audio/HGamer3D/Audio/Schema/AudioListener.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Audio/Schema/AudioListener.hs + +-- | data types which describes the one Audio Listener +module HGamer3D.Audio.Schema.AudioListener + +where + +import qualified HGamer3D.Data as D +import Data.Typeable + +-- | The Source itself +data AudioListener = AudioListener { + mainVolume :: Float -- ^ Main Volume +} diff --git a/Audio/HGamer3D/Audio/Schema/AudioSource.hs b/Audio/HGamer3D/Audio/Schema/AudioSource.hs new file mode 100644 index 0000000..bec23a0 --- /dev/null +++ b/Audio/HGamer3D/Audio/Schema/AudioSource.hs @@ -0,0 +1,50 @@ +{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Audio/Schema/AudioSource.hs + +-- | data types which describes an Audio Source +module HGamer3D.Audio.Schema.AudioSource + +where + +import qualified HGamer3D.Data as D +import Data.Typeable + +-- | The Source itself +data AudioSource = MusicSource String AudioSourceParameter + | SoundSource String AudioSourceParameter + deriving (Eq, Show, Typeable) + +-- | Audio Parameter +data AudioSourceParameter = Parameter { + volume :: Float, -- ^ Volume 0.0 - 100.0 + loopFlag :: Bool, -- ^ is sound looping + positionFlag :: Bool, -- ^ is sound position dependent + pitch :: Float, -- ^ Frequency change, 1.0 no change + attenuation :: Float, -- ^ Damping factor by distance, default 1.0, 0.0 no damping + minDistance :: Float -- ^ at min distance, sound is played with volume 100.0 +} deriving (Eq, Show, Typeable) + +-- | Audio Slots +data AudioSlots = AudioSlots [(String, AudioSource)] deriving (Eq, Show, Typeable) + + + diff --git a/Main/HGamer3D.cabal b/Main/HGamer3D.cabal index 12acae9..9288a15 100644 --- a/Main/HGamer3D.cabal +++ b/Main/HGamer3D.cabal @@ -47,7 +47,7 @@ Library if flag(audio) build-depends: HGamer3D-Audio >= 0.4 && < 0.5 - exposed-modules: HGamer3D.AudioModule.BaseAPI + exposed-modules: HGamer3D.AudioModule.Internal.SystemAudio, HGamer3D.AudioModule.BaseAPI, HGamer3D.AudioModule.EcsAPI if flag(network) build-depends: HGamer3D-Network >= 0.4 && < 0.5 diff --git a/Main/HGamer3D/AudioModule/EcsAPI.hs b/Main/HGamer3D/AudioModule/EcsAPI.hs new file mode 100644 index 0000000..6351acc --- /dev/null +++ b/Main/HGamer3D/AudioModule/EcsAPI.hs @@ -0,0 +1,35 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/AudioModule/EcsAPI +-- + +module HGamer3D.AudioModule.EcsAPI + +( + AudioListener (..), + AudioSource (..), + AudioSourceParameter (..), + + runECSAudio, + +) where + + import HGamer3D.Audio.Schema.AudioListener + import HGamer3D.Audio.Schema.AudioSource + import HGamer3D.AudioModule.Internal.SystemAudio diff --git a/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs b/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs index a9c81a6..5b5e66c 100644 --- a/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs +++ b/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs @@ -18,68 +18,59 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- HGamer3D/Internal/ECS/SystemGraphics3D.hs +-- HGamer3D/AudioModule/Internal/SystemAudio.hs --- | the Graphics3D System of the Entity-Component-System World module HGamer3D.AudioModule.Internal.SystemAudio where import Control.Concurrent.MVar -import HGamer3D.Internal.ECS.Component import qualified Data.Map as M import Data.Maybe import Data.Typeable import Data.Dynamic +import Data.Hashable +import qualified Data.HashTable.IO as HT +import qualified HGamer3D.Data as D + +import HGamer3D.Internal.Event import HGamer3D.Internal.ECS.Entity import HGamer3D.Internal.ECS.Component import HGamer3D.Internal.ECS.ComponentType import HGamer3D.Internal.ECS.System -import Data.Hashable -import qualified Data.HashTable.IO as HT - -import qualified HGamer3D.BaseAPI as BA - -import HGamer3D.Graphics3D.Schema.Figure -import HGamer3D.Graphics3D.Schema.Geometry -import HGamer3D.Graphics3D.Schema.Material - - --- the system of entity component system, in general a system has internal state --- entities can be added to it and the system has a step function, to run it --- Systems are self-contained, so they can be run in a thread and manage their state themselves +import qualified HGamer3D.Audio as A +import qualified HGamer3D.Audio.Schema.AudioSource as AS +import qualified HGamer3D.Audio.Schema.AudioListener as AL type IdHashTable v = HT.BasicHashTable ComponentId v -data ECSGraphics3D = ECSGraphics3D { - g3d :: (BA.Graphics3DSystem, BA.GUISystem, BA.Camera, BA.Viewport), - figures :: MVar [(Component, Maybe Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori, size)] - figCache :: IdHashTable ( - BA.Object3D Figure, - StampedValue Figure, - Maybe (StampedValue BA.Position), - Maybe (StampedValue BA.Orientation), - Maybe (StampedValue BA.Size) - ) - } - -instance System ECSGraphics3D where - - addEntity ecsg3d entity = do - oldList <- takeMVar (figures ecsg3d) - let mFig = entity #? CTFig - let newList = case mFig of - Just fig -> let - (p, o, s) = (entity #? CTPos, entity #? CTOri, entity #? CTSiz) - in ((fig, p, o, s) : oldList) +-- | the Audio System of the Entity-Component-System World +data ECSAudio = ECSAudio { + audioSlots :: MVar [(Component, Maybe Component)], -- AudioSlots, Position + audioSlotsCache :: IdHashTable ( + A.AudioSlots, + StampedValue AS.AudioSlots, + Maybe (StampedValue D.Position) + ) + } + +instance System ECSAudio where + + addEntity system entity = do + oldList <- takeMVar (audioSlots system) + let mCom = entity #? CTASl + let newList = case mCom of + Just com -> let + p = entity #? CTPos + in ((com, p) : oldList) Nothing -> oldList - putMVar (figures ecsg3d) newList - return ecsg3d + putMVar (audioSlots system) newList + return system - removeEntity ecsg3d entity = return ecsg3d + removeEntity system entity = return system {- removeEntity ecsg3d entity = do @@ -91,89 +82,41 @@ instance System ECSGraphics3D where -} initializeSystem = do - g3d <- BA.initHGamer3D "HGamer3D - System" True True True - setupBasicCamera g3d - figures <- newMVar [] - figCache <- HT.new - return $ (ECSGraphics3D g3d figures figCache) - - - stepSystem ecsg3d = do - let (g3ds, guis, camera, viewport) = (g3d ecsg3d) - -- update 3d objects - cList <- takeMVar (figures ecsg3d) - mapM (\(cf, mcp, mco, mcs) -> do + audioSlots <- newMVar [] + audioSlotsCache <- HT.new + return $ (ECSAudio audioSlots audioSlotsCache) + + stepSystem system = do + -- update audio objects + cList <- takeMVar (audioSlots system) + mapM (\(com, mcp) -> do -- handle changes per single entity item - figTVal <- readC cf >>= return . fromJust - let newFig = fromStamped figTVal - mCache <- HT.lookup (figCache ecsg3d) (idC cf) - -- first create/update the figure object - newOb <- case mCache of - Nothing -> BA.object3D g3ds newFig - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if oldFig /= figTVal then BA.update3D g3ds oldOb newFig else return oldOb - -- then handle the POS information - Position + comTVal <- readC com >>= return . fromJust + let newCom = fromStamped comTVal + mOldCache <- HT.lookup (audioSlotsCache system) (idC com) + -- first create/update the audiosource object + newOb <- case mOldCache of + Nothing -> A.audioSlots newCom + Just (oldOb, oldComTVal, mPos) -> if oldComTVal /= comTVal then A.updateAudioSlots oldOb newCom else return oldOb + -- then handle the PO information - Position newPos <- case mcp of Just cp -> do - cpTVal <- readC cp >>= return . fromJust - let cpVal = fromStamped cpTVal - case mCache of - Nothing -> BA.positionTo newOb cpVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mPos) /= cpTVal then BA.positionTo newOb cpVal else return () - return $ Just cpTVal - Nothing -> return Nothing - -- then handle the POS information - Orientation - newOri <- case mco of - Just co -> do - coTVal <- readC co >>= return . fromJust - let coVal = fromStamped coTVal - case mCache of - Nothing -> BA.orientationTo newOb coVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mOri) /= coTVal then BA.orientationTo newOb coVal else return () - return $ Just coTVal - Nothing -> return Nothing - -- then handle the POS information - Size - newSiz <- case mcs of - Just cs -> do - csTVal <- readC cs >>= return . fromJust - let csVal = fromStamped csTVal - case mCache of - Nothing -> BA.sizeTo newOb csVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mSiz) /= csTVal then BA.sizeTo newOb csVal else return () - return $ Just csTVal + posTVal <- readC cp >>= return . fromJust + let posVal = fromStamped posTVal + case mOldCache of + Nothing -> D.positionTo newOb posVal + Just (oldOb, oldComTVal, mPos) -> if (fromJust mPos) /= posTVal then D.positionTo newOb posVal else return () + return $ Just posTVal Nothing -> return Nothing -- insert new values into cache - HT.insert (figCache ecsg3d) (idC cf) (newOb, figTVal, newPos, newOri, newSiz) + HT.insert (audioSlotsCache system) (idC com) (newOb, comTVal, newPos) ) cList - putMVar (figures ecsg3d) cList - -- run graphics - (evt, qFlag) <- BA.stepHGamer3D g3ds guis - return (ecsg3d, qFlag) - - shutdownSystem ecsg3d = do - let (g3ds, guis, camera, viewport) = (g3d ecsg3d) - BA.freeHGamer3D g3ds guis - return () - -runECSGraphics3D :: BA.TimeMS -> IO ECSGraphics3D -runECSGraphics3D sleepT = runSystem sleepT - - -setupBasicCamera g3d = do - let (g3ds, guis, camera, viewport) = g3d - -- camera position - let pos = BA.Vec3 5.0 5.0 80.0 - BA.positionTo camera pos - let at = BA.Vec3 0.0 0.0 (-300.0) - BA.cameraLookAt camera at - - -- define light - - BA.setAmbientLight g3ds BA.white - BA.pointLight g3ds BA.white (BA.Vec3 10.0 10.0 20.0) - - -- GUI Code starts here, display hg3d logo - BA.loadGuiScheme guis "hg3d.scheme" - logo <- BA.loadGuiLayoutFromFile guis "hgamer3d.layout" "" - BA.addGuiElToDisplay guis logo - - return () + putMVar (audioSlots system) cList + return (system, False) + + shutdownSystem system = return () + +runECSAudio :: D.TimeMS -> IO ECSAudio +runECSAudio sleepT = runSystem sleepT + + diff --git a/Main/HGamer3D/Internal/ECS/ComponentType.hs b/Main/HGamer3D/Internal/ECS/ComponentType.hs index f4ba09a..1badb6e 100644 --- a/Main/HGamer3D/Internal/ECS/ComponentType.hs +++ b/Main/HGamer3D/Internal/ECS/ComponentType.hs @@ -23,10 +23,15 @@ module HGamer3D.Internal.ECS.ComponentType where -data ComponentType = CTPos - | CTOri - | CTSiz - | CTFig +-- | Possible Component Types, which are known, this list needs to be extended, if +-- additional components are introduced. Each component can occur only once in +-- an Entity. +data ComponentType = CTPos -- ^ Position + | CTOri -- ^ Orientation + | CTSiz -- ^ Size + | CTFig -- ^ Figure + | CTASl -- ^ Audio Slots + | CTALs -- ^ Audio Listener deriving (Eq, Ord, Show) diff --git a/Main/HGamer3D/Internal/Event.hs b/Main/HGamer3D/Internal/Event.hs index 56ca2da..bc326c9 100644 --- a/Main/HGamer3D/Internal/Event.hs +++ b/Main/HGamer3D/Internal/Event.hs @@ -25,9 +25,13 @@ where import HGamer3D.WinEvent import HGamer3D.GUI - + +data AudioEvent = PlaySound String + | StopSound String + data HG3DEvent = WindowEvt SDLEvent | GUIEvt GUIEvent + | AudioEvt AudioEvent From 9bd50efcb68c3b8fb2648a803e9596bf17cb051b Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Thu, 10 Jul 2014 22:10:01 +0200 Subject: [PATCH 07/28] Audio System working, with Events, start and stop --- Main/HGamer3D/AudioModule/EcsAPI.hs | 2 +- .../AudioModule/Internal/SystemAudio.hs | 26 ++++++++++++++++--- Main/SConstruct | 6 +++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Main/HGamer3D/AudioModule/EcsAPI.hs b/Main/HGamer3D/AudioModule/EcsAPI.hs index 6351acc..da92db2 100644 --- a/Main/HGamer3D/AudioModule/EcsAPI.hs +++ b/Main/HGamer3D/AudioModule/EcsAPI.hs @@ -26,7 +26,7 @@ module HGamer3D.AudioModule.EcsAPI AudioSource (..), AudioSourceParameter (..), - runECSAudio, + runSystemAudio ) where diff --git a/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs b/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs index 5b5e66c..8baad62 100644 --- a/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs +++ b/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs @@ -41,7 +41,7 @@ import HGamer3D.Internal.ECS.Component import HGamer3D.Internal.ECS.ComponentType import HGamer3D.Internal.ECS.System -import qualified HGamer3D.Audio as A +import qualified HGamer3D.Audio.Internal.Base as A import qualified HGamer3D.Audio.Schema.AudioSource as AS import qualified HGamer3D.Audio.Schema.AudioListener as AL @@ -57,6 +57,19 @@ data ECSAudio = ECSAudio { ) } +_handleEvent map evt = do + case evt of + AudioEvt (PlaySound slot) -> do + let mAS = (M.lookup slot map) + case mAS of + Just as -> A.playAudioSource as + Nothing -> return () + AudioEvt (StopSound slot) -> do + let mAS = (M.lookup slot map) + case mAS of + Just as -> A.stopAudioSource as + Nothing -> return () + instance System ECSAudio where addEntity system entity = do @@ -90,10 +103,15 @@ instance System ECSAudio where -- update audio objects cList <- takeMVar (audioSlots system) mapM (\(com, mcp) -> do + mOldCache <- HT.lookup (audioSlotsCache system) (idC com) + -- handle events + evts <- _popEvents com + case mOldCache of + Just (A.AudioSlots map _, _, _) -> mapM (_handleEvent map) evts >> return () + Nothing -> return () -- handle changes per single entity item comTVal <- readC com >>= return . fromJust let newCom = fromStamped comTVal - mOldCache <- HT.lookup (audioSlotsCache system) (idC com) -- first create/update the audiosource object newOb <- case mOldCache of Nothing -> A.audioSlots newCom @@ -116,7 +134,7 @@ instance System ECSAudio where shutdownSystem system = return () -runECSAudio :: D.TimeMS -> IO ECSAudio -runECSAudio sleepT = runSystem sleepT +runSystemAudio :: D.TimeMS -> IO ECSAudio +runSystemAudio sleepT = runSystem sleepT diff --git a/Main/SConstruct b/Main/SConstruct index b16db7b..6f3b282 100644 --- a/Main/SConstruct +++ b/Main/SConstruct @@ -20,6 +20,12 @@ dependsOn = [ Glob("HGamer3D/Schema/*"), Glob("HGamer3D/Internal/*"), Glob("HGamer3D/Internal/ECS/*"), + Glob("HGamer3D/AudioModule/*"), + Glob("HGamer3D/AudioModule/Internal/*"), + Glob("HGamer3D/InputSystemModule/*"), + Glob("HGamer3D/InputSystemModule/Internal/*"), + Glob("HGamer3D/NetworkModule/*"), + Glob("HGamer3D/NetworkModule/Internal/*"), Glob("*.cabal"), "LICENSE", From 5065da974f6a4dc356d37fa8445f4f2067d10ed9 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Sat, 12 Jul 2014 19:03:11 +0200 Subject: [PATCH 08/28] big Module reorganization --- Audio/HGamer3D-Audio.cabal | 2 +- Audio/HGamer3D/{Audio.hs => Audio/BaseAPI.hs} | 2 +- Audio/HGamer3D/Audio/Internal/Base.hs | 54 +--- Audio/HGamer3D/Internal/Audio.hs | 28 ++ Audio/SConstruct | 3 +- GUI/HGamer3D-GUI.cabal | 2 +- GUI/HGamer3D/{GUI.hs => GUI/BaseAPI.hs} | 55 +--- GUI/HGamer3D/GUI/Internal/Base.hs | 64 +---- GUI/HGamer3D/GUI/Internal/Properties.hs | 1 + GUI/HGamer3D/GUI/Internal/Widgets.hs | 1 + GUI/HGamer3D/Internal/GUI.hs | 35 +++ GUI/SConstruct | 3 +- Graphics3D/HGamer3D-Graphics3D.cabal | 2 +- .../{Graphics3D.hs => Graphics3D/BaseAPI.hs} | 30 +- .../HGamer3D/Graphics3D/Internal/Base.hs | 257 ++++++------------ .../HGamer3D/Graphics3D/Internal/Light.hs | 16 +- .../Graphics3D/Internal/PlatonShapes.hs | 16 +- .../HGamer3D/Graphics3D/Internal/Shapes.hs | 90 +++--- .../HGamer3D/Graphics3D/Schema/Camera.hs | 1 - .../HGamer3D/Graphics3D/Schema/Figure.hs | 1 - .../HGamer3D/Graphics3D/Schema/Geometry.hs | 1 - .../HGamer3D/Graphics3D/Schema/Light.hs | 1 - .../HGamer3D/Graphics3D/Schema/Material.hs | 1 - Graphics3D/HGamer3D/Internal/Graphics3D.hs | 36 +++ Graphics3D/SConstruct | 3 +- InputSystem/HGamer3D-InputSystem.cabal | 2 +- .../BaseAPI.hs} | 2 +- .../HGamer3D/InputSystem/Internal/Base.hs | 1 + InputSystem/HGamer3D/Internal/InputSystem.hs | 30 ++ InputSystem/SConstruct | 3 +- Main/HGamer3D.cabal | 8 +- .../HGamer3D/{AudioModule => Audio}/EcsAPI.hs | 4 +- .../Internal/SystemAudio.hs | 15 +- Main/HGamer3D/BaseAPI.hs | 49 ---- Main/HGamer3D/Engine/BaseAPI.hs | 35 +++ Main/HGamer3D/{ => Engine}/EcsAPI.hs | 4 +- .../ECS => Engine/Internal}/Component.hs | 26 +- .../ECS => Engine/Internal}/ComponentType.hs | 3 +- .../ECS => Engine/Internal}/Entity.hs | 22 +- Main/HGamer3D/{ => Engine}/Internal/Event.hs | 8 +- .../{ => Engine}/Internal/GameLoop.hs | 37 ++- .../ECS => Engine/Internal}/System.hs | 7 +- .../Internal}/SystemGraphics3D.hs | 62 +++-- .../BaseAPI.hs => InputSystem/EcsAPI.hs} | 4 +- .../BaseAPI.hs => Internal/AudioModule.hs} | 8 +- Main/HGamer3D/Internal/Engine.hs | 40 +++ .../BaseAPI.hs => Network/EcsAPI.hs} | 4 +- Main/SConstruct | 18 +- Network/HGamer3D-Network.cabal | 2 +- Network/HGamer3D/Internal/Network.hs | 28 ++ .../{Network.hs => Network/BaseAPI.hs} | 2 +- Network/HGamer3D/Network/Internal/Base.hs | 25 +- Network/SConstruct | 3 +- WinEvent/HGamer3D-WinEvent.cabal | 2 +- WinEvent/HGamer3D/Internal/WinEvent.hs | 30 ++ .../{WinEvent.hs => WinEvent/BaseAPI.hs} | 2 +- WinEvent/HGamer3D/WinEvent/Internal/Base.hs | 1 + WinEvent/SConstruct | 3 +- 58 files changed, 535 insertions(+), 660 deletions(-) rename Audio/HGamer3D/{Audio.hs => Audio/BaseAPI.hs} (98%) create mode 100644 Audio/HGamer3D/Internal/Audio.hs rename GUI/HGamer3D/{GUI.hs => GUI/BaseAPI.hs} (53%) create mode 100644 GUI/HGamer3D/Internal/GUI.hs rename Graphics3D/HGamer3D/{Graphics3D.hs => Graphics3D/BaseAPI.hs} (74%) create mode 100644 Graphics3D/HGamer3D/Internal/Graphics3D.hs rename InputSystem/HGamer3D/{InputSystem.hs => InputSystem/BaseAPI.hs} (98%) create mode 100644 InputSystem/HGamer3D/Internal/InputSystem.hs rename Main/HGamer3D/{AudioModule => Audio}/EcsAPI.hs (91%) rename Main/HGamer3D/{AudioModule => Audio}/Internal/SystemAudio.hs (93%) delete mode 100644 Main/HGamer3D/BaseAPI.hs create mode 100644 Main/HGamer3D/Engine/BaseAPI.hs rename Main/HGamer3D/{ => Engine}/EcsAPI.hs (99%) rename Main/HGamer3D/{Internal/ECS => Engine/Internal}/Component.hs (91%) rename Main/HGamer3D/{Internal/ECS => Engine/Internal}/ComponentType.hs (94%) rename Main/HGamer3D/{Internal/ECS => Engine/Internal}/Entity.hs (88%) rename Main/HGamer3D/{ => Engine}/Internal/Event.hs (88%) rename Main/HGamer3D/{ => Engine}/Internal/GameLoop.hs (76%) rename Main/HGamer3D/{Internal/ECS => Engine/Internal}/System.hs (95%) rename Main/HGamer3D/{Internal/ECS => Engine/Internal}/SystemGraphics3D.hs (78%) rename Main/HGamer3D/{InputSystemModule/BaseAPI.hs => InputSystem/EcsAPI.hs} (88%) rename Main/HGamer3D/{AudioModule/BaseAPI.hs => Internal/AudioModule.hs} (83%) create mode 100644 Main/HGamer3D/Internal/Engine.hs rename Main/HGamer3D/{NetworkModule/BaseAPI.hs => Network/EcsAPI.hs} (89%) create mode 100644 Network/HGamer3D/Internal/Network.hs rename Network/HGamer3D/{Network.hs => Network/BaseAPI.hs} (97%) create mode 100644 WinEvent/HGamer3D/Internal/WinEvent.hs rename WinEvent/HGamer3D/{WinEvent.hs => WinEvent/BaseAPI.hs} (98%) diff --git a/Audio/HGamer3D-Audio.cabal b/Audio/HGamer3D-Audio.cabal index f17b6fb..edaaf84 100644 --- a/Audio/HGamer3D-Audio.cabal +++ b/Audio/HGamer3D-Audio.cabal @@ -20,7 +20,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, containers, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-SFML-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Audio.Schema.AudioSource, HGamer3D.Audio.Schema.AudioListener, HGamer3D.Audio.Internal.Base, HGamer3D.Audio + Exposed-modules: HGamer3D.Audio.Schema.AudioSource, HGamer3D.Audio.Schema.AudioListener, HGamer3D.Audio.Internal.Base, HGamer3D.Audio.BaseAPI, HGamer3D.Internal.Audio Other-modules: c-sources: diff --git a/Audio/HGamer3D/Audio.hs b/Audio/HGamer3D/Audio/BaseAPI.hs similarity index 98% rename from Audio/HGamer3D/Audio.hs rename to Audio/HGamer3D/Audio/BaseAPI.hs index f8bc1b0..eebf45f 100644 --- a/Audio/HGamer3D/Audio.hs +++ b/Audio/HGamer3D/Audio/BaseAPI.hs @@ -20,7 +20,7 @@ -- | Audio functionality for HGamer3D, public API. -module HGamer3D.Audio +module HGamer3D.Audio.BaseAPI ( -- * Audio Data Types diff --git a/Audio/HGamer3D/Audio/Internal/Base.hs b/Audio/HGamer3D/Audio/Internal/Base.hs index 6a7c7a7..476f9f6 100644 --- a/Audio/HGamer3D/Audio/Internal/Base.hs +++ b/Audio/HGamer3D/Audio/Internal/Base.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_HADDOCK hide #-} + -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org @@ -21,59 +23,7 @@ -- | Audio functionality for HGamer3D, internal implementation. This module also exports internal data declarations, in case they are needed. Normally you should only use HGamer3D.Audio and import that, which exhibits the public API. - module HGamer3D.Audio.Internal.Base - -( - -- * Types - module HGamer3D.Bindings.SFML.EnumSoundSourceStatus, - - AudioSource (..), - AudioSlots (..), - - -- * Audio Listener Functions - setAudioMainVolume, - getAudioMainVolume, - setAudioListenerPosition, - setAudioListenerDirection, - - -- * Audio Source creation and delete Functions - musicAudioSource, - soundAudioSource, - freeAudioSource, - - -- * Audio Source play function - playAudioSource, - pauseAudioSource, - stopAudioSource, - - -- * Audio Source property functions - setAudioSourceLoop, - getAudioSourceLoop, - - getAudioSourceVolume, - setAudioSourceVolume, - - getAudioSourcePitch, - setAudioSourcePitch, - - getAudioSourcePosition, - setAudioSourcePosition, - - getAudioSourceAttenuation, - setAudioSourceAttenuation, - - getAudioSourceMinDistance, - setAudioSourceMinDistance, - - setAudioSourcePositionDependent, - isAudioSourcePositionDependent, - - -- * Audio Source ECS functions - audioSlots, - updateAudioSlots -) - where import GHC.Ptr diff --git a/Audio/HGamer3D/Internal/Audio.hs b/Audio/HGamer3D/Internal/Audio.hs new file mode 100644 index 0000000..5308ab9 --- /dev/null +++ b/Audio/HGamer3D/Internal/Audio.hs @@ -0,0 +1,28 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Audio.hs + + +-- | Audio functionality for HGamer3D, internal API. +module HGamer3D.Internal.Audio +( + module HGamer3D.Audio.Internal.Base +) +where +import HGamer3D.Audio.Internal.Base diff --git a/Audio/SConstruct b/Audio/SConstruct index c1755fc..975481f 100644 --- a/Audio/SConstruct +++ b/Audio/SConstruct @@ -15,7 +15,8 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - "HGamer3D/Audio.hs", + "HGamer3D/Audio/BaseAPI.hs", + "HGamer3D/Internal/Audio.hs", Glob("HGamer3D/Audio/Internal/*"), Glob("*.cabal"), "LICENSE", diff --git a/GUI/HGamer3D-GUI.cabal b/GUI/HGamer3D-GUI.cabal index 41a1fed..ebead0d 100644 --- a/GUI/HGamer3D-GUI.cabal +++ b/GUI/HGamer3D-GUI.cabal @@ -20,7 +20,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, split, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-CEGUI-Binding >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.GUI.Internal.Base, HGamer3D.GUI.Internal.Widgets, HGamer3D.GUI.Internal.Properties, HGamer3D.GUI + Exposed-modules: HGamer3D.GUI.Internal.Base, HGamer3D.GUI.Internal.Widgets, HGamer3D.GUI.Internal.Properties, HGamer3D.GUI.BaseAPI, HGamer3D.Internal.GUI Other-modules: c-sources: diff --git a/GUI/HGamer3D/GUI.hs b/GUI/HGamer3D/GUI/BaseAPI.hs similarity index 53% rename from GUI/HGamer3D/GUI.hs rename to GUI/HGamer3D/GUI/BaseAPI.hs index 008bd20..f14d2a2 100644 --- a/GUI/HGamer3D/GUI.hs +++ b/GUI/HGamer3D/GUI/BaseAPI.hs @@ -18,9 +18,9 @@ -- GUI.hs --- |GUI functionality of HGamer3D, public API. Currently not usefule standalone, but used inside HGamer3D (main module). +-- |GUI functionality of HGamer3D, public API. -module HGamer3D.GUI +module HGamer3D.GUI.BaseAPI ( -- * Data Definitions, Types @@ -165,57 +165,6 @@ pValue, where -import HGamer3D.Bindings.CEGUI.ClassOgreRenderer as CEGUIOgreRenderer -import HGamer3D.Bindings.CEGUI.ClassSystem as CEGUISystem -import HGamer3D.Bindings.CEGUI.ClassSystemHG3D as CEGUISystemHG3D -import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as CEGUIWindowManagerHG3D -import HGamer3D.Bindings.CEGUI.ClassWindowManager as CEGUIWindowManager -import HGamer3D.Bindings.CEGUI.ClassResourceProvider as CEGUIResourceProvider -import HGamer3D.Bindings.CEGUI.ClassDefaultResourceProvider as CEGUIDefaultResourceProvider -import HGamer3D.Bindings.CEGUI.ClassImageset as CEGUIImageset -import HGamer3D.Bindings.CEGUI.ClassFont as CEGUIFont -import HGamer3D.Bindings.CEGUI.ClassScheme as CEGUIScheme -import HGamer3D.Bindings.CEGUI.ClassWidgetLookManager as CEGUIWidgetLookManager -import HGamer3D.Bindings.CEGUI.ClassScriptModule as CEGUIScriptModule -import HGamer3D.Bindings.CEGUI.ClassLogger as CEGUILogger -import HGamer3D.Bindings.CEGUI.EnumLoggingLevel -import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton -import HGamer3D.Bindings.CEGUI.ClassFontManager as CEGUIFontManager -import HGamer3D.Bindings.CEGUI.ClassSchemeManager as CEGUISchemeManager -import HGamer3D.Bindings.CEGUI.ClassDefaultLogger as CEGUIDefaultLogger -import HGamer3D.Bindings.CEGUI.ClassHG3DEventController as HG3DEventController -import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as HG3DWindowManager ---import HGamer3D.Bindings.Ogre.ClassHG3DMessagePump as MessagePump - - -import GHC.Ptr - -import HGamer3D.Data -import HGamer3D.Util -import HGamer3D.WinEvent - -import HGamer3D.Bindings.CEGUI.ClassPtr -import HGamer3D.Bindings.CEGUI.Utils - -import HGamer3D.Bindings.CEGUI.ClassWindow as Window -import HGamer3D.Bindings.CEGUI.ClassWindowManager as WindowManager -import HGamer3D.Bindings.CEGUI.ClassWindowManagerHG3D as WindowManagerHG3D -import HGamer3D.Bindings.CEGUI.ClassWindow as Window -import HGamer3D.Bindings.CEGUI.ClassSystem as System -import HGamer3D.Bindings.CEGUI.ClassSystemHG3D as SystemHG3D -import HGamer3D.Bindings.CEGUI.ClassPropertySet as PropertySet -import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF -import HGamer3D.Bindings.CEGUI.ClassHG3DListboxStaticFunctions as ListboxSF -import HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions as WindowSF -import HGamer3D.Bindings.CEGUI.ClassListbox as Listbox -import HGamer3D.Bindings.CEGUI.ClassListboxItem as ListboxItem -import HGamer3D.Bindings.CEGUI.ClassCombobox as Combobox -import HGamer3D.Bindings.CEGUI.EnumKeyScan - -import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF - -import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton - import HGamer3D.GUI.Internal.Base import HGamer3D.GUI.Internal.Widgets import HGamer3D.GUI.Internal.Properties diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs index 12c0a57..c3cfac8 100644 --- a/GUI/HGamer3D/GUI/Internal/Base.hs +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org @@ -21,67 +22,6 @@ -- |Base functionality of the GUI. Implementation module with internal data structures exposed. Public API in HGamer3D.GUI. module HGamer3D.GUI.Internal.Base - -( - - -- * Data Definitions, Types - - GUISystem (..), - GUIElement (..), - - GUIEvent (..), - EventFunction, - - GEButton (..), - GERadioButton (..), - GECheckBox (..), - GEEditText (..), - - GEListBox (..), - GEComboBox (..), - - GESlider (..), - GESpinner (..), - - -- * Initialization, Game Loop - initGUI, - freeGUI, - pollGUIEvent, - - -- * Event Handling - registerGUIEvent, - injectWinEventToGUI, - - -- * Layout, Scheme, Font, Mause, Tooltip - loadGuiLayoutFromFile, - loadGuiScheme, - loadGuiFont, - setGuiDefaultFont, - setGuiDefaultMouseCursor, - setGuiDefaultTooltip, - - -- * Find and display GUI Elements - getChildGuiEl, - findChildGuiElRecursive, - addGuiElToDisplay, - removeGuiElFromDisplay, - - -- * Change Gui Element Tree - addChildGuiEl, - removeChildGuiEl, - - -- * Set specific GUI Element properties - getGuiElProperty, - setGuiElProperty, - enableGuiEl, - disableGuiEl, - activateGuiEl, - deactivateGuiEl, - showGuiEl, - hideGuiEl, - -) - where import HGamer3D.Bindings.CEGUI.ClassOgreRenderer as CEGUIOgreRenderer @@ -111,7 +51,7 @@ import GHC.Ptr import HGamer3D.Data import HGamer3D.Util -import HGamer3D.WinEvent +import HGamer3D.WinEvent.BaseAPI import HGamer3D.Bindings.CEGUI.ClassPtr import HGamer3D.Bindings.CEGUI.Utils diff --git a/GUI/HGamer3D/GUI/Internal/Properties.hs b/GUI/HGamer3D/GUI/Internal/Properties.hs index 9ceff09..8cd34d6 100644 --- a/GUI/HGamer3D/GUI/Internal/Properties.hs +++ b/GUI/HGamer3D/GUI/Internal/Properties.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/GUI/HGamer3D/GUI/Internal/Widgets.hs b/GUI/HGamer3D/GUI/Internal/Widgets.hs index 234092c..cdf9cd0 100644 --- a/GUI/HGamer3D/GUI/Internal/Widgets.hs +++ b/GUI/HGamer3D/GUI/Internal/Widgets.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/GUI/HGamer3D/Internal/GUI.hs b/GUI/HGamer3D/Internal/GUI.hs new file mode 100644 index 0000000..7ad006d --- /dev/null +++ b/GUI/HGamer3D/Internal/GUI.hs @@ -0,0 +1,35 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- GUI.hs + +-- |GUI functionality of HGamer3D, internal API. + +module HGamer3D.Internal.GUI + +( +module HGamer3D.GUI.Internal.Base, +module HGamer3D.GUI.Internal.Widgets, +module HGamer3D.GUI.Internal.Properties, +) + +where +import HGamer3D.GUI.Internal.Base +import HGamer3D.GUI.Internal.Widgets +import HGamer3D.GUI.Internal.Properties + diff --git a/GUI/SConstruct b/GUI/SConstruct index 3793c7a..4c138c1 100644 --- a/GUI/SConstruct +++ b/GUI/SConstruct @@ -14,8 +14,9 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - "HGamer3D/GUI.hs", + "HGamer3D/GUI/BaseAPI.hs", Glob("HGamer3D/GUI/Internal/*"), + Glob("HGamer3D/Internal/*"), Glob("*.cabal"), "LICENSE", diff --git a/Graphics3D/HGamer3D-Graphics3D.cabal b/Graphics3D/HGamer3D-Graphics3D.cabal index a415b8e..e8f922e 100644 --- a/Graphics3D/HGamer3D-Graphics3D.cabal +++ b/Graphics3D/HGamer3D-Graphics3D.cabal @@ -21,7 +21,7 @@ Library Build-Depends: base >= 3 && < 5, containers, mtl, transformers, filepath, directory, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Ogre-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Graphics3D.Schema.Figure, HGamer3D.Graphics3D.Schema.Geometry, HGamer3D.Graphics3D.Schema.Camera, HGamer3D.Graphics3D.Schema.Light, HGamer3D.Graphics3D.Schema.Material, HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D + Exposed-modules: HGamer3D.Graphics3D.Schema.Figure, HGamer3D.Graphics3D.Schema.Geometry, HGamer3D.Graphics3D.Schema.Camera, HGamer3D.Graphics3D.Schema.Light, HGamer3D.Graphics3D.Schema.Material, HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D.BaseAPI, HGamer3D.Internal.Graphics3D Other-modules: diff --git a/Graphics3D/HGamer3D/Graphics3D.hs b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs similarity index 74% rename from Graphics3D/HGamer3D/Graphics3D.hs rename to Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs index d060090..16b7928 100644 --- a/Graphics3D/HGamer3D/Graphics3D.hs +++ b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs @@ -2,7 +2,7 @@ -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -19,28 +19,34 @@ -- Graphics.hs -- | 3D Graphics for HGamer3D, public API. -module HGamer3D.Graphics3D +module HGamer3D.Graphics3D.BaseAPI ( - -- * The Graphics System - Graphics3DSystem (..), + -- * Basic Types for the Graphics3D System + Graphics3DSystem, + Object3D, Camera, Viewport, - -- * Initialization of Graphics3D and Game Loop Functions + -- * Initializing the Graphics3D Subsystem + + -- | + -- The initialization, step and free functions are called from the HGamer3D corresponding functions, therefore + -- they do not need to be called in code, which includes HGamer3D - BaseAPI. + initGraphics3D, - freeGraphics3D, stepGraphics3D, - - -- * The typeclass of (data) items, which can be put into the engine - Engine3DItem (..), - - -- * The 3D object as outer visible part of it - Object3D (..), + freeGraphics3D, + -- * Creating, Updating and Removing of 3D Objects + Graphics3DItem (..), + + -- * Creating simple 3D objects sphere, cube, cuboid, + ikosaeder, + dodekaeder, -- * Light Light, diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs index 24d864d..4fdd640 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE FlexibleContexts #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -20,52 +20,7 @@ -- Graphics3D/Internal/Base.hs --- | Basic Types, Initialization and some global functions for the Graphics3D module. This is the internal implementation module. The external API is in HGamer3D.Graphics3D. -module HGamer3D.Graphics3D.Internal.Base ( - - -- * The Graphics and 3D Object System - Graphics3DSystem (..), - Object3D (..), - - -- * Initialization of Graphics3D and Game Loop Functions - initGraphics3D, - freeGraphics3D, - stepGraphics3D, - - -- * some global functions - HGamer3D.Graphics3D.Internal.Base.setBackgroundColour, - addResourceLocationMedia, - addResourceZipfileMedia, - addResourceLocationGUI, - - -- * Camera functionality - - Camera (..), - cameraLookAt, - - -- * Internal Types, handling of the Ogre Engine - SceneManager (..), - ResourceGroupManager (..), - RootObject (..), - Viewport (..), - LogManager (..), - TextureManager (..), - RenderTarget (..), - - -- * Internal Types 3D Object System - Engine3DItem (..), - OEntity (..), - ONode (..), - EngineData (..), - - -- * Internal Functionality - graphics3DPumpWindowMessages, - renderOneFrame, - checkQuitReceived, - _getNode, - -) - +module HGamer3D.Graphics3D.Internal.Base where import HGamer3D.Data @@ -100,6 +55,7 @@ import Control.Monad import Control.Monad.Trans import Control.Monad.IO.Class import Control.Monad.State.Class +import qualified System.Info as SI import Control.Concurrent import Data.Maybe @@ -111,20 +67,15 @@ import HGamer3D.Graphics3D.Schema.Material import HGamer3D.Graphics3D.Schema.Geometry import HGamer3D.Graphics3D.Schema.Figure - -{- ------------------------------------------------------ - The Graphics3D Basic Types and Initilization - ------------------------------------------------------ -} - data SceneManager = SceneManager HG3DClass data ResourceGroupManager = ResourceGroupManager HG3DClass data RootObject = RootObject HG3DClass -data Viewport = Viewport HG3DClass data TextureManager = TextureManager HG3DClass data LogManager = LogManager HG3DClass -data Camera = Camera HG3DClass data RenderTarget = RenderTarget HG3DClass +-- | This data type holds the internal pointers to implementation objects and some additional state +-- like a unique name generator for implementation purposes. data Graphics3DSystem = Graphics3DSystem { g3dsRoot :: RootObject, g3dsSceneManager :: SceneManager, @@ -135,44 +86,13 @@ data Graphics3DSystem = Graphics3DSystem { g3dsUniqueName :: UniqueName } --- | pump window messages for graphics --- Not to be used, if WinEvent pollWinEvent or pumpWinEvents is used! -graphics3DPumpWindowMessages :: IO () -graphics3DPumpWindowMessages = do - WindowEventUtilities.messagePump - return () - --- | renders one frame on the screen -renderOneFrame :: Graphics3DSystem -> IO () -renderOneFrame g3ds = do - let (RootObject root) = g3dsRoot g3ds - Root.renderOneFrame root - return () - --- | steps the game loop by one tick, renders a frame and handles system messages -stepGraphics3D :: Graphics3DSystem -- ^ the graphics3d system - -> IO Bool -- ^ quit flag, true if window closed -stepGraphics3D g3ds = do - renderOneFrame g3ds - graphics3DPumpWindowMessages - i <- checkQuitReceived - return (i == 1) - -freeGraphics3D :: Graphics3DSystem -> IO () -freeGraphics3D g3ds = do - let (RootObject root) = g3dsRoot g3ds - let (RenderTarget rt) = g3dsRenderTarget g3ds - Root.destroyRenderTarget root rt - Root.delete root - return () - -- | initializes the 3d graphics module initGraphics3D :: String -- ^ Name of the window, displayed -> String -- ^ SceneManager type used -> Bool -- ^ flag, show configuration dialogue -> Bool -- ^ flag, is logging enabled -> IO (Graphics3DSystem, Camera, Viewport, Window) - + initGraphics3D windowName sceneManagerType fConfig fLog = do -- configuration path can be app user dir or local dir @@ -268,93 +188,41 @@ initGraphics3D windowName sceneManagerType fConfig fLog = do return $ (Graphics3DSystem (RootObject root) (SceneManager sceneManager) (ResourceGroupManager rgm) (LogManager lmgr) (TextureManager tm) (RenderTarget renderWindow) uniqueName, (Camera camera), (Viewport viewport), (Window windowHandle)) -{- ------------------------------------------------------ - The Type Class for the 3D objects, - implemented from pure data - ------------------------------------------------------ -} - --- | Typed Ogre Classes: Entity -data OEntity = OE HG3DClass -- this object is an Ogre Entity - --- | Typed Ogre Classes: Node -data ONode = ON HG3DClass -- this object is an Ogre Node - --- | Data Tree for Engine Specific Data -data EngineData = EDEntityNode OEntity ONode - | EDNodeAndSub ONode [EngineData] - --- | 3D Object is implemented as NodeTree of Ogre Classes and Pure Data representation. --- This is the entity, which is living in the 3D engine. -data Object3D a = Object3D EngineData a - --- | A type class which defines transformations from data to engine entities and back -class Engine3DItem a where - object3D :: Graphics3DSystem -> a -> IO (Object3D a) - update3D :: Graphics3DSystem -> Object3D a -> a -> IO (Object3D a) - remove3D :: Graphics3DSystem -> (Object3D a) -> IO () - -_getNode :: EngineData -> ONode -_getNode edata = case edata of - (EDEntityNode _ node) -> node - (EDNodeAndSub node _) -> node - -_getNode' :: Object3D a -> HG3DClass -_getNode' (Object3D edata _) = case edata of - (EDEntityNode (OE entity) (ON node)) -> node - (EDNodeAndSub (ON node) _) -> node - -instance HasPosition (Object3D a) where +-- | steps the game loop by one tick, renders a frame and handles system messages +stepGraphics3D :: Graphics3DSystem -- ^ the graphics3d system + -> IO Bool -- ^ quit flag, true if window closed +stepGraphics3D g3ds = do + renderOneFrame g3ds + -- this one is quite tricky, on Linux we need to call the message loop in addition to WinEvent! + if SI.os /= "mingw32" then graphics3DPumpWindowMessages else return () + graphics3DPumpWindowMessages + i <- checkQuitReceived + return (i == 1) - position obj = do - pos <- Node.getPosition (_getNode' obj) - return (pos) - - positionTo obj pos = do - Node.setPosition (_getNode' obj) pos - return () - -instance HasSize (Object3D a) where - - size obj = do - pos <- Node.getScale (_getNode' obj) - return (pos) - - sizeTo obj pos = do - Node.setScale (_getNode' obj) pos - return () - -instance HasOrientation (Object3D a) where +-- | frees resources and shutdown the Graphics3D sub-system +freeGraphics3D :: Graphics3DSystem -> IO () +freeGraphics3D g3ds = do + let (RootObject root) = g3dsRoot g3ds + let (RenderTarget rt) = g3dsRenderTarget g3ds + Root.destroyRenderTarget root rt + Root.delete root + return () - orientation obj = do - q <- Node.getOrientation (_getNode' obj) - let uq = mkNormal q - return uq - - orientationTo obj uq = do - Node.setOrientation (_getNode' obj) (fromNormal uq) - return () +-- | Basically an area in a window, to draw to, connected to the Camera +data Viewport = Viewport HG3DClass -{- ------------------------------------------------------ - The Camera and its functions - ------------------------------------------------------ -} +-- | Camera +data Camera = Camera HG3DClass instance HasPosition Camera where - - position (Camera c) = do - pos <- Camera.getPosition c - return (pos) - - positionTo (Camera c) pos = do - Camera.setPosition2 c pos - return () + position (Camera c) = Camera.getPosition c + positionTo (Camera c) pos = Camera.setPosition2 c pos instance HasOrientation Camera where - orientation (Camera c) = do q <- Camera.getOrientation c let uq = mkNormal q return uq - orientationTo (Camera c) uq = do Camera.setOrientation c (fromNormal uq) return () @@ -365,20 +233,11 @@ cameraLookAt (Camera c) v = do Camera.lookAt c v return () - -{- ------------------------------------------------------ - Misc global functions - ------------------------------------------------------ -} - - --- | sets the background colour of the 3d drawing window +-- | Background colour of the 3d drawing window setBackgroundColour :: Viewport -> Colour -> IO () setBackgroundColour (Viewport viewport) bgColour = do Viewport.setBackgroundColour viewport bgColour --- locations of media in same folder as program resides --- - -- | adds a resource location for 3D media (Ogre) addResourceLocationMedia :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D -> String -- ^ path to new resource location, the path should identify a directory @@ -407,3 +266,57 @@ addResourceLocationGUI g3ds path category = do ResourceGroupManager.addResourceLocation rgm path "FileSystem" category False ResourceGroupManager.initialiseResourceGroup rgm category +-- | pump window messages for graphics +-- Not to be used, if WinEvent pollWinEvent or pumpWinEvents is used! +graphics3DPumpWindowMessages :: IO () +graphics3DPumpWindowMessages = do + WindowEventUtilities.messagePump + return () + +-- | renders one frame on the screen +renderOneFrame :: Graphics3DSystem -> IO () +renderOneFrame g3ds = do + let (RootObject root) = g3dsRoot g3ds + Root.renderOneFrame root + return () + +-- | Typed Ogre Classes: Entity +data OEntity = OE HG3DClass -- this object is an Ogre Entity + +-- | Typed Ogre Classes: Node +data ONode = ON HG3DClass -- this object is an Ogre Node + +-- | +-- For the data driven API, we need an internal representation, which +-- holds state inside the engine for outside defined data items (see Schema). +-- The following data definitions provide the framework for capturing +-- engine state for Figure and Geometry objects. +-- +-- The EngineData Type holds a tree of items, corresponding to a Figure schema +-- data item, which also holds a corresponding pure data tree. +data EngineData = EDEntityNode OEntity ONode + | EDNodeAndSub ONode [EngineData] + +-- | A 3D Object represents the state inside the engine for a Schema 3D data item +data Object3D a = Object3D EngineData a + +-- | +-- The Graphics3DItem TypeClass provides functions, which create, modify and delete objects in +-- the 3D world by simple data definitions. Instances of this TypeClass provide the implementations +-- behind for various 3D objects in the 3D world. +class Graphics3DItem a where + object3D :: Graphics3DSystem -> a -> IO (Object3D a) + update3D :: Graphics3DSystem -> Object3D a -> a -> IO (Object3D a) + remove3D :: Graphics3DSystem -> (Object3D a) -> IO () + +_getNode :: EngineData -> ONode +_getNode edata = case edata of + (EDEntityNode _ node) -> node + (EDNodeAndSub node _) -> node + +_getNode' :: Object3D a -> HG3DClass +_getNode' (Object3D edata _) = case edata of + (EDEntityNode (OE entity) (ON node)) -> node + (EDNodeAndSub (ON node) _) -> node + + diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs index 954b0c7..048ba72 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -23,20 +24,7 @@ -- | Creating and managing Light in Base API. Internal implementation module. Public API is in HGamer3D.Graphics3D. -module HGamer3D.Graphics3D.Internal.Light ( - - -- * Types - Light (..), - - -- * create and modify light sources - HGamer3D.Graphics3D.Internal.Light.setAmbientLight, - pointLight, - spotLight, - spotLightSetDirection, - setSpotLightAngle, - directionalLight -) - +module HGamer3D.Graphics3D.Internal.Light where diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs index 5e1476a..085c918 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/PlatonShapes.hs @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -21,12 +22,7 @@ -- Graphics3D/Internal/PlatonShapes.hs -- | Create platonic shapes, ikosaeder and dodekaeder, implementation module. Public API is in HGamer3D.Graphics3D. -module HGamer3D.Graphics3D.Internal.PlatonShapes ( - - ikosaeder, - dodekaeder -) - +module HGamer3D.Graphics3D.Internal.PlatonShapes where @@ -123,10 +119,10 @@ _createPlatonObject g3ds colour vertices faces iColor = do -- | create an ikoaeder mesh - from the mesh more objects can be created -ikosaeder :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D +ikosaederE :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D -> Colour -- ^ colour of the ikosaeder -> IO HG3DClass -- ^ created mesh object as entity -ikosaeder g3ds colour = do +ikosaederE g3ds colour = do let (SceneManager scm) = (g3dsSceneManager g3ds) uid <- nextUniqueName (g3dsUniqueName g3ds) @@ -167,10 +163,10 @@ ikosaeder g3ds colour = do -- | create a dodekaeder mesh -dodekaeder :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D +dodekaederE :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D -> Colour -- ^ colour of the dodekaeder -> IO HG3DClass -- ^ created dodekaeder mesh as entity -dodekaeder g3ds colour = do +dodekaederE g3ds colour = do let (SceneManager scm) = (g3dsSceneManager g3ds) uid <- nextUniqueName (g3dsUniqueName g3ds) diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs index 84ebc38..93134fa 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs @@ -1,4 +1,5 @@ -{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -21,31 +22,7 @@ -- Graphics3D/Internal/Object3D.hs -- | Creating and managing 3D objects functionality for Graphics3D module, internal implemenatation module. Public API is HGamer3D.Graphics3D. -module HGamer3D.Graphics3D.Internal.Shapes ( - - -- * helpers to construct simple geometries - sphere, - cube, - cuboid - - -- * -{- - -- * Mesh creation functions, standard meshes - sphereMesh, - cubeMesh, - planeMesh, - resourceMesh, - - -- * Mesh creation functions, special meshes - colouredCubeMesh, - colouredLineMesh, - rainbowCubeMesh, - - -- * clone objects from meshes - object3DFromMesh, - object3DFromObjects, --} -) +module HGamer3D.Graphics3D.Internal.Shapes where @@ -98,7 +75,6 @@ import Control.Monad.State.Class import HGamer3D.Graphics3D.Schema.Material import HGamer3D.Graphics3D.Schema.Geometry import HGamer3D.Graphics3D.Schema.Figure - import HGamer3D.Graphics3D.Internal.PlatonShapes @@ -115,8 +91,8 @@ _createGeometry g3ds geo = do ResourceGeometry s -> SceneManager.createEntity3 scm s Cube -> SceneManager.createEntity6 scm PT_CUBE Sphere -> SceneManager.createEntity6 scm PT_SPHERE - Ikosaeder -> ikosaeder g3ds white - Dodekaeder -> dodekaeder g3ds white + Ikosaeder -> ikosaederE g3ds white + Dodekaeder -> dodekaederE g3ds white Plane -> SceneManager.createEntity6 scm PT_PLANE _ -> error "HGamer3D.Graphics3D.Internal.Shapes._createMesh: Geo not implemented" return $ OE entity @@ -152,34 +128,6 @@ _removeEntityAndNode g3ds (ON parent) (OE meshEntity ) (ON meshNode) = do Node.removeChild2 parent meshNode SceneManager.destroySceneNode2 scm meshNode --- instance definition - -instance Engine3DItem Geometry where - - object3D g3ds geo = do - meshEntity <- _createGeometry g3ds geo - meshNode <- (_getRootNode g3ds >>= _createSubNode) - _addEntityToNode g3ds meshNode meshEntity - _buildTV meshEntity - return (Object3D (EDEntityNode meshEntity meshNode) geo) - - update3D g3ds (Object3D (EDEntityNode meshEntity meshNode) oldGeo) geo = do - let (ON node) = meshNode - meshEntity' <- if oldGeo /= geo - then do - newMeshEntity <- _createGeometry g3ds geo - _exchangeEntityInNode g3ds meshNode meshEntity newMeshEntity - return newMeshEntity - else - return meshEntity - return (Object3D (EDEntityNode meshEntity' meshNode) geo) - - remove3D g3ds (Object3D (EDEntityNode meshEntity meshNode) geo) = do - rootNode <- _getRootNode g3ds - _removeEntityAndNode g3ds rootNode meshEntity meshNode - - - {- ------------------------------------------------------------------------------- EngineItem for Figure ------------------------------------------------------------------------------- -} @@ -343,7 +291,7 @@ _removeFigure g3ds parent edata = do EDEntityNode e n -> _removeEntityAndNode g3ds parent e n EDNodeAndSub n subs -> (mapM (\edata' -> _removeFigure g3ds n edata') subs) >> return () -instance Engine3DItem Figure where +instance Graphics3DItem Figure where object3D g3ds fig = do rootNode <- _getRootNode g3ds @@ -381,7 +329,31 @@ cuboid :: Graphics3DSystem -> Vec3 -> Material -> IO (Object3D Figure) cuboid g3ds vec material = object3D g3ds (CombinedFigure [ (zeroVec3, unitU, vec, SimpleFigure Cube material) ]) - +dodekaeder :: Graphics3DSystem -> Float -> Material -> IO (Object3D Figure) +dodekaeder g3ds len material = object3D g3ds (CombinedFigure [ + (zeroVec3, unitU, Vec3 len len len, SimpleFigure Dodekaeder material) ]) + +ikosaeder :: Graphics3DSystem -> Float -> Material -> IO (Object3D Figure) +ikosaeder g3ds len material = object3D g3ds (CombinedFigure [ + (zeroVec3, unitU, Vec3 len len len, SimpleFigure Ikosaeder material) ]) + +instance HasPosition (Object3D Figure) where + position obj = Node.getPosition (_getNode' obj) + positionTo obj pos = Node.setPosition (_getNode' obj) pos + +instance HasSize (Object3D Figure) where + size obj = Node.getScale (_getNode' obj) + sizeTo obj pos = Node.setScale (_getNode' obj) pos + +instance HasOrientation (Object3D Figure) where + orientation obj = do + q <- Node.getOrientation (_getNode' obj) + let uq = mkNormal q + return uq + orientationTo obj uq = do + Node.setOrientation (_getNode' obj) (fromNormal uq) + return () + {- -- | creates a Sphere Mesh, from which Spheres can be cloned diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs index 10ece66..6e42e54 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs @@ -1,5 +1,4 @@ {-# LANGUAGE DeriveDataTypeable #-} - -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Figure.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Figure.hs index 39201bf..ca1b80d 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Figure.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Figure.hs @@ -1,5 +1,4 @@ {-# Language StandaloneDeriving, DeriveDataTypeable #-} - -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs index fb115b0..f4b2349 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs @@ -1,5 +1,4 @@ {-# Language StandaloneDeriving, DeriveDataTypeable #-} - -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs index 760194e..357c4c7 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs @@ -1,5 +1,4 @@ {-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} - -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Material.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Material.hs index 76411a5..c2223f1 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Material.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Material.hs @@ -1,5 +1,4 @@ {-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} - -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/Graphics3D/HGamer3D/Internal/Graphics3D.hs b/Graphics3D/HGamer3D/Internal/Graphics3D.hs new file mode 100644 index 0000000..7a60c07 --- /dev/null +++ b/Graphics3D/HGamer3D/Internal/Graphics3D.hs @@ -0,0 +1,36 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Graphics.hs + +-- | Internal API of Graphics3D (Implementation) +module HGamer3D.Internal.Graphics3D + +( + module HGamer3D.Graphics3D.Internal.Base, + module HGamer3D.Graphics3D.Internal.Shapes, + module HGamer3D.Graphics3D.Internal.Light, + module HGamer3D.Graphics3D.Internal.PlatonShapes +) + +where + +import HGamer3D.Graphics3D.Internal.Base +import HGamer3D.Graphics3D.Internal.Shapes +import HGamer3D.Graphics3D.Internal.Light +import HGamer3D.Graphics3D.Internal.PlatonShapes diff --git a/Graphics3D/SConstruct b/Graphics3D/SConstruct index 5e1c9dd..32d901d 100644 --- a/Graphics3D/SConstruct +++ b/Graphics3D/SConstruct @@ -14,8 +14,9 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - "HGamer3D/Graphics3D.hs", + Glob("HGamer3D/Graphics3D/*"), Glob("HGamer3D/Graphics3D/Internal/*"), + Glob("HGamer3D/Graphics3D/Schema/*"), Glob("*.cabal"), "LICENSE", diff --git a/InputSystem/HGamer3D-InputSystem.cabal b/InputSystem/HGamer3D-InputSystem.cabal index a91dbb7..d9e49d6 100644 --- a/InputSystem/HGamer3D-InputSystem.cabal +++ b/InputSystem/HGamer3D-InputSystem.cabal @@ -21,7 +21,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-SFML-Binding >= 0.4.0 && < 0.5.0, HGamer3D-SDL2-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.InputSystem.Internal.Base, HGamer3D.InputSystem + Exposed-modules: HGamer3D.InputSystem.Internal.Base, HGamer3D.InputSystem.BaseAPI, HGamer3D.Internal.InputSystem Other-modules: c-sources: diff --git a/InputSystem/HGamer3D/InputSystem.hs b/InputSystem/HGamer3D/InputSystem/BaseAPI.hs similarity index 98% rename from InputSystem/HGamer3D/InputSystem.hs rename to InputSystem/HGamer3D/InputSystem/BaseAPI.hs index 870e776..2fc6872 100644 --- a/InputSystem/HGamer3D/InputSystem.hs +++ b/InputSystem/HGamer3D/InputSystem/BaseAPI.hs @@ -21,7 +21,7 @@ -- | Mouse, Keyboard and Joystick functionality for HGamer3D, public API. -module HGamer3D.InputSystem +module HGamer3D.InputSystem.BaseAPI ( -- * Types diff --git a/InputSystem/HGamer3D/InputSystem/Internal/Base.hs b/InputSystem/HGamer3D/InputSystem/Internal/Base.hs index 0be07b8..b0c5e9b 100644 --- a/InputSystem/HGamer3D/InputSystem/Internal/Base.hs +++ b/InputSystem/HGamer3D/InputSystem/Internal/Base.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/InputSystem/HGamer3D/Internal/InputSystem.hs b/InputSystem/HGamer3D/Internal/InputSystem.hs new file mode 100644 index 0000000..fd5efca --- /dev/null +++ b/InputSystem/HGamer3D/Internal/InputSystem.hs @@ -0,0 +1,30 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- InputSystem.hs + + +-- | Mouse, Keyboard and Joystick functionality for HGamer3D, public API. + +module HGamer3D.Internal.InputSystem + +( + module HGamer3D.InputSystem.Internal.Base +) +where +import HGamer3D.InputSystem.Internal.Base diff --git a/InputSystem/SConstruct b/InputSystem/SConstruct index 0ee734c..76c84f8 100644 --- a/InputSystem/SConstruct +++ b/InputSystem/SConstruct @@ -14,8 +14,9 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - "HGamer3D/InputSystem.hs", + "HGamer3D/InputSystem/BaseAPI.hs", Glob("HGamer3D/InputSystem/Internal/*"), + Glob("HGamer3D/Internal/*"), Glob("*.cabal"), "LICENSE", diff --git a/Main/HGamer3D.cabal b/Main/HGamer3D.cabal index 9288a15..1950628 100644 --- a/Main/HGamer3D.cabal +++ b/Main/HGamer3D.cabal @@ -33,7 +33,7 @@ Flag InputSystem Library Build-Depends: base >= 3 && < 5, clock, containers, hashtables, hashable, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Internal.ECS.Component, HGamer3D.Internal.ECS.ComponentType, HGamer3D.Internal.ECS.Entity, HGamer3D.Internal.ECS.System, HGamer3D.Internal.ECS.SystemGraphics3D, HGamer3D.Internal.GameLoop, HGamer3D.Internal.Event, HGamer3D.BaseAPI + Exposed-modules: HGamer3D.Engine.Internal.Component, HGamer3D.Engine.Internal.ComponentType, HGamer3D.Engine.Internal.Entity, HGamer3D.Engine.Internal.System, HGamer3D.Engine.Internal.SystemGraphics3D, HGamer3D.Engine.Internal.GameLoop, HGamer3D.Engine.Internal.Event, HGamer3D.Engine.EcsAPI, HGamer3D.Engine.BaseAPI, HGamer3D.Internal.Engine Other-modules: c-sources: @@ -47,13 +47,13 @@ Library if flag(audio) build-depends: HGamer3D-Audio >= 0.4 && < 0.5 - exposed-modules: HGamer3D.AudioModule.Internal.SystemAudio, HGamer3D.AudioModule.BaseAPI, HGamer3D.AudioModule.EcsAPI + exposed-modules: HGamer3D.Audio.Internal.SystemAudio, HGamer3D.Audio.EcsAPI, HGamer3D.Internal.AudioModule if flag(network) build-depends: HGamer3D-Network >= 0.4 && < 0.5 - exposed-modules: HGamer3D.NetworkModule.BaseAPI + exposed-modules: HGamer3D.Network.EcsAPI if flag(inputsystem) build-depends: HGamer3D-InputSystem >= 0.4 && < 0.5 - exposed-modules: HGamer3D.InputSystemModule.BaseAPI + exposed-modules: HGamer3D.InputSystem.EcsAPI diff --git a/Main/HGamer3D/AudioModule/EcsAPI.hs b/Main/HGamer3D/Audio/EcsAPI.hs similarity index 91% rename from Main/HGamer3D/AudioModule/EcsAPI.hs rename to Main/HGamer3D/Audio/EcsAPI.hs index da92db2..ca5f9ad 100644 --- a/Main/HGamer3D/AudioModule/EcsAPI.hs +++ b/Main/HGamer3D/Audio/EcsAPI.hs @@ -19,7 +19,7 @@ -- HGamer3D/AudioModule/EcsAPI -- -module HGamer3D.AudioModule.EcsAPI +module HGamer3D.Audio.EcsAPI ( AudioListener (..), @@ -32,4 +32,4 @@ module HGamer3D.AudioModule.EcsAPI import HGamer3D.Audio.Schema.AudioListener import HGamer3D.Audio.Schema.AudioSource - import HGamer3D.AudioModule.Internal.SystemAudio + import HGamer3D.Audio.Internal.SystemAudio diff --git a/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs b/Main/HGamer3D/Audio/Internal/SystemAudio.hs similarity index 93% rename from Main/HGamer3D/AudioModule/Internal/SystemAudio.hs rename to Main/HGamer3D/Audio/Internal/SystemAudio.hs index 8baad62..f233669 100644 --- a/Main/HGamer3D/AudioModule/Internal/SystemAudio.hs +++ b/Main/HGamer3D/Audio/Internal/SystemAudio.hs @@ -1,4 +1,5 @@ {-# Language StandaloneDeriving #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -18,10 +19,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- HGamer3D/AudioModule/Internal/SystemAudio.hs +-- HGamer3D/Audio/Internal/SystemAudio.hs -module HGamer3D.AudioModule.Internal.SystemAudio +module HGamer3D.Audio.Internal.SystemAudio where @@ -35,11 +36,11 @@ import qualified Data.HashTable.IO as HT import qualified HGamer3D.Data as D -import HGamer3D.Internal.Event -import HGamer3D.Internal.ECS.Entity -import HGamer3D.Internal.ECS.Component -import HGamer3D.Internal.ECS.ComponentType -import HGamer3D.Internal.ECS.System +import HGamer3D.Engine.Internal.Event +import HGamer3D.Engine.Internal.Entity +import HGamer3D.Engine.Internal.Component +import HGamer3D.Engine.Internal.ComponentType +import HGamer3D.Engine.Internal.System import qualified HGamer3D.Audio.Internal.Base as A import qualified HGamer3D.Audio.Schema.AudioSource as AS diff --git a/Main/HGamer3D/BaseAPI.hs b/Main/HGamer3D/BaseAPI.hs deleted file mode 100644 index 5b94d8b..0000000 --- a/Main/HGamer3D/BaseAPI.hs +++ /dev/null @@ -1,49 +0,0 @@ --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.althainz.de/HGamer3D.html --- --- (c) 2014 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- HGamer3D BaseAPI Module --- - --- | HGamer3D - A game engine for the Haskell Programmer, this module includes the common modules for the basic API. -module HGamer3D.BaseAPI - -( - module HGamer3D.Data, - module HGamer3D.Util, - - module HGamer3D.Graphics3D, - module HGamer3D.WinEvent, - module HGamer3D.GUI, - - HG3DEvent (..), - - initHGamer3D, - freeHGamer3D, - stepHGamer3D, - - ) where - - import HGamer3D.Data - import HGamer3D.Util - - import HGamer3D.Graphics3D - import HGamer3D.WinEvent - import HGamer3D.GUI - - import HGamer3D.Internal.GameLoop - import HGamer3D.Internal.Event diff --git a/Main/HGamer3D/Engine/BaseAPI.hs b/Main/HGamer3D/Engine/BaseAPI.hs new file mode 100644 index 0000000..05a654f --- /dev/null +++ b/Main/HGamer3D/Engine/BaseAPI.hs @@ -0,0 +1,35 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D BaseAPI Module +-- + +-- | Engine module - BaseAPI of HGamer3D +module HGamer3D.Engine.BaseAPI + +( + HG3DEvent (..), + + initHGamer3D, + freeHGamer3D, + stepHGamer3D, + + ) where + + import HGamer3D.Engine.Internal.GameLoop + import HGamer3D.Engine.Internal.Event diff --git a/Main/HGamer3D/EcsAPI.hs b/Main/HGamer3D/Engine/EcsAPI.hs similarity index 99% rename from Main/HGamer3D/EcsAPI.hs rename to Main/HGamer3D/Engine/EcsAPI.hs index d7ce5f7..9dadca2 100644 --- a/Main/HGamer3D/EcsAPI.hs +++ b/Main/HGamer3D/Engine/EcsAPI.hs @@ -22,7 +22,7 @@ -- | HGamer3D - A game engine for the Haskell Programmer, this module includes the common modules for the ECS API. -- ECS is the Entity - Component - System -module HGamer3D.EcsAPI +module HGamer3D.Engine.EcsAPI ( -- $Ecs @@ -59,8 +59,6 @@ The component implements something like the most granular modifiable state in th -} --} - {- $System -} diff --git a/Main/HGamer3D/Internal/ECS/Component.hs b/Main/HGamer3D/Engine/Internal/Component.hs similarity index 91% rename from Main/HGamer3D/Internal/ECS/Component.hs rename to Main/HGamer3D/Engine/Internal/Component.hs index 0469415..6a80404 100644 --- a/Main/HGamer3D/Internal/ECS/Component.hs +++ b/Main/HGamer3D/Engine/Internal/Component.hs @@ -1,4 +1,5 @@ {-# Language StandaloneDeriving, DeriveDataTypeable, DeriveGeneric, PatternGuards #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -22,28 +23,7 @@ -- | the Component in Entity-Component-System -module HGamer3D.Internal.ECS.Component - -( - -- * Time Stamp Mechanism - StampedValue, - fromStamped, - - -- * The component - ComponentId, - Component (..), - - newC, - readC, - updateC, - isTypeC, - idC, - - _pushEvent, - _popEvents - -) - +module HGamer3D.Engine.Internal.Component where import Data.Dynamic @@ -54,7 +34,7 @@ import GHC.Generics (Generic) import Data.Hashable import System.Clock -import HGamer3D.Internal.Event +import HGamer3D.Engine.Internal.Event deriving instance Generic TimeSpec instance Hashable TimeSpec diff --git a/Main/HGamer3D/Internal/ECS/ComponentType.hs b/Main/HGamer3D/Engine/Internal/ComponentType.hs similarity index 94% rename from Main/HGamer3D/Internal/ECS/ComponentType.hs rename to Main/HGamer3D/Engine/Internal/ComponentType.hs index 1badb6e..6654f81 100644 --- a/Main/HGamer3D/Internal/ECS/ComponentType.hs +++ b/Main/HGamer3D/Engine/Internal/ComponentType.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.althainz.de/HGamer3D.html @@ -19,7 +20,7 @@ -- HGamer3D/Internal/ECS/ComponentType Module -- -module HGamer3D.Internal.ECS.ComponentType +module HGamer3D.Engine.Internal.ComponentType where diff --git a/Main/HGamer3D/Internal/ECS/Entity.hs b/Main/HGamer3D/Engine/Internal/Entity.hs similarity index 88% rename from Main/HGamer3D/Internal/ECS/Entity.hs rename to Main/HGamer3D/Engine/Internal/Entity.hs index 79c97ff..3555a86 100644 --- a/Main/HGamer3D/Internal/ECS/Entity.hs +++ b/Main/HGamer3D/Engine/Internal/Entity.hs @@ -1,4 +1,5 @@ {-# Language StandaloneDeriving #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -22,27 +23,14 @@ -- | the Entity in Entity-Component-System -module HGamer3D.Internal.ECS.Entity - -( - -- * Entity - Entity, - sendEvent, - - entity, - (#:), - (#?), - (#) - -) - +module HGamer3D.Engine.Internal.Entity where -import HGamer3D.Internal.ECS.ComponentType -import HGamer3D.Internal.Event +import HGamer3D.Engine.Internal.Component +import HGamer3D.Engine.Internal.ComponentType +import HGamer3D.Engine.Internal.Event import Control.Concurrent.MVar -import HGamer3D.Internal.ECS.Component import qualified Data.Map as M import Data.Maybe import Data.Typeable diff --git a/Main/HGamer3D/Internal/Event.hs b/Main/HGamer3D/Engine/Internal/Event.hs similarity index 88% rename from Main/HGamer3D/Internal/Event.hs rename to Main/HGamer3D/Engine/Internal/Event.hs index bc326c9..12fc27c 100644 --- a/Main/HGamer3D/Internal/Event.hs +++ b/Main/HGamer3D/Engine/Internal/Event.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_HADDOCK hide #-} + -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.althainz.de/HGamer3D.html @@ -19,12 +21,12 @@ -- HGamer3D/Internal/Event Module -- -module HGamer3D.Internal.Event +module HGamer3D.Engine.Internal.Event where -import HGamer3D.WinEvent -import HGamer3D.GUI +import HGamer3D.WinEvent.BaseAPI +import HGamer3D.GUI.BaseAPI data AudioEvent = PlaySound String | StopSound String diff --git a/Main/HGamer3D/Internal/GameLoop.hs b/Main/HGamer3D/Engine/Internal/GameLoop.hs similarity index 76% rename from Main/HGamer3D/Internal/GameLoop.hs rename to Main/HGamer3D/Engine/Internal/GameLoop.hs index 22097ec..69b1a59 100644 --- a/Main/HGamer3D/Internal/GameLoop.hs +++ b/Main/HGamer3D/Engine/Internal/GameLoop.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_HADDOCK hide #-} + -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.althainz.de/HGamer3D.html @@ -20,7 +22,7 @@ -- -- | HGamer3D - A game engine for the Haskell Programmer, this module includes the implementation of the gameloop and initialization routines. This is an internal module, the public API is in HGamer3D.BaseAPI. -module HGamer3D.Internal.GameLoop +module HGamer3D.Engine.Internal.GameLoop ( HG3DEvent (..), @@ -34,14 +36,14 @@ module HGamer3D.Internal.GameLoop import HGamer3D.Data import HGamer3D.Util - import HGamer3D.Graphics3D - import HGamer3D.WinEvent - import HGamer3D.GUI + import HGamer3D.Graphics3D.BaseAPI + import HGamer3D.WinEvent.BaseAPI + import HGamer3D.GUI.BaseAPI - import HGamer3D.Internal.Event + import HGamer3D.Engine.Internal.Event -- need a couple of internal functions from base modules, to implement game loop - import HGamer3D.Graphics3D.Internal.Base (renderOneFrame, graphics3DPumpWindowMessages, checkQuitReceived) + -- import HGamer3D.Internal.Graphics3D (renderOneFrame, graphics3DPumpWindowMessages, checkQuitReceived) import HGamer3D.GUI.Internal.Base (pollGUIEvent, initGUI, injectWinEventToGUI) import HGamer3D.WinEvent.Internal.Base (attachToWindow) @@ -61,29 +63,24 @@ module HGamer3D.Internal.GameLoop -> IO ([HG3DEvent], Bool) -- ^ list of Events received, quit flag (True if quit received) stepHGamer3D g3ds guis = do - - let oneStep quitReceived events = do - -- this one is quite tricky, on Linux we need to call the message loop in addition to WinEvent! - if SI.os /= "mingw32" then graphics3DPumpWindowMessages else return () - i <- checkQuitReceived - let quitReceived' = quitReceived || (i == 1) + + let getEvents evts = do mWinEvt <- pollWinEvent case mWinEvt of Just winEvt -> do injectWinEventToGUI guis winEvt -- inject event into gui - let events' = events ++ [WindowEvt winEvt] - oneStep quitReceived' events' + getEvents (evts ++ [WindowEvt winEvt]) Nothing -> do mGuiEvt <- pollGUIEvent guis case mGuiEvt of - Just guiEvt -> do - let events' = events ++ [GUIEvt guiEvt] - oneStep quitReceived' events' + Just guiEvt -> getEvents (evts ++ [GUIEvt guiEvt]) Nothing -> do - renderOneFrame g3ds - return (events, quitReceived') - oneStep False [] + return evts + qFlag <- stepGraphics3D g3ds + events <- getEvents [] + return (events, qFlag) + initHGamer3D :: String -- ^ Window Title -> Bool -- ^ Flag show config dialogue -> Bool -- ^ Flag logging enabled diff --git a/Main/HGamer3D/Internal/ECS/System.hs b/Main/HGamer3D/Engine/Internal/System.hs similarity index 95% rename from Main/HGamer3D/Internal/ECS/System.hs rename to Main/HGamer3D/Engine/Internal/System.hs index ace675f..48db417 100644 --- a/Main/HGamer3D/Internal/ECS/System.hs +++ b/Main/HGamer3D/Engine/Internal/System.hs @@ -1,4 +1,5 @@ {-# Language StandaloneDeriving #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -22,19 +23,19 @@ -- | the System in Entity-Component-System -module HGamer3D.Internal.ECS.System +module HGamer3D.Engine.Internal.System where import Control.Concurrent import Control.Concurrent.MVar -import HGamer3D.Internal.ECS.Component import qualified Data.Map as M import Data.Maybe import Data.Typeable import HGamer3D.Data as D -import HGamer3D.Internal.ECS.Entity +import HGamer3D.Engine.Internal.Component +import HGamer3D.Engine.Internal.Entity import System.Clock import System.Mem.StableName diff --git a/Main/HGamer3D/Internal/ECS/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs similarity index 78% rename from Main/HGamer3D/Internal/ECS/SystemGraphics3D.hs rename to Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index e94e5e1..f4c60f4 100644 --- a/Main/HGamer3D/Internal/ECS/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -1,4 +1,5 @@ {-# Language StandaloneDeriving #-} +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) @@ -22,26 +23,29 @@ -- | the Graphics3D System of the Entity-Component-System World -module HGamer3D.Internal.ECS.SystemGraphics3D +module HGamer3D.Engine.Internal.SystemGraphics3D where import Control.Concurrent.MVar -import HGamer3D.Internal.ECS.Component import qualified Data.Map as M import Data.Maybe import Data.Typeable import Data.Dynamic -import HGamer3D.Internal.ECS.Entity -import HGamer3D.Internal.ECS.Component -import HGamer3D.Internal.ECS.ComponentType -import HGamer3D.Internal.ECS.System +import HGamer3D.Engine.Internal.Entity +import HGamer3D.Engine.Internal.Component +import HGamer3D.Engine.Internal.ComponentType +import HGamer3D.Engine.Internal.System import Data.Hashable import qualified Data.HashTable.IO as HT -import qualified HGamer3D.BaseAPI as BA + +import qualified HGamer3D.Data as D +import qualified HGamer3D.Graphics3D.BaseAPI as BA +import qualified HGamer3D.Engine.BaseAPI as E +import qualified HGamer3D.GUI.BaseAPI as GU import HGamer3D.Graphics3D.Schema.Figure import HGamer3D.Graphics3D.Schema.Geometry @@ -55,14 +59,14 @@ import HGamer3D.Graphics3D.Schema.Material type IdHashTable v = HT.BasicHashTable ComponentId v data ECSGraphics3D = ECSGraphics3D { - g3d :: (BA.Graphics3DSystem, BA.GUISystem, BA.Camera, BA.Viewport), + g3d :: (BA.Graphics3DSystem, GU.GUISystem, BA.Camera, BA.Viewport), figures :: MVar [(Component, Maybe Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori, size)] figCache :: IdHashTable ( BA.Object3D Figure, StampedValue Figure, - Maybe (StampedValue BA.Position), - Maybe (StampedValue BA.Orientation), - Maybe (StampedValue BA.Size) + Maybe (StampedValue D.Position), + Maybe (StampedValue D.Orientation), + Maybe (StampedValue D.Size) ) } @@ -91,7 +95,7 @@ instance System ECSGraphics3D where -} initializeSystem = do - g3d <- BA.initHGamer3D "HGamer3D - System" True True True + g3d <- E.initHGamer3D "HGamer3D - System" True True True setupBasicCamera g3d figures <- newMVar [] figCache <- HT.new @@ -119,8 +123,8 @@ instance System ECSGraphics3D where cpTVal <- readC cp >>= return . fromJust let cpVal = fromStamped cpTVal case mCache of - Nothing -> BA.positionTo newOb cpVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mPos) /= cpTVal then BA.positionTo newOb cpVal else return () + Nothing -> D.positionTo newOb cpVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mPos) /= cpTVal then D.positionTo newOb cpVal else return () return $ Just cpTVal Nothing -> return Nothing -- then handle the POS information - Orientation @@ -129,8 +133,8 @@ instance System ECSGraphics3D where coTVal <- readC co >>= return . fromJust let coVal = fromStamped coTVal case mCache of - Nothing -> BA.orientationTo newOb coVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mOri) /= coTVal then BA.orientationTo newOb coVal else return () + Nothing -> D.orientationTo newOb coVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mOri) /= coTVal then D.orientationTo newOb coVal else return () return $ Just coTVal Nothing -> return Nothing -- then handle the POS information - Size @@ -139,8 +143,8 @@ instance System ECSGraphics3D where csTVal <- readC cs >>= return . fromJust let csVal = fromStamped csTVal case mCache of - Nothing -> BA.sizeTo newOb csVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mSiz) /= csTVal then BA.sizeTo newOb csVal else return () + Nothing -> D.sizeTo newOb csVal + Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mSiz) /= csTVal then D.sizeTo newOb csVal else return () return $ Just csTVal Nothing -> return Nothing -- insert new values into cache @@ -148,34 +152,34 @@ instance System ECSGraphics3D where ) cList putMVar (figures ecsg3d) cList -- run graphics - (evt, qFlag) <- BA.stepHGamer3D g3ds guis + (evt, qFlag) <- E.stepHGamer3D g3ds guis return (ecsg3d, qFlag) shutdownSystem ecsg3d = do let (g3ds, guis, camera, viewport) = (g3d ecsg3d) - BA.freeHGamer3D g3ds guis + E.freeHGamer3D g3ds guis return () -runSystemGraphics3D :: BA.TimeMS -> IO ECSGraphics3D +runSystemGraphics3D :: D.TimeMS -> IO ECSGraphics3D runSystemGraphics3D sleepT = runSystem sleepT setupBasicCamera g3d = do let (g3ds, guis, camera, viewport) = g3d -- camera position - let pos = BA.Vec3 5.0 5.0 80.0 - BA.positionTo camera pos - let at = BA.Vec3 0.0 0.0 (-300.0) + let pos = D.Vec3 5.0 5.0 80.0 + D.positionTo camera pos + let at = D.Vec3 0.0 0.0 (-300.0) BA.cameraLookAt camera at -- define light - BA.setAmbientLight g3ds BA.white - BA.pointLight g3ds BA.white (BA.Vec3 10.0 10.0 20.0) + BA.setAmbientLight g3ds D.white + BA.pointLight g3ds D.white (D.Vec3 10.0 10.0 20.0) -- GUI Code starts here, display hg3d logo - BA.loadGuiScheme guis "hg3d.scheme" - logo <- BA.loadGuiLayoutFromFile guis "hgamer3d.layout" "" - BA.addGuiElToDisplay guis logo + GU.loadGuiScheme guis "hg3d.scheme" + logo <- GU.loadGuiLayoutFromFile guis "hgamer3d.layout" "" + GU.addGuiElToDisplay guis logo return () diff --git a/Main/HGamer3D/InputSystemModule/BaseAPI.hs b/Main/HGamer3D/InputSystem/EcsAPI.hs similarity index 88% rename from Main/HGamer3D/InputSystemModule/BaseAPI.hs rename to Main/HGamer3D/InputSystem/EcsAPI.hs index 03c288c..b0ab16f 100644 --- a/Main/HGamer3D/InputSystemModule/BaseAPI.hs +++ b/Main/HGamer3D/InputSystem/EcsAPI.hs @@ -19,10 +19,8 @@ -- HGamer3D Modules/InputSystem Module -- -module HGamer3D.InputSystemModule.BaseAPI +module HGamer3D.InputSystem.EcsAPI ( - module HGamer3D.InputSystem ) where - import HGamer3D.InputSystem diff --git a/Main/HGamer3D/AudioModule/BaseAPI.hs b/Main/HGamer3D/Internal/AudioModule.hs similarity index 83% rename from Main/HGamer3D/AudioModule/BaseAPI.hs rename to Main/HGamer3D/Internal/AudioModule.hs index 4315ef3..1c579cd 100644 --- a/Main/HGamer3D/AudioModule/BaseAPI.hs +++ b/Main/HGamer3D/Internal/AudioModule.hs @@ -16,13 +16,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- HGamer3D Modules/Audio Module +-- HGamer3D/AudioModule/EcsAPI -- -module HGamer3D.AudioModule.BaseAPI +module HGamer3D.Internal.AudioModule ( - module HGamer3D.Audio + module HGamer3D.Audio.Internal.SystemAudio ) where - import HGamer3D.Audio +import HGamer3D.Audio.Internal.SystemAudio diff --git a/Main/HGamer3D/Internal/Engine.hs b/Main/HGamer3D/Internal/Engine.hs new file mode 100644 index 0000000..c1b257a --- /dev/null +++ b/Main/HGamer3D/Internal/Engine.hs @@ -0,0 +1,40 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/AudioModule/EcsAPI +-- + +module HGamer3D.Internal.Engine + +( + module HGamer3D.Engine.Internal.Component, + module HGamer3D.Engine.Internal.ComponentType, + module HGamer3D.Engine.Internal.Entity, + module HGamer3D.Engine.Internal.Event, + module HGamer3D.Engine.Internal.GameLoop, + module HGamer3D.Engine.Internal.System, + module HGamer3D.Engine.Internal.SystemGraphics3D +) where + +import HGamer3D.Engine.Internal.Component +import HGamer3D.Engine.Internal.ComponentType +import HGamer3D.Engine.Internal.Entity +import HGamer3D.Engine.Internal.Event +import HGamer3D.Engine.Internal.GameLoop +import HGamer3D.Engine.Internal.System +import HGamer3D.Engine.Internal.SystemGraphics3D diff --git a/Main/HGamer3D/NetworkModule/BaseAPI.hs b/Main/HGamer3D/Network/EcsAPI.hs similarity index 89% rename from Main/HGamer3D/NetworkModule/BaseAPI.hs rename to Main/HGamer3D/Network/EcsAPI.hs index 40872aa..d2fb76d 100644 --- a/Main/HGamer3D/NetworkModule/BaseAPI.hs +++ b/Main/HGamer3D/Network/EcsAPI.hs @@ -19,11 +19,9 @@ -- HGamer3D Modules/Network Module -- -module HGamer3D.NetworkModule.BaseAPI +module HGamer3D.Network.EcsAPI ( - module HGamer3D.Network ) where - import HGamer3D.Network diff --git a/Main/SConstruct b/Main/SConstruct index 6f3b282..a5d3187 100644 --- a/Main/SConstruct +++ b/Main/SConstruct @@ -14,18 +14,16 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - "HGamer3D/BaseAPI.hs", - Glob("HGamer3D/Modules/*"), - Glob("HGamer3D/Extensions/*"), - Glob("HGamer3D/Schema/*"), Glob("HGamer3D/Internal/*"), Glob("HGamer3D/Internal/ECS/*"), - Glob("HGamer3D/AudioModule/*"), - Glob("HGamer3D/AudioModule/Internal/*"), - Glob("HGamer3D/InputSystemModule/*"), - Glob("HGamer3D/InputSystemModule/Internal/*"), - Glob("HGamer3D/NetworkModule/*"), - Glob("HGamer3D/NetworkModule/Internal/*"), + Glob("HGamer3D/Audio/*"), + Glob("HGamer3D/Audio/Internal/*"), + Glob("HGamer3D/InputSystem/*"), + Glob("HGamer3D/InputSystem/Internal/*"), + Glob("HGamer3D/Network/*"), + Glob("HGamer3D/Network/Internal/*"), + Glob("HGamer3D/Engine/*"), + Glob("HGamer3D/Engine/Internal/*"), Glob("*.cabal"), "LICENSE", diff --git a/Network/HGamer3D-Network.cabal b/Network/HGamer3D-Network.cabal index 7da1730..6deb31a 100644 --- a/Network/HGamer3D-Network.cabal +++ b/Network/HGamer3D-Network.cabal @@ -20,7 +20,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Enet-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Network.Internal.Base, HGamer3D.Network + Exposed-modules: HGamer3D.Network.Internal.Base, HGamer3D.Network.BaseAPI, HGamer3D.Internal.Network Other-modules: c-sources: diff --git a/Network/HGamer3D/Internal/Network.hs b/Network/HGamer3D/Internal/Network.hs new file mode 100644 index 0000000..fb9ad12 --- /dev/null +++ b/Network/HGamer3D/Internal/Network.hs @@ -0,0 +1,28 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Network.hs + +-- | Network functionality for HGamer3D, internal API. +module HGamer3D.Internal.Network + +( + module HGamer3D.Network.Internal.Base +) +where +import HGamer3D.Network.Internal.Base diff --git a/Network/HGamer3D/Network.hs b/Network/HGamer3D/Network/BaseAPI.hs similarity index 97% rename from Network/HGamer3D/Network.hs rename to Network/HGamer3D/Network/BaseAPI.hs index 86bb807..66282da 100644 --- a/Network/HGamer3D/Network.hs +++ b/Network/HGamer3D/Network/BaseAPI.hs @@ -19,7 +19,7 @@ -- Network.hs -- | Network functionality for HGamer3D, public API. -module HGamer3D.Network +module HGamer3D.Network.BaseAPI ( diff --git a/Network/HGamer3D/Network/Internal/Base.hs b/Network/HGamer3D/Network/Internal/Base.hs index 680621e..cb3666c 100644 --- a/Network/HGamer3D/Network/Internal/Base.hs +++ b/Network/HGamer3D/Network/Internal/Base.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org @@ -20,30 +21,6 @@ -- | Network functionality for HGamer3D, internal implementation, which exports also internal data structures. Public API is in module HGamer3D.Network. module HGamer3D.Network.Internal.Base - -( - - -- * Overview - -- $Overview - - -- * Types - NetworkSystem (..), - NetworkClient (..), - NetworkServer (..), - NetworkPacket (..), - NetworkNode (..), - - -- * Library initialization - initNetwork, - freeNetwork, - - -- * Connection Handling - networkClient, - networkServer, - connectClientToServer, - disconnectClient -) - where import GHC.Ptr diff --git a/Network/SConstruct b/Network/SConstruct index bf040e4..00591e3 100644 --- a/Network/SConstruct +++ b/Network/SConstruct @@ -14,8 +14,9 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - "HGamer3D/Network.hs", + "HGamer3D/Network/BaseAPI.hs", Glob("HGamer3D/Network/Internal/*"), + Glob("HGamer3D/Internal/*"), Glob("*.cabal"), "LICENSE", diff --git a/WinEvent/HGamer3D-WinEvent.cabal b/WinEvent/HGamer3D-WinEvent.cabal index 9287ce3..ebb4414 100644 --- a/WinEvent/HGamer3D-WinEvent.cabal +++ b/WinEvent/HGamer3D-WinEvent.cabal @@ -20,7 +20,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, text, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-SDL2-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.WinEvent.Internal.Base, HGamer3D.WinEvent + Exposed-modules: HGamer3D.WinEvent.Internal.Base, HGamer3D.WinEvent.BaseAPI, HGamer3D.Internal.WinEvent Other-modules: c-sources: diff --git a/WinEvent/HGamer3D/Internal/WinEvent.hs b/WinEvent/HGamer3D/Internal/WinEvent.hs new file mode 100644 index 0000000..45bc596 --- /dev/null +++ b/WinEvent/HGamer3D/Internal/WinEvent.hs @@ -0,0 +1,30 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- WinEvents.hs + + +-- | Windowing and Event functionality for HGamer3D, internal API. +module HGamer3D.Internal.WinEvent +( + module HGamer3D.WinEvent.Internal.Base +) + +where + +import HGamer3D.WinEvent.Internal.Base diff --git a/WinEvent/HGamer3D/WinEvent.hs b/WinEvent/HGamer3D/WinEvent/BaseAPI.hs similarity index 98% rename from WinEvent/HGamer3D/WinEvent.hs rename to WinEvent/HGamer3D/WinEvent/BaseAPI.hs index fdf040c..e3a877a 100644 --- a/WinEvent/HGamer3D/WinEvent.hs +++ b/WinEvent/HGamer3D/WinEvent/BaseAPI.hs @@ -20,7 +20,7 @@ -- | Windowing and Event functionality for HGamer3D, public API. This module abstracts the functionality needed to create a window and to handle events from this window over different platforms. This module currently is not useful standalone, but is used in HGamer3D (main module) to construct initialization and game loop functionality. -module HGamer3D.WinEvent +module HGamer3D.WinEvent.BaseAPI ( -- * Basic Data Types and Enums EnumWinEventInit (..), diff --git a/WinEvent/HGamer3D/WinEvent/Internal/Base.hs b/WinEvent/HGamer3D/WinEvent/Internal/Base.hs index 09a4fd9..f77b390 100644 --- a/WinEvent/HGamer3D/WinEvent/Internal/Base.hs +++ b/WinEvent/HGamer3D/WinEvent/Internal/Base.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org diff --git a/WinEvent/SConstruct b/WinEvent/SConstruct index 25b9021..93b77e4 100644 --- a/WinEvent/SConstruct +++ b/WinEvent/SConstruct @@ -14,8 +14,9 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - "HGamer3D/WinEvent.hs", + "HGamer3D/WinEvent/BaseAPI.hs", Glob("HGamer3D/WinEvent/Internal/*"), + Glob("HGamer3D/Internal/*"), Glob("*.cabal"), "LICENSE", From a3210741887c36166b987c045946f9154eaa54b9 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Tue, 15 Jul 2014 11:16:21 +0200 Subject: [PATCH 09/28] updated ECS API, added Camera functions for add, update, remove --- Data/HGamer3D/Data/Geometry2D.hs | 20 +- Examples/{Audio => BaseAPI}/Audio.hs | 2 +- Examples/{Graphics3D => BaseAPI}/BlueCube.hs | 24 +-- .../BumpMappingCube.hs | 0 Examples/{GUI => BaseAPI}/GUI-Widgets.hs | 6 +- Examples/SConstruct | 29 +-- GUI/HGamer3D/GUI/BaseAPI.hs | 195 ++++++++++-------- GUI/HGamer3D/GUI/Internal/Base.hs | 3 +- GUI/HGamer3D/GUI/Internal/Properties.hs | 42 +--- GUI/HGamer3D/GUI/Internal/Widgets.hs | 58 ------ Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs | 6 +- .../HGamer3D/Graphics3D/Internal/Base.hs | 107 ++++++++-- .../HGamer3D/Graphics3D/Schema/Camera.hs | 26 ++- Main/HGamer3D/Engine/EcsAPI.hs | 24 ++- Main/HGamer3D/Engine/Internal/GameLoop.hs | 6 +- Main/HGamer3D/Engine/Internal/System.hs | 25 ++- .../Engine/Internal/SystemGraphics3D.hs | 21 +- tools/runGhci.sh | 1 + 18 files changed, 322 insertions(+), 273 deletions(-) rename Examples/{Audio => BaseAPI}/Audio.hs (93%) rename Examples/{Graphics3D => BaseAPI}/BlueCube.hs (69%) rename Examples/{Graphics3D => BaseAPI}/BumpMappingCube.hs (100%) rename Examples/{GUI => BaseAPI}/GUI-Widgets.hs (98%) create mode 100755 tools/runGhci.sh diff --git a/Data/HGamer3D/Data/Geometry2D.hs b/Data/HGamer3D/Data/Geometry2D.hs index a017387..9ca5baf 100644 --- a/Data/HGamer3D/Data/Geometry2D.hs +++ b/Data/HGamer3D/Data/Geometry2D.hs @@ -32,20 +32,20 @@ module HGamer3D.Data.Geometry2D import HGamer3D.Data.Vector -- | A point has two coordinates an x and y one -data Point = Point { - ptX :: Int, - ptY :: Int +data Point a = Point { + ptX :: a, + ptY :: a } -- | A rectangle has an a position as x and y and widht and height -data Rectangle = Rectangle { - rectX :: Int, - rectY :: Int, - rectWidth :: Int, - rectHeight :: Int } deriving (Eq, Show) +data Num a => Rectangle a = Rectangle { + rectX :: a, + rectY :: a, + rectWidth :: a, + rectHeight :: a } deriving (Eq, Show) -- | derive a rectangle from upper left and lower right points -rectFromPoints :: Point -> Point -> Rectangle +rectFromPoints :: Num a => Point a -> Point a -> Rectangle a rectFromPoints upperLeft lowerRight = Rectangle rx ry rw rh where rx = ptX upperLeft ry = ptY upperLeft @@ -53,7 +53,7 @@ rectFromPoints upperLeft lowerRight = Rectangle rx ry rw rh where rh = (ptY lowerRight) - ry -- | get upper left and lower right point from a rect -pointsFromRect :: Rectangle -> (Point, Point) +pointsFromRect :: Num a => Rectangle a -> (Point a, Point a) pointsFromRect rect = (ul, lr) where rx = rectX rect ry = rectY rect diff --git a/Examples/Audio/Audio.hs b/Examples/BaseAPI/Audio.hs similarity index 93% rename from Examples/Audio/Audio.hs rename to Examples/BaseAPI/Audio.hs index f43082c..514039f 100644 --- a/Examples/Audio/Audio.hs +++ b/Examples/BaseAPI/Audio.hs @@ -22,7 +22,7 @@ module Main where -import HGamer3D.Audio +import HGamer3D.Audio.BaseAPI import Control.Monad diff --git a/Examples/Graphics3D/BlueCube.hs b/Examples/BaseAPI/BlueCube.hs similarity index 69% rename from Examples/Graphics3D/BlueCube.hs rename to Examples/BaseAPI/BlueCube.hs index cce2052..8a01fec 100644 --- a/Examples/Graphics3D/BlueCube.hs +++ b/Examples/BaseAPI/BlueCube.hs @@ -16,14 +16,16 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -import HGamer3D.BaseAPI +import HGamer3D.Data +import HGamer3D.Engine.BaseAPI +import HGamer3D.Graphics3D.BaseAPI -renderLoop cube g3ds guis = do +renderLoop cubeF g3ds guis = do -- rotate - yaw cube (Rad 0.005) - roll cube (Rad 0.002) + orientation cubeF >>= \o -> return (yaw o (Rad 0.005)) >>= orientationTo cubeF + orientation cubeF >>= \o -> return (roll o (Rad 0.002)) >>= orientationTo cubeF (ev, quit) <- stepHGamer3D g3ds guis - if quit then return () else renderLoop cube g3ds guis + if quit then return () else renderLoop cubeF g3ds guis main :: IO () main = do @@ -41,15 +43,13 @@ main = do setAmbientLight g3ds white pointLight g3ds white (Vec3 10.0 10.0 20.0) - -- create a shiny blue cube - let blueMaterial = resourceMaterial "Colours/Blue" --- cube <- object3DFromMesh g3ds cubeMesh (Just blueMaterial) False - cube <- object3DFromMesh g3ds cubeMesh Nothing False - positionTo cube (Vec3 0.0 0.0 0.0) - scale cube (Vec3 0.2 0.2 0.2) + -- create a shiny blue cube + cubeFigure <- cube g3ds 0.2 (ResourceMaterial "Colours/Blue") + positionTo cubeFigure (Vec3 0.0 0.0 0.0) + sizeTo cubeFigure (Vec3 0.5 0.5 0.5) -- start render loop - renderLoop cube g3ds guis + renderLoop cubeFigure g3ds guis freeHGamer3D g3ds guis return () diff --git a/Examples/Graphics3D/BumpMappingCube.hs b/Examples/BaseAPI/BumpMappingCube.hs similarity index 100% rename from Examples/Graphics3D/BumpMappingCube.hs rename to Examples/BaseAPI/BumpMappingCube.hs diff --git a/Examples/GUI/GUI-Widgets.hs b/Examples/BaseAPI/GUI-Widgets.hs similarity index 98% rename from Examples/GUI/GUI-Widgets.hs rename to Examples/BaseAPI/GUI-Widgets.hs index 7e3f766..ec8e5e2 100644 --- a/Examples/GUI/GUI-Widgets.hs +++ b/Examples/BaseAPI/GUI-Widgets.hs @@ -21,7 +21,11 @@ module Main where -import HGamer3D.BaseAPI +import HGamer3D.Data +import HGamer3D.Engine.BaseAPI +import HGamer3D.Graphics3D.BaseAPI +import HGamer3D.WinEvent.BaseAPI +import HGamer3D.GUI.BaseAPI import Control.Monad.Trans import Data.Maybe diff --git a/Examples/SConstruct b/Examples/SConstruct index ce7dcef..748f942 100644 --- a/Examples/SConstruct +++ b/Examples/SConstruct @@ -12,20 +12,23 @@ env["ENV"]["HOME"] = os.environ.get("HOME") # the output directory env.Command("build", "", Mkdir("build")) -# the binaries + for (p, s) in [ - ("Audio", "Audio"), - ("Graphics3D", "BlueCube"), - ("Graphics3D", "BumpMappingCube"), - ("GUI", "GUI-Widgets"), - ("GUI", "GUI-Wire"), - ("InputSystem", "Joystick"), - ("InputSystem", "Keyboard"), - ("InputSystem", "Mouse"), - ("Network", "Network-Chat"), - ("WinEvent", "WinEvent"), - ("Games", "Cuboid2"), - ("Games", "YWing-Flight") + + # the BaseAPI binaries + + ("BaseAPI", "Audio"), + ("BaseAPI", "BlueCube"), +# ("BaseAPI", "BumpMappingCube"), + ("BaseAPI", "GUI-Widgets"), +# ("GUI", "GUI-Wire"), +# ("InputSystem", "Joystick"), +# ("InputSystem", "Keyboard"), +# ("InputSystem", "Mouse"), +# ("Network", "Network-Chat"), +# ("WinEvent", "WinEvent"), +# ("Games", "Cuboid2"), +# ("Games", "YWing-Flight") ]: env.Command("build/" + s, [p + "/" + s + ".hs", "build/.HGamer3D" diff --git a/GUI/HGamer3D/GUI/BaseAPI.hs b/GUI/HGamer3D/GUI/BaseAPI.hs index f14d2a2..c3e51d7 100644 --- a/GUI/HGamer3D/GUI/BaseAPI.hs +++ b/GUI/HGamer3D/GUI/BaseAPI.hs @@ -23,45 +23,48 @@ module HGamer3D.GUI.BaseAPI ( - -- * Data Definitions, Types + -- * General GUI Functionality + + -- ** Data Definitions, Types GUISystem, - GUIElement, - GUIEvent (..), - EventFunction, - GUIDim (..), - GUIVec2 (..), + -- ** Initializing - -- initGUI, - -- freeGUI, - -- pollGUIEvents, + initGUI, + freeGUI, + pollGUIEvent, + -- ** Configuration - -- injectWinEventToGUI, - - -- * Event Handling - registerGUIEvent, - - -- * Configuration: Font, Scheme, MouseCursor, Tooltip - loadGuiScheme, loadGuiFont, setGuiDefaultFont, setGuiDefaultMouseCursor, setGuiDefaultTooltip, - - -- * Find and display GUI Elements + + -- * General Handling of GUI Elements + + -- ** Data Definition, Types + + GUIElement, + GUIDim (..), + GUIVec2 (..), + + -- ** Work on the GUI Element Tree + + addChildGuiEl, getChildGuiEl, + removeChildGuiEl, findChildGuiElRecursive, + + -- ** Add Elements to Display and Remove from Display + addGuiElToDisplay, removeGuiElFromDisplay, - -- * Change Gui Element Tree - addChildGuiEl, - removeChildGuiEl, - - -- * Set specific GUI Element properties + -- ** Work with GUI Element Properties + getGuiElProperty, setGuiElProperty, enableGuiEl, @@ -70,54 +73,89 @@ module HGamer3D.GUI.BaseAPI deactivateGuiEl, showGuiEl, hideGuiEl, - - -- * Widget Types and Conversions - GUIButton, - GUIRadioButton, - GUICheckBox, - GUIEditText, - GUIListBox, - GUIComboBox, - GUISlider, - GUISpinner, + -- ** Work with File Layouts - -- * Create Widgets programmatically + loadGuiLayoutFromFile, - button, - radioButton, - checkBox, - editText, - comboBox, - listBox, - spinner, - slider, + -- * Event Handling + + injectWinEventToGUI, + GUIEvent (..), + registerGUIEvent, + +-- * Widget Properties - -- * Load Widgets from layout file + -- ** Property Types - loadGuiLayoutFromFile, + GUIElementProperty, + GUIHasValueProperty, +-- ** Property Functions + (=:), + setP, + getP, + +-- ** GUI Widget General Properties + + pText, + pDisabled, + pVisible, + pAlpha, + pTooltip, + pAlwaysOnTop, + + pX, + pY, + pWidth, + pHeight, + + pSelected, + pValue, + + +-- * Widget Specific Types, Functions and Properties + + -- ** Button Widget + GUIButton, + GUIButtonProperty, + button, toButton, + findButton, + + -- ** RadioButton Widget + GUIRadioButton, + GUIRadioButtonProperty, + radioButton, toRadioButton, + findRadioButton, + + -- ** CheckBox Widget + GUICheckBox, + GUICheckBoxProperty, + checkBox, toCheckBox, + findCheckBox, + + -- ** EditText Widget + GUIEditText, + GUIEditTextProperty, + editText, toEditText, + findEditText, + + -- ** Listbox/Combobox Widget + GUIListBox, + GUIComboBox, + GUIHasSelectionProperty, + comboBox, + listBox, toComboBox, toListBox, - toSpinner, - toSlider, - - findButton, - findRadioButton, - findCheckBox, - findEditText, findComboBox, findListBox, - findSpinner, - findSlider, - - -- * Widget Functions - listboxAddText, + listboxAddText, listboxGetSelectedText, listboxRemoveAllText, listboxInitialize, @@ -125,41 +163,18 @@ module HGamer3D.GUI.BaseAPI comboboxAddText, comboboxRemoveAllText, - - -- * Property Types - -GUIElementProperty, -GUIButtonProperty, -GUIRadioButtonProperty, -GUIHasSelectionProperty, -GUICheckBoxProperty, -GUIEditTextProperty, -GUIHasValueProperty, -GUISliderProperty, -GUISpinnerProperty, - --- * Property Functions -(=:), -setP, -getP, - --- * GUI Widget General Properties - -pText, -pDisabled, -pVisible, -pAlpha, -pTooltip, -pAlwaysOnTop, - -pX, -pY, -pWidth, -pHeight, - -pSelected, -pValue, + -- ** Slider/Spinner Widget + GUISlider, + GUISpinner, + GUISliderProperty, + GUISpinnerProperty, + slider, + spinner, + toSlider, + toSpinner, + findSlider, + findSpinner, ) diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs index c3cfac8..64cf151 100644 --- a/GUI/HGamer3D/GUI/Internal/Base.hs +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -79,6 +79,7 @@ import HGamer3D.Data.HG3DClass import HGamer3D.WinEvent.Internal.Base (showCursor) +-- | the basic data item, carrying status information on implementation details for GUI system data GUISystem = GUISystem { guiRoot::HG3DClass, guiRenderer::HG3DClass, @@ -103,8 +104,6 @@ data GEComboBox = GEComboBox data GESlider = GESlider data GESpinner = GESpinner -type EventFunction = IO () - -- | The GUI Element, a window, a button, any widget or widget element, organized in a hierarchy data GUIElement a = GUIElement HG3DClass a -- ^ only one constructor, phantom type a, to allow GUIElement sub-typing diff --git a/GUI/HGamer3D/GUI/Internal/Properties.hs b/GUI/HGamer3D/GUI/Internal/Properties.hs index 8cd34d6..b79f445 100644 --- a/GUI/HGamer3D/GUI/Internal/Properties.hs +++ b/GUI/HGamer3D/GUI/Internal/Properties.hs @@ -22,46 +22,6 @@ -- |Properties functionality of the GUI. Implementation module with internal data structures exposed. Public API in HGamer3D.GUI. module HGamer3D.GUI.Internal.Properties - -( - - -- * Property Types -GUIElementProperty, -GUIButtonProperty, -GUIHasSelectionProperty, -GUIRadioButtonProperty, -GUICheckBoxProperty, -GUIEditTextProperty, -GUIHasValueProperty, -GUISliderProperty, -GUISpinnerProperty, - -GUIDim (..), -GUIVec2 (..), - --- * Property Functions -(=:), -setP, -getP, - --- * GUI Element Properties, for all GUI elements -pText, -pDisabled, -pVisible, -pAlpha, -pTooltip, -pAlwaysOnTop, - -pX, -pY, -pWidth, -pHeight, - -pValue, -pSelected, - -) - where @@ -225,6 +185,6 @@ pSelected :: GUIHasSelectionProperty a Bool pSelected = _boolProp "Selected" pValue :: GUIHasValueProperty a Float -pValue = _floatProp "Value" +pValue = _floatProp "CurrentValue" diff --git a/GUI/HGamer3D/GUI/Internal/Widgets.hs b/GUI/HGamer3D/GUI/Internal/Widgets.hs index cdf9cd0..555452c 100644 --- a/GUI/HGamer3D/GUI/Internal/Widgets.hs +++ b/GUI/HGamer3D/GUI/Internal/Widgets.hs @@ -22,64 +22,6 @@ -- |Widget functionality of the GUI. Implementation module with internal data structures exposed. Public API in HGamer3D.GUI. module HGamer3D.GUI.Internal.Widgets - -( - - GUIButton (..), - GUIEditText (..), - - GUIHasSelection (..), - GUIRadioButton (..), - GUICheckBox (..), - - GUIListBox (..), - GUIComboBox (..), - - GUIHasValue (..), - GUISlider (..), - GUISpinner (..), - - typeOfGuiEl, - toGuiType, - - button, - radioButton, - checkBox, - editText, - comboBox, - listBox, - spinner, - slider, - - toButton, - toRadioButton, - toCheckBox, - toEditText, - toComboBox, - toListBox, - toSpinner, - toSlider, - - findButton, - findRadioButton, - findCheckBox, - findEditText, - findComboBox, - findListBox, - findSpinner, - findSlider, - - -- * Listbox, Compobox specific functions - listboxAddText, - listboxGetSelectedText, - listboxRemoveAllText, - listboxInitialize, - listboxStatus, - comboboxAddText, - comboboxRemoveAllText, - -) - where import HGamer3D.Bindings.CEGUI.ClassOgreRenderer as CEGUIOgreRenderer diff --git a/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs index 16b7928..4972372 100644 --- a/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs +++ b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs @@ -26,7 +26,6 @@ module HGamer3D.Graphics3D.BaseAPI Graphics3DSystem, Object3D, Camera, - Viewport, -- * Initializing the Graphics3D Subsystem @@ -62,8 +61,11 @@ module HGamer3D.Graphics3D.BaseAPI -- * Misc Functions + addCamera, + removeCamera, + updateCamera, cameraLookAt, - HGamer3D.Graphics3D.Internal.Base.setBackgroundColour, + addResourceLocationMedia, addResourceZipfileMedia, addResourceLocationGUI, diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs index 4fdd640..5f44c74 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs @@ -66,6 +66,7 @@ import HGamer3D.Util import HGamer3D.Graphics3D.Schema.Material import HGamer3D.Graphics3D.Schema.Geometry import HGamer3D.Graphics3D.Schema.Figure +import qualified HGamer3D.Graphics3D.Schema.Camera as Cam data SceneManager = SceneManager HG3DClass data ResourceGroupManager = ResourceGroupManager HG3DClass @@ -91,7 +92,7 @@ initGraphics3D :: String -- ^ Name of the window, displayed -> String -- ^ SceneManager type used -> Bool -- ^ flag, show configuration dialogue -> Bool -- ^ flag, is logging enabled - -> IO (Graphics3DSystem, Camera, Viewport, Window) + -> IO (Graphics3DSystem, Window) initGraphics3D windowName sceneManagerType fConfig fLog = do @@ -137,7 +138,7 @@ initGraphics3D windowName sceneManagerType fConfig fLog = do -- Suppress logging unless, fLog sceneManager <- Root.createSceneManager root sceneManagerType "SceneManager" - +{- camera <- SceneManager.createCamera sceneManager "SimpleCamera" Frustum.setNearClipDistance camera 5.0 Frustum.setFarClipDistance camera 5000.0 @@ -151,7 +152,7 @@ initGraphics3D windowName sceneManagerType fConfig fLog = do width <- Viewport.getActualWidth viewport Frustum.setAspectRatio camera ((fromIntegral width) / (fromIntegral height)) - +-} tm <- TextureManager.getSingletonPtr TextureManager.setDefaultNumMipmaps tm 20 @@ -185,7 +186,7 @@ initGraphics3D windowName sceneManagerType fConfig fLog = do ResourceGroupManager.initialiseAllResourceGroups rgm uniqueName <- createUniqueName "HG3DObj" - return $ (Graphics3DSystem (RootObject root) (SceneManager sceneManager) (ResourceGroupManager rgm) (LogManager lmgr) (TextureManager tm) (RenderTarget renderWindow) uniqueName, (Camera camera), (Viewport viewport), (Window windowHandle)) + return $ (Graphics3DSystem (RootObject root) (SceneManager sceneManager) (ResourceGroupManager rgm) (LogManager lmgr) (TextureManager tm) (RenderTarget renderWindow) uniqueName, (Window windowHandle)) -- | steps the game loop by one tick, renders a frame and handles system messages @@ -208,35 +209,107 @@ freeGraphics3D g3ds = do Root.delete root return () --- | Basically an area in a window, to draw to, connected to the Camera -data Viewport = Viewport HG3DClass - --- | Camera -data Camera = Camera HG3DClass +{- ---------------------------------------------------------------- + Camera + ---------------------------------------------------------------- -} + +-- | Camera, internal data object for engine +data Camera = Camera { + cameraCamObject :: HG3DClass, + cameraViewportObject :: HG3DClass, + cameraSchema :: Cam.Camera + } + +-- | add a camera, you probably want to do this at least once +addCamera :: Graphics3DSystem -- ^ the graphics system + -> Cam.Camera -- ^ the Schema data for the camera + -> IO Camera -- ^ the resulting engine object +addCamera g3ds schema = do + let (SceneManager sceneManager) = g3dsSceneManager g3ds + let uname = g3dsUniqueName g3ds + let (RenderTarget renderWindow) = g3dsRenderTarget g3ds + let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema + -- create camera + cameraName <- (nextUniqueName uname) >>= (\n -> return ("Camera"++n)) + camera <- SceneManager.createCamera sceneManager cameraName + -- set Frustum parameters + Frustum.setNearClipDistance camera nd + Frustum.setFarClipDistance camera fd + Frustum.setFOVy camera (fromAngle fov) + -- add Viewport + viewport <- RenderTarget.addViewport renderWindow camera z (rectX pos) (rectY pos) (rectWidth pos) (rectHeight pos) + -- set Viewport parameters + Viewport.setBackgroundColour viewport bgr + -- create camera return value + let cam = Camera camera viewport schema + -- adapt aspect ratio + cameraAdaptAspectRatio cam + + return cam + +-- | remove a camera +removeCamera :: Graphics3DSystem -> Camera -> IO () +removeCamera g3ds (Camera camera viewport schema) = do + let (SceneManager sceneManager) = g3dsSceneManager g3ds + let (RenderTarget renderWindow) = g3dsRenderTarget g3ds + let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema + RenderTarget.removeViewport renderWindow z + SceneManager.destroyCamera sceneManager camera + +-- | update an existing camera with new parameters +updateCamera :: Graphics3DSystem -> Camera -> Cam.Camera -> IO Camera +updateCamera g3ds cam@(Camera camera viewport schema) schema' = do + + let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema + let Cam.Camera (Cam.Frustum nd' fd' fov') (Cam.Viewport z' pos' bgr') = schema' + -- if zorder or position are not equal, we need to rebuild + if (z /= z') || (pos /= pos') then do + removeCamera g3ds cam + addCamera g3ds schema' + else do + -- adapt single values, as needed + if nd /= nd' then Frustum.setNearClipDistance camera nd' else return () + if fd /= fd' then Frustum.setFarClipDistance camera fd' else return () + if fov /= fov' then Frustum.setFOVy camera (fromAngle fov') else return () + if bgr /= bgr' then Viewport.setBackgroundColour viewport bgr' else return () + return (Camera camera viewport schema') + +-- | adapt the aspect ration, in case the window size and aspect ratio changes, this +-- is called inside the engine automatically. +cameraAdaptAspectRatio :: Camera -> IO () +cameraAdaptAspectRatio cam = do + let (Camera camera viewport schema) = cam + height <- Viewport.getActualHeight viewport + width <- Viewport.getActualWidth viewport + Frustum.setAspectRatio camera ((fromIntegral width) / (fromIntegral height)) + return () + instance HasPosition Camera where - position (Camera c) = Camera.getPosition c - positionTo (Camera c) pos = Camera.setPosition2 c pos + position (Camera c _ _) = Camera.getPosition c + positionTo (Camera c _ _) pos = Camera.setPosition2 c pos instance HasOrientation Camera where - orientation (Camera c) = do + orientation (Camera c _ _) = do q <- Camera.getOrientation c let uq = mkNormal q return uq - orientationTo (Camera c) uq = do + orientationTo (Camera c _ _) uq = do Camera.setOrientation c (fromNormal uq) return () -- | set the direction in a way, that the camera looks toward a specified point cameraLookAt :: Camera -> Vec3 -> IO () -cameraLookAt (Camera c) v = do +cameraLookAt (Camera c _ _) v = do Camera.lookAt c v return () -- | Background colour of the 3d drawing window -setBackgroundColour :: Viewport -> Colour -> IO () -setBackgroundColour (Viewport viewport) bgColour = do - Viewport.setBackgroundColour viewport bgColour +setBackgroundColour :: Graphics3DSystem -> Camera -> Colour -> IO Camera +setBackgroundColour g3ds cam@(Camera camera viewport schema) bgColour = do + let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema + let schema' = Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgColour) + updateCamera g3ds cam schema' -- | adds a resource location for 3D media (Ogre) addResourceLocationMedia :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs index 6e42e54..625717f 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Camera.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org @@ -25,17 +25,27 @@ module HGamer3D.Graphics3D.Schema.Camera where import Data.Typeable - import HGamer3D.Data as Dat --- | The camera type +-- | The data to specify a camera data Camera = Camera { - frustum :: Frustum -- ^ Frustum of the camera + frustum :: Frustum, -- ^ Frustum of the camera , + viewport :: Viewport -- ^ Where to draw on the window } deriving (Eq, Show, Typeable) - + +-- | The frustum defines the area from which objects are rendered into the camera data Frustum = Frustum { - nearDistance :: Float, - farDistance :: Float, - fieldOfViewHorizontal :: Dat.Angle } deriving (Eq, Show, Typeable) + nearDistance :: Float, -- ^ clipping distance near, objects which are nearer are not shown + farDistance :: Float, -- ^ clipping distance far, objects, which are more away are not shown + fieldOfViewHorizontal :: Dat.Angle -- ^ The field of view angle horizontally, the vertical direction is automatically determined by the aspect ratio of the final viewport window. + } deriving (Eq, Show, Typeable) + +deriving instance Typeable1 Dat.Rectangle + +data Viewport = Viewport { + zOrder :: Int, -- ^ Z order in case of overlapping Viewports, higher ZOrders are on top + position :: Dat.Rectangle Float, -- ^ position of viewport in Window, coordinates reaching from 0.0 to 1.0 + backgroundColor :: Colour +} deriving (Eq, Show, Typeable) diff --git a/Main/HGamer3D/Engine/EcsAPI.hs b/Main/HGamer3D/Engine/EcsAPI.hs index 9dadca2..868b2e7 100644 --- a/Main/HGamer3D/Engine/EcsAPI.hs +++ b/Main/HGamer3D/Engine/EcsAPI.hs @@ -28,17 +28,37 @@ module HGamer3D.Engine.EcsAPI -- * Component -- $Component + Component, + ComponentType (..), + newC, + readC, + isTypeC, + updateC, + idC, + -- * Entity -- $Entity + Entity, + entity, + (#:), + (#?), + (#), -- * System -- $System - - + System, + ECSGraphics3D, + runSystemGraphics3D, + + SomeSystem, + (#+), + addToWorld, + removeFromWorld, ) where +import HGamer3D.Internal.Engine diff --git a/Main/HGamer3D/Engine/Internal/GameLoop.hs b/Main/HGamer3D/Engine/Internal/GameLoop.hs index 69b1a59..30cf464 100644 --- a/Main/HGamer3D/Engine/Internal/GameLoop.hs +++ b/Main/HGamer3D/Engine/Internal/GameLoop.hs @@ -85,10 +85,10 @@ module HGamer3D.Engine.Internal.GameLoop -> Bool -- ^ Flag show config dialogue -> Bool -- ^ Flag logging enabled -> Bool -- ^ show Graphics Cursor - -> IO (Graphics3DSystem, GUISystem, Camera, Viewport) + -> IO (Graphics3DSystem, GUISystem) initHGamer3D windowTitle fConfigDialogue fLog fGraphicsCursor = do success <- initWinEvent [WEV_INIT_EVENTS, WEV_INIT_TIMER, WEV_INIT_VIDEO] - (g3ds, camera, viewport, window) <- initGraphics3D windowTitle "DefaultSceneManager" fConfigDialogue fLog + (g3ds, window) <- initGraphics3D windowTitle "DefaultSceneManager" fConfigDialogue fLog win <- attachToWindow window guis <- initGUI fLog fGraphicsCursor - return (g3ds, guis, camera, viewport) + return (g3ds, guis) diff --git a/Main/HGamer3D/Engine/Internal/System.hs b/Main/HGamer3D/Engine/Internal/System.hs index 48db417..360c9a5 100644 --- a/Main/HGamer3D/Engine/Internal/System.hs +++ b/Main/HGamer3D/Engine/Internal/System.hs @@ -1,4 +1,4 @@ -{-# Language StandaloneDeriving #-} +{-# Language StandaloneDeriving, ExistentialQuantification #-} {-# OPTIONS_HADDOCK hide #-} -- This source file is part of HGamer3D @@ -79,7 +79,24 @@ class System a where ) mv status' <- takeMVar mv return status' - - - + +-- management of systems +-- + +data SomeSystem = forall a . System a => SomeSystem a + +(#+) :: forall a. System a => a -> [SomeSystem] -> [SomeSystem] +a #+ as = (SomeSystem a : as) +infixr #+ + +-- ECS World functions, to manage entities in systems + +addToWorld :: [SomeSystem] -> Entity -> IO () +addToWorld systems e = mapM (f e) systems >> return () where + f e (SomeSystem s) = addEntity s e >> return () + +removeFromWorld :: [SomeSystem] -> Entity -> IO () +removeFromWorld systems e = mapM (f e) systems >> return () where + f e (SomeSystem s) = removeEntity s e >> return () + diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index f4c60f4..04f095b 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -50,6 +50,7 @@ import qualified HGamer3D.GUI.BaseAPI as GU import HGamer3D.Graphics3D.Schema.Figure import HGamer3D.Graphics3D.Schema.Geometry import HGamer3D.Graphics3D.Schema.Material +import HGamer3D.Graphics3D.Schema.Camera -- the system of entity component system, in general a system has internal state @@ -59,7 +60,7 @@ import HGamer3D.Graphics3D.Schema.Material type IdHashTable v = HT.BasicHashTable ComponentId v data ECSGraphics3D = ECSGraphics3D { - g3d :: (BA.Graphics3DSystem, GU.GUISystem, BA.Camera, BA.Viewport), + g3d :: (BA.Graphics3DSystem, GU.GUISystem), figures :: MVar [(Component, Maybe Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori, size)] figCache :: IdHashTable ( BA.Object3D Figure, @@ -103,7 +104,7 @@ instance System ECSGraphics3D where stepSystem ecsg3d = do - let (g3ds, guis, camera, viewport) = (g3d ecsg3d) + let (g3ds, guis) = (g3d ecsg3d) -- update 3d objects cList <- takeMVar (figures ecsg3d) mapM (\(cf, mcp, mco, mcs) -> do @@ -156,7 +157,7 @@ instance System ECSGraphics3D where return (ecsg3d, qFlag) shutdownSystem ecsg3d = do - let (g3ds, guis, camera, viewport) = (g3d ecsg3d) + let (g3ds, guis) = (g3d ecsg3d) E.freeHGamer3D g3ds guis return () @@ -165,12 +166,14 @@ runSystemGraphics3D sleepT = runSystem sleepT setupBasicCamera g3d = do - let (g3ds, guis, camera, viewport) = g3d - -- camera position - let pos = D.Vec3 5.0 5.0 80.0 - D.positionTo camera pos - let at = D.Vec3 0.0 0.0 (-300.0) - BA.cameraLookAt camera at + let (g3ds, guis) = g3d + -- camera creation and position + camera <- BA.addCamera g3ds ( + Camera + (Frustum 5.0 5000.0 (D.Deg 90)) + (Viewport 0 (D.Rectangle 0.0 0.0 1.0 1.0) D.black) ) + D.positionTo camera (D.Vec3 5.0 5.0 80.0) + BA.cameraLookAt camera (D.Vec3 0.0 0.0 (-300.0)) -- define light diff --git a/tools/runGhci.sh b/tools/runGhci.sh new file mode 100755 index 0000000..951ec2e --- /dev/null +++ b/tools/runGhci.sh @@ -0,0 +1 @@ +LD_LIBRARY_PATH=~/.HGamer3D/lib ghci +RTS -N -RTS From c6da16332652186bd38ba7d840638f5bda4ead24 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Tue, 15 Jul 2014 18:02:55 +0200 Subject: [PATCH 10/28] added Camera to components, started new Light API --- Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs | 5 +- .../HGamer3D/Graphics3D/Internal/Light.hs | 155 ++++++++++-------- .../HGamer3D/Graphics3D/Schema/Light.hs | 22 ++- Main/HGamer3D/Engine/EcsAPI.hs | 1 + Main/HGamer3D/Engine/Internal/Component.hs | 4 + .../HGamer3D/Engine/Internal/ComponentType.hs | 1 + .../Engine/Internal/SystemGraphics3D.hs | 65 +++++++- 7 files changed, 171 insertions(+), 82 deletions(-) diff --git a/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs index 4972372..f365cf2 100644 --- a/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs +++ b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs @@ -49,11 +49,14 @@ module HGamer3D.Graphics3D.BaseAPI -- * Light Light, + addLight, + updateLight, + removeLight, + HGamer3D.Graphics3D.Internal.Light.setAmbientLight, pointLight, spotLight, spotLightSetDirection, - setSpotLightAngle, directionalLight, -- * Material diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs index 048ba72..f77f32d 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs @@ -27,6 +27,7 @@ module HGamer3D.Graphics3D.Internal.Light where +import Data.Maybe import HGamer3D.Data import HGamer3D.Data.HG3DClass @@ -76,102 +77,114 @@ import Control.Monad.Trans import Control.Monad.IO.Class import Control.Monad.State.Class +import qualified HGamer3D.Graphics3D.Schema.Light as L -- | The light. -data Light = Light HG3DClass deriving (Show) +data Light = Light (Maybe HG3DClass) L.Light instance HasPosition Light where - position (Light l) = do - pos <- Light.getPosition l - return (pos) + position (Light ml _) = case ml of + Just l -> Light.getPosition l + Nothing -> error "HGamer3D.Graphics3D.Internal.Light: this light does not have a position" - positionTo (Light l) pos = do - let (Vec3 x y z) = pos - Light.setPosition l x y z - return () - -spotLightSetDirection l v = Light.setDirection2 l v - - + positionTo (Light ml _) (Vec3 x y z) = case ml of + Just l -> Light.setPosition l x y z + Nothing -> return () + +addLight :: Graphics3DSystem -> L.Light -> IO Light +addLight g3ds schema = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + let (L.Light diffuse@(Colour r g b _) specular@(Colour r' g' b' _) ltype) = schema + case ltype of + L.AmbientLight -> do + SceneManager.setAmbientLight scm diffuse + return $ Light Nothing schema + _ -> do + lightName <- nextUniqueName (g3dsUniqueName g3ds) + light <- SceneManager.createLight scm lightName + Light.setDiffuseColour light r g b + Light.setSpecularColour light r' g' b' + case ltype of + L.PointLight -> Light.setType light LT_POINT + L.DirectionalLight dir -> do + Light.setType light LT_DIRECTIONAL + Light.setDirection2 light dir + L.SpotLight dir inner outer -> do + Light.setType light LT_SPOTLIGHT + Light.setDirection2 light dir + Light.setSpotlightInnerAngle light (fromAngle inner) + Light.setSpotlightOuterAngle light (fromAngle outer) + return $ Light (Just light) schema + +removeLight :: Graphics3DSystem -> Light -> IO () +removeLight g3ds (Light ml schema) = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + let (L.Light diffuse@(Colour r g b _) specular@(Colour r' g' b' _) ltype) = schema + case ltype of + L.AmbientLight -> SceneManager.setAmbientLight scm black -- set to black -> no light + _ -> SceneManager.destroyLight2 scm (fromJust ml) -- remove light from scene + +updateLight :: Graphics3DSystem -> Light -> L.Light -> IO Light +updateLight g3ds l schema = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + removeLight g3ds l + addLight g3ds schema + -- | Ambient light is present everywhere, this function creates it and sets the colour of it. -- There is no light object, since movement, rotation, scaling would make no sense anyhow. - setAmbientLight :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D -> Colour -> IO () setAmbientLight g3ds colour = do let (SceneManager scm) = (g3dsSceneManager g3ds) - SceneManager.setAmbientLight scm colour - return () - + SceneManager.setAmbientLight scm colour -- | creates a point light at a specific location pointLight :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Colour -- ^ Color of the light + -> Colour -- ^ diffuse Color of the light + -> Colour -- ^ specular Color of the light -> Vec3 -- ^ Position, where light is created -> IO (Light) -- ^ The light object - -pointLight g3ds (Colour r g b al) (Vec3 x y z) = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - lightName <- nextUniqueName (g3dsUniqueName g3ds) - - light <- SceneManager.createLight scm lightName - Light.setType light LT_POINT - Light.setPosition light x y z - Light.setDiffuseColour light r g b - Light.setSpecularColour light r g b - let eo = Light light - return eo +pointLight g3ds diffuse specular pos = do + let schema = L.Light diffuse specular L.PointLight + light <- addLight g3ds schema + positionTo light pos + return $ light -- | creates a spot light at a specific location spotLight :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Colour -- ^ Color of the light + -> Colour -- ^ diffuse Colour of the light + -> Colour -- ^ specular Colour of the light -> Vec3 -- ^ Position, where light is created + -> Vec3 -- ^ Direction, where light points + -> Angle -- ^ inner Angle of cone (5..355 degrees) + -> Angle -- ^ outer Angle of cone (5..355 degrees) -> IO Light -- ^ The light object -spotLight g3ds (Colour r g b al) (Vec3 x y z) = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - lightName <- nextUniqueName (g3dsUniqueName g3ds) - - light <- SceneManager.createLight scm lightName - Light.setType light LT_SPOTLIGHT - Light.setPosition light x y z - Light.setDiffuseColour light r g b - Light.setSpecularColour light r g b - let eo = Light light - return eo - --- | set the angle of a spotlight -setSpotLightAngle :: Light -- ^ spotlight - -> Angle -- ^ angle of the light cone, should be between 5 and 355 degree - -> IO () -setSpotLightAngle (Light light) a = do - if (a >= (Deg 5)) && (a <= (Deg 355)) - then do - let innerAngle = fromAngle $ a `subA` (Deg 4.5) - let outerAngle = fromAngle $ a `addA` (Deg 4.5) - Light.setSpotlightInnerAngle light innerAngle - Light.setSpotlightOuterAngle light outerAngle - return () - else do - return () - +spotLight g3ds diffuse specular pos dir inner outer = do + let schema = L.Light diffuse specular (L.SpotLight dir inner outer) + light <- addLight g3ds schema + positionTo light pos + return $ light + +-- | sets spotlight direction +spotLightSetDirection :: Graphics3DSystem -> Light -> Vec3 -> IO Light +spotLightSetDirection g3ds light dir' = do + let (Light l schema) = light + let (L.Light diffuse@(Colour r g b _) specular@(Colour r' g' b' _) ltype) = schema + case ltype of + (L.SpotLight dir inner outer) -> updateLight g3ds light (L.Light diffuse specular (L.SpotLight dir' inner outer)) + _ -> return light -- | creates a directional light at a specific location directionalLight :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Colour -- ^ Color of the light - -> Vec3 -- ^ Position, where light is created + -> Colour -- ^ diffuse Colour of the light + -> Colour -- ^ specular Colour of light + -> Vec3 -- ^ direction of light -> IO (Light) -- ^ The light object - -directionalLight g3ds (Colour r g b al) (Vec3 x y z) = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - lightName <- nextUniqueName (g3dsUniqueName g3ds) - - light <- SceneManager.createLight scm lightName - Light.setType light LT_DIRECTIONAL - Light.setPosition light x y z - Light.setDiffuseColour light r g b - Light.setSpecularColour light r g b - let eo = Light light - return eo +directionalLight g3ds diffuse specular dir = do + let schema = L.Light diffuse specular (L.DirectionalLight dir) + light <- addLight g3ds schema + return $ light + diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs index 357c4c7..5e61d44 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs @@ -28,16 +28,24 @@ import Data.Typeable import HGamer3D.Data as Dat +{- + Basic facts about light: + - Ambient light is just a colour value, which is the light, which is everywhere, when no other light is shining. + - pointlight does have a position and emitts equally from there + - spotlight has position, direction, inner and outer angle specifiyng the cone of the spotlight +-} + -- | The Light data type -data Light = PLight PointLight -- ^ a point light - | SLight SpotLight -- ^ a spot light + + +data Light = Light Colour Colour LightType -- ^ diffuse colour, specular colour, light type + +data LightType = AmbientLight -- ^ Light which is magically everywhere (specular colour ignored) + | PointLight -- ^ A source shining from one location + | DirectionalLight Vec3 -- ^ A source shining from one direction (like hte sun) + | SpotLight Vec3 Angle Angle -- ^ A source shining from one location into one direction with a cone, angles are inner angle, outer angle (a flashlight). Angles should be between 5 and 355 degrees. deriving (Eq, Show, Typeable) -data PointLight = PointLight { - } deriving (Eq, Show, Typeable) - -data SpotLight = SpotLight { - } deriving (Eq, Show, Typeable) diff --git a/Main/HGamer3D/Engine/EcsAPI.hs b/Main/HGamer3D/Engine/EcsAPI.hs index 868b2e7..ad231a0 100644 --- a/Main/HGamer3D/Engine/EcsAPI.hs +++ b/Main/HGamer3D/Engine/EcsAPI.hs @@ -32,6 +32,7 @@ module HGamer3D.Engine.EcsAPI ComponentType (..), newC, readC, + valC, isTypeC, updateC, idC, diff --git a/Main/HGamer3D/Engine/Internal/Component.hs b/Main/HGamer3D/Engine/Internal/Component.hs index 6a80404..016e099 100644 --- a/Main/HGamer3D/Engine/Internal/Component.hs +++ b/Main/HGamer3D/Engine/Internal/Component.hs @@ -32,6 +32,7 @@ import Control.Concurrent.MVar import System.Mem.StableName import GHC.Generics (Generic) import Data.Hashable +import Data.Maybe import System.Clock import HGamer3D.Engine.Internal.Event @@ -83,6 +84,9 @@ readC (Component dyn _ _ _) | otherwise = do return Nothing +valC :: Typeable a => Component -> IO a +valC c = readC c >>= return . fromStamped . fromJust + isTypeC :: Typeable a => a -> Component -> Bool isTypeC val (Component dyn _ tr _) = (typeOf val == tr) diff --git a/Main/HGamer3D/Engine/Internal/ComponentType.hs b/Main/HGamer3D/Engine/Internal/ComponentType.hs index 6654f81..a0c4eae 100644 --- a/Main/HGamer3D/Engine/Internal/ComponentType.hs +++ b/Main/HGamer3D/Engine/Internal/ComponentType.hs @@ -33,6 +33,7 @@ data ComponentType = CTPos -- ^ Position | CTFig -- ^ Figure | CTASl -- ^ Audio Slots | CTALs -- ^ Audio Listener + | CTCam -- ^ Cameras deriving (Eq, Ord, Show) diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index 04f095b..31e9982 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -60,7 +60,9 @@ import HGamer3D.Graphics3D.Schema.Camera type IdHashTable v = HT.BasicHashTable ComponentId v data ECSGraphics3D = ECSGraphics3D { + -- status of graphics engine g3d :: (BA.Graphics3DSystem, GU.GUISystem), + -- system handling of figure components figures :: MVar [(Component, Maybe Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori, size)] figCache :: IdHashTable ( BA.Object3D Figure, @@ -68,12 +70,21 @@ data ECSGraphics3D = ECSGraphics3D { Maybe (StampedValue D.Position), Maybe (StampedValue D.Orientation), Maybe (StampedValue D.Size) + ), + -- system handling of camera components + cameras :: MVar [(Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori)] + camCache :: IdHashTable ( + BA.Camera, + StampedValue Camera, + Maybe (StampedValue D.Position), + Maybe (StampedValue D.Orientation) ) } instance System ECSGraphics3D where addEntity ecsg3d entity = do + -- figures oldList <- takeMVar (figures ecsg3d) let mFig = entity #? CTFig let newList = case mFig of @@ -82,6 +93,15 @@ instance System ECSGraphics3D where in ((fig, p, o, s) : oldList) Nothing -> oldList putMVar (figures ecsg3d) newList + -- cameras + oldList <- takeMVar (cameras ecsg3d) + let mCam = entity #? CTCam + let newList = case mCam of + Just cam -> let + (p, o) = (entity #? CTPos, entity #? CTOri) + in ((cam, p, o) : oldList) + Nothing -> oldList + putMVar (cameras ecsg3d) newList return ecsg3d removeEntity ecsg3d entity = return ecsg3d @@ -97,15 +117,17 @@ instance System ECSGraphics3D where initializeSystem = do g3d <- E.initHGamer3D "HGamer3D - System" True True True - setupBasicCamera g3d +-- setupBasicCamera g3d figures <- newMVar [] figCache <- HT.new - return $ (ECSGraphics3D g3d figures figCache) + cameras <- newMVar [] + camCache <- HT.new + return $ (ECSGraphics3D g3d figures figCache cameras camCache) stepSystem ecsg3d = do let (g3ds, guis) = (g3d ecsg3d) - -- update 3d objects + -- update 3d objects - figures cList <- takeMVar (figures ecsg3d) mapM (\(cf, mcp, mco, mcs) -> do -- empty event queues @@ -152,6 +174,43 @@ instance System ECSGraphics3D where HT.insert (figCache ecsg3d) (idC cf) (newOb, figTVal, newPos, newOri, newSiz) ) cList putMVar (figures ecsg3d) cList + -- update 3d objects - cameras + cList <- takeMVar (cameras ecsg3d) + mapM (\(cc, mcp, mco) -> do + -- empty event queues + _popEvents cc + -- handle changes per single entity item + camTVal <- readC cc >>= return . fromJust + let newCam = fromStamped camTVal + mCache <- HT.lookup (camCache ecsg3d) (idC cc) + -- first create/update the figure object + newOb <- case mCache of + Nothing -> BA.addCamera g3ds newCam + Just (oldOb, oldCam, mPos, mOri) -> if oldCam /= camTVal then BA.updateCamera g3ds oldOb newCam else return oldOb + -- then handle the POS information - Position + newPos <- case mcp of + Just cp -> do + cpTVal <- readC cp >>= return . fromJust + let cpVal = fromStamped cpTVal + case mCache of + Nothing -> D.positionTo newOb cpVal + Just (oldOb, oldCam, mPos, mOri) -> if (fromJust mPos) /= cpTVal then D.positionTo newOb cpVal else return () + return $ Just cpTVal + Nothing -> return Nothing + -- then handle the POS information - Orientation + newOri <- case mco of + Just co -> do + coTVal <- readC co >>= return . fromJust + let coVal = fromStamped coTVal + case mCache of + Nothing -> D.orientationTo newOb coVal + Just (oldOb, oldCam, mPos, mOri) -> if (fromJust mOri) /= coTVal then D.orientationTo newOb coVal else return () + return $ Just coTVal + Nothing -> return Nothing + -- insert new values into cache + HT.insert (camCache ecsg3d) (idC cc) (newOb, camTVal, newPos, newOri) + ) cList + putMVar (cameras ecsg3d) cList -- run graphics (evt, qFlag) <- E.stepHGamer3D g3ds guis return (ecsg3d, qFlag) From cc105bc25e153adf3eac9c1be59271225d6f04da Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Fri, 18 Jul 2014 12:20:57 +0200 Subject: [PATCH 11/28] wow, Camera, Light, Figures all in ECS and working --- Audio/HGamer3D/Audio/Internal/Base.hs | 5 +- Graphics3D/HGamer3D-Graphics3D.cabal | 2 +- Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs | 1 + .../HGamer3D/Graphics3D/Internal/Base.hs | 196 ++++++-------- .../HGamer3D/Graphics3D/Internal/Camera.hs | 173 +++++++++++++ .../HGamer3D/Graphics3D/Internal/Light.hs | 77 +++--- .../HGamer3D/Graphics3D/Internal/Shapes.hs | 74 ++---- .../HGamer3D/Graphics3D/Schema/Light.hs | 21 +- .../HGamer3D/Graphics3D/Schema/Scene.hs | 42 +++ Graphics3D/HGamer3D/Internal/Graphics3D.hs | 4 +- Main/HGamer3D/Audio/Internal/SystemAudio.hs | 74 ++---- .../HGamer3D/Engine/Internal/ComponentType.hs | 1 + Main/HGamer3D/Engine/Internal/Entity.hs | 15 +- Main/HGamer3D/Engine/Internal/System.hs | 157 ++++++++++++ .../Engine/Internal/SystemGraphics3D.hs | 242 ++++++------------ 15 files changed, 637 insertions(+), 447 deletions(-) create mode 100644 Graphics3D/HGamer3D/Graphics3D/Internal/Camera.hs create mode 100644 Graphics3D/HGamer3D/Graphics3D/Schema/Scene.hs diff --git a/Audio/HGamer3D/Audio/Internal/Base.hs b/Audio/HGamer3D/Audio/Internal/Base.hs index 476f9f6..65dea3f 100644 --- a/Audio/HGamer3D/Audio/Internal/Base.hs +++ b/Audio/HGamer3D/Audio/Internal/Base.hs @@ -281,10 +281,13 @@ audioSlots schema@(AS.AudioSlots asList) = do obList <- mapM (\(s, as) -> makeSource as >>= \ob -> return (s, ob)) asList return $ AudioSlots (M.fromList obList) schema --- | update AudioSlots from change in data definition +-- | update AudioSlots from change in data definition, tbd updateAudioSlots :: AudioSlots -> AS.AudioSlots -> IO AudioSlots updateAudioSlots inSlots newSlots = return inSlots +-- | remove AudioSlots, tbd +removeAudioSlots :: AudioSlots -> IO () +removeAudioSlots as = return () instance HasPosition AudioSource where position = getAudioSourcePosition diff --git a/Graphics3D/HGamer3D-Graphics3D.cabal b/Graphics3D/HGamer3D-Graphics3D.cabal index e8f922e..bf4122b 100644 --- a/Graphics3D/HGamer3D-Graphics3D.cabal +++ b/Graphics3D/HGamer3D-Graphics3D.cabal @@ -21,7 +21,7 @@ Library Build-Depends: base >= 3 && < 5, containers, mtl, transformers, filepath, directory, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Ogre-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Graphics3D.Schema.Figure, HGamer3D.Graphics3D.Schema.Geometry, HGamer3D.Graphics3D.Schema.Camera, HGamer3D.Graphics3D.Schema.Light, HGamer3D.Graphics3D.Schema.Material, HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D.BaseAPI, HGamer3D.Internal.Graphics3D + Exposed-modules: HGamer3D.Graphics3D.Schema.Figure, HGamer3D.Graphics3D.Schema.Geometry, HGamer3D.Graphics3D.Schema.Camera, HGamer3D.Graphics3D.Schema.Light, HGamer3D.Graphics3D.Schema.Material, HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D.Internal.Camera, HGamer3D.Graphics3D.BaseAPI, HGamer3D.Internal.Graphics3D Other-modules: diff --git a/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs index f365cf2..f58cb7e 100644 --- a/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs +++ b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs @@ -83,6 +83,7 @@ where import HGamer3D.Graphics3D.Internal.Base import HGamer3D.Graphics3D.Internal.Light import HGamer3D.Graphics3D.Internal.Shapes + import HGamer3D.Graphics3D.Internal.Camera import HGamer3D.Graphics3D.Schema.Material diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs index 5f44c74..c8ae244 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs @@ -50,6 +50,7 @@ import HGamer3D.Bindings.Ogre.EnumRenderOperationOperationType import HGamer3D.Bindings.Ogre.StructHG3DClass import HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType import HGamer3D.Bindings.Ogre.ClassWindowEventUtilities as WindowEventUtilities +import HGamer3D.Bindings.Ogre.ClassSceneNode as SceneNode import Control.Monad import Control.Monad.Trans @@ -209,108 +210,6 @@ freeGraphics3D g3ds = do Root.delete root return () - -{- ---------------------------------------------------------------- - Camera - ---------------------------------------------------------------- -} - --- | Camera, internal data object for engine -data Camera = Camera { - cameraCamObject :: HG3DClass, - cameraViewportObject :: HG3DClass, - cameraSchema :: Cam.Camera - } - --- | add a camera, you probably want to do this at least once -addCamera :: Graphics3DSystem -- ^ the graphics system - -> Cam.Camera -- ^ the Schema data for the camera - -> IO Camera -- ^ the resulting engine object -addCamera g3ds schema = do - let (SceneManager sceneManager) = g3dsSceneManager g3ds - let uname = g3dsUniqueName g3ds - let (RenderTarget renderWindow) = g3dsRenderTarget g3ds - let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema - -- create camera - cameraName <- (nextUniqueName uname) >>= (\n -> return ("Camera"++n)) - camera <- SceneManager.createCamera sceneManager cameraName - -- set Frustum parameters - Frustum.setNearClipDistance camera nd - Frustum.setFarClipDistance camera fd - Frustum.setFOVy camera (fromAngle fov) - -- add Viewport - viewport <- RenderTarget.addViewport renderWindow camera z (rectX pos) (rectY pos) (rectWidth pos) (rectHeight pos) - -- set Viewport parameters - Viewport.setBackgroundColour viewport bgr - -- create camera return value - let cam = Camera camera viewport schema - -- adapt aspect ratio - cameraAdaptAspectRatio cam - - return cam - --- | remove a camera -removeCamera :: Graphics3DSystem -> Camera -> IO () -removeCamera g3ds (Camera camera viewport schema) = do - let (SceneManager sceneManager) = g3dsSceneManager g3ds - let (RenderTarget renderWindow) = g3dsRenderTarget g3ds - let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema - RenderTarget.removeViewport renderWindow z - SceneManager.destroyCamera sceneManager camera - --- | update an existing camera with new parameters -updateCamera :: Graphics3DSystem -> Camera -> Cam.Camera -> IO Camera -updateCamera g3ds cam@(Camera camera viewport schema) schema' = do - - let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema - let Cam.Camera (Cam.Frustum nd' fd' fov') (Cam.Viewport z' pos' bgr') = schema' - -- if zorder or position are not equal, we need to rebuild - if (z /= z') || (pos /= pos') then do - removeCamera g3ds cam - addCamera g3ds schema' - else do - -- adapt single values, as needed - if nd /= nd' then Frustum.setNearClipDistance camera nd' else return () - if fd /= fd' then Frustum.setFarClipDistance camera fd' else return () - if fov /= fov' then Frustum.setFOVy camera (fromAngle fov') else return () - if bgr /= bgr' then Viewport.setBackgroundColour viewport bgr' else return () - return (Camera camera viewport schema') - --- | adapt the aspect ration, in case the window size and aspect ratio changes, this --- is called inside the engine automatically. -cameraAdaptAspectRatio :: Camera -> IO () -cameraAdaptAspectRatio cam = do - let (Camera camera viewport schema) = cam - height <- Viewport.getActualHeight viewport - width <- Viewport.getActualWidth viewport - Frustum.setAspectRatio camera ((fromIntegral width) / (fromIntegral height)) - return () - -instance HasPosition Camera where - position (Camera c _ _) = Camera.getPosition c - positionTo (Camera c _ _) pos = Camera.setPosition2 c pos - -instance HasOrientation Camera where - orientation (Camera c _ _) = do - q <- Camera.getOrientation c - let uq = mkNormal q - return uq - orientationTo (Camera c _ _) uq = do - Camera.setOrientation c (fromNormal uq) - return () - --- | set the direction in a way, that the camera looks toward a specified point -cameraLookAt :: Camera -> Vec3 -> IO () -cameraLookAt (Camera c _ _) v = do - Camera.lookAt c v - return () - --- | Background colour of the 3d drawing window -setBackgroundColour :: Graphics3DSystem -> Camera -> Colour -> IO Camera -setBackgroundColour g3ds cam@(Camera camera viewport schema) bgColour = do - let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema - let schema' = Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgColour) - updateCamera g3ds cam schema' - -- | adds a resource location for 3D media (Ogre) addResourceLocationMedia :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D -> String -- ^ path to new resource location, the path should identify a directory @@ -353,12 +252,56 @@ renderOneFrame g3ds = do Root.renderOneFrame root return () --- | Typed Ogre Classes: Entity -data OEntity = OE HG3DClass -- this object is an Ogre Entity -- | Typed Ogre Classes: Node data ONode = ON HG3DClass -- this object is an Ogre Node +-- | Typed Ogre Classes: Entity +data OEntity = OE HG3DClass -- this object is an Ogre Entity + +-- | Typed Ogre Classes: Light +data OLight = OL HG3DClass -- this object is an Ogre Light + +-- | Typed Ogre Classes: Camera +data OCamera = OC HG3DClass -- this object is an Ogre Camera + +-- | Typed Ogre Classes: Material +data OMaterial = OM HG3DClass -- this object is an Ogre Material + + +-- | Typeclass for types, which have a main Node +class HasNode a where + getNode :: a -> ONode + getNode' :: a -> HG3DClass + getNode' = (\(ON n) -> n) . getNode + setNodePos :: a -> Position -> IO () + setNodePos hn pos = Node.setPosition (getNode' hn) pos + setNodeOri :: a -> Orientation -> IO () + setNodeOri hn ori = Node.setOrientation (getNode' hn) (fromNormal ori) + setNodeSiz :: a -> Size -> IO () + setNodeSiz hn siz = Node.setScale (getNode' hn) siz + +instance HasNode ONode where + getNode n = n + +-- | Typeclass for objects which can be attached to Nodes +class NodeContent a where + attachToNode :: a -> ONode -> IO () + detachFromNode :: a -> ONode -> IO () + +instance NodeContent OEntity where + attachToNode (OE en) (ON n) = SceneNode.attachObject n en + detachFromNode (OE en) (ON n) = SceneNode.detachObject2 n en + +instance NodeContent OCamera where + attachToNode (OC en) (ON n) = SceneNode.attachObject n en + detachFromNode (OC en) (ON n) = SceneNode.detachObject2 n en + +instance NodeContent OLight where + attachToNode (OL en) (ON n) = SceneNode.attachObject n en + detachFromNode (OL en) (ON n) = SceneNode.detachObject2 n en + + -- | -- For the data driven API, we need an internal representation, which -- holds state inside the engine for outside defined data items (see Schema). @@ -382,14 +325,39 @@ class Graphics3DItem a where update3D :: Graphics3DSystem -> Object3D a -> a -> IO (Object3D a) remove3D :: Graphics3DSystem -> (Object3D a) -> IO () -_getNode :: EngineData -> ONode -_getNode edata = case edata of - (EDEntityNode _ node) -> node - (EDNodeAndSub node _) -> node - -_getNode' :: Object3D a -> HG3DClass -_getNode' (Object3D edata _) = case edata of - (EDEntityNode (OE entity) (ON node)) -> node - (EDNodeAndSub (ON node) _) -> node - +instance HasNode EngineData where + getNode (EDEntityNode _ node) = node + getNode (EDNodeAndSub node _) = node + +instance HasNode (Object3D a) where + getNode (Object3D (EDEntityNode _ node) _) = node + getNode (Object3D (EDNodeAndSub node _) _) = node + +_getRootNode :: Graphics3DSystem -> IO ONode +_getRootNode g3ds = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + rootNode <- SceneManager.getRootSceneNode scm + return (ON rootNode) + +_createSubNode :: ONode -> IO ONode +_createSubNode (ON parent) = SceneNode.createChildSceneNode parent zeroVec3 unitQ >>= (return . ON) + +_addEntityToNode :: Graphics3DSystem -> ONode -> OEntity -> IO () +_addEntityToNode g3ds(ON node) (OE meshEntity) = SceneNode.attachObject node meshEntity + +_exchangeEntityInNode :: Graphics3DSystem -> ONode -> OEntity -> OEntity -> IO () +_exchangeEntityInNode g3ds (ON meshNode) (OE oldMeshEntity) (OE newMeshEntity) = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + SceneNode.detachObject2 meshNode oldMeshEntity + SceneManager.destroyEntity scm oldMeshEntity + SceneNode.attachObject meshNode newMeshEntity + +_removeEntityAndNode :: Graphics3DSystem -> ONode -> OEntity -> ONode -> IO () +_removeEntityAndNode g3ds (ON parent) (OE meshEntity ) (ON meshNode) = do + let (SceneManager scm) = (g3dsSceneManager g3ds) + rootNode <- SceneManager.getRootSceneNode scm + SceneNode.detachObject2 meshNode meshEntity + SceneManager.destroyEntity scm meshEntity + Node.removeChild2 parent meshNode + SceneManager.destroySceneNode2 scm meshNode diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Camera.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Camera.hs new file mode 100644 index 0000000..eff3b9c --- /dev/null +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Camera.hs @@ -0,0 +1,173 @@ +{-# OPTIONS_HADDOCK hide #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Graphics3D/Internal/Camera.hs + +module HGamer3D.Graphics3D.Internal.Camera +where + +import HGamer3D.Data +import HGamer3D.Data.HG3DClass +import HGamer3D.Data.Window + +import HGamer3D.Util + +import qualified HGamer3D.Bindings.Ogre.ClassRoot as Root +import HGamer3D.Bindings.Ogre.ClassCamera as Camera +import HGamer3D.Bindings.Ogre.ClassNode as Node +import HGamer3D.Bindings.Ogre.ClassSceneManager as SceneManager +import HGamer3D.Bindings.Ogre.ClassResourceGroupManager as ResourceGroupManager +import HGamer3D.Bindings.Ogre.ClassTextureManager as TextureManager +import HGamer3D.Bindings.Ogre.ClassControllerManager as ControllerManager +import HGamer3D.Bindings.Ogre.ClassViewport as Viewport +import HGamer3D.Bindings.Ogre.ClassFrustum as Frustum +import HGamer3D.Bindings.Ogre.ClassAnimationState as AnimationState +import HGamer3D.Bindings.Ogre.ClassEntity as Entity +import HGamer3D.Bindings.Ogre.ClassControllerManager as ControllerManager +import HGamer3D.Bindings.Ogre.ClassLogManager as LogManager +import HGamer3D.Bindings.Ogre.ClassLog as Log +import HGamer3D.Bindings.Ogre.ClassHG3DUtilities as Util +import HGamer3D.Bindings.Ogre.ClassRenderTarget as RenderTarget +import HGamer3D.Bindings.Ogre.ClassManualObject as ManualObject +import HGamer3D.Bindings.Ogre.EnumRenderOperationOperationType +import HGamer3D.Bindings.Ogre.StructHG3DClass +import HGamer3D.Bindings.Ogre.EnumSceneManagerPrefabType +import HGamer3D.Bindings.Ogre.ClassWindowEventUtilities as WindowEventUtilities + +import Control.Monad +import Control.Monad.Trans +import Control.Monad.IO.Class +import Control.Monad.State.Class +import qualified System.Info as SI + +import Control.Concurrent +import Data.Maybe + +import HGamer3D.Data +import HGamer3D.Util + +import HGamer3D.Graphics3D.Schema.Material +import HGamer3D.Graphics3D.Schema.Geometry +import HGamer3D.Graphics3D.Schema.Figure +import qualified HGamer3D.Graphics3D.Schema.Camera as Cam +import HGamer3D.Graphics3D.Internal.Base + + +{- ---------------------------------------------------------------- + Camera + ---------------------------------------------------------------- -} + +-- | Camera, internal data object for engine +data Camera = Camera { + cameraCamObject :: HG3DClass, + cameraViewportObject :: HG3DClass, + cameraSchema :: Cam.Camera + } + +-- | add a camera, you probably want to do this at least once +addCamera :: Graphics3DSystem -- ^ the graphics system + -> Cam.Camera -- ^ the Schema data for the camera + -> IO Camera -- ^ the resulting engine object +addCamera g3ds schema = do + let (SceneManager sceneManager) = g3dsSceneManager g3ds + let uname = g3dsUniqueName g3ds + let (RenderTarget renderWindow) = g3dsRenderTarget g3ds + let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema + -- create camera + cameraName <- (nextUniqueName uname) >>= (\n -> return ("Camera"++n)) + camera <- SceneManager.createCamera sceneManager cameraName + -- set Frustum parameters + Frustum.setNearClipDistance camera nd + Frustum.setFarClipDistance camera fd + Frustum.setFOVy camera (fromAngle fov) + -- add Viewport + viewport <- RenderTarget.addViewport renderWindow camera z (rectX pos) (rectY pos) (rectWidth pos) (rectHeight pos) + -- set Viewport parameters + Viewport.setBackgroundColour viewport bgr + -- create camera return value + let cam = Camera camera viewport schema + -- adapt aspect ratio + cameraAdaptAspectRatio cam + + return cam + +-- | remove a camera +removeCamera :: Graphics3DSystem -> Camera -> IO () +removeCamera g3ds (Camera camera viewport schema) = do + let (SceneManager sceneManager) = g3dsSceneManager g3ds + let (RenderTarget renderWindow) = g3dsRenderTarget g3ds + let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema + RenderTarget.removeViewport renderWindow z + SceneManager.destroyCamera sceneManager camera + +-- | update an existing camera with new parameters +updateCamera :: Graphics3DSystem -> Camera -> Cam.Camera -> IO Camera +updateCamera g3ds cam@(Camera camera viewport schema) schema' = do + + let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema + let Cam.Camera (Cam.Frustum nd' fd' fov') (Cam.Viewport z' pos' bgr') = schema' + -- if zorder or position are not equal, we need to rebuild + if (z /= z') || (pos /= pos') then do + removeCamera g3ds cam + addCamera g3ds schema' + else do + -- adapt single values, as needed + if nd /= nd' then Frustum.setNearClipDistance camera nd' else return () + if fd /= fd' then Frustum.setFarClipDistance camera fd' else return () + if fov /= fov' then Frustum.setFOVy camera (fromAngle fov') else return () + if bgr /= bgr' then Viewport.setBackgroundColour viewport bgr' else return () + return (Camera camera viewport schema') + +-- | adapt the aspect ration, in case the window size and aspect ratio changes, this +-- is called inside the engine automatically. +cameraAdaptAspectRatio :: Camera -> IO () +cameraAdaptAspectRatio cam = do + let (Camera camera viewport schema) = cam + height <- Viewport.getActualHeight viewport + width <- Viewport.getActualWidth viewport + Frustum.setAspectRatio camera ((fromIntegral width) / (fromIntegral height)) + return () + +instance HasPosition Camera where + position (Camera c _ _) = Camera.getPosition c + positionTo (Camera c _ _) pos = Camera.setPosition2 c pos + +instance HasOrientation Camera where + orientation (Camera c _ _) = do + q <- Camera.getOrientation c + let uq = mkNormal q + return uq + orientationTo (Camera c _ _) uq = do + Camera.setOrientation c (fromNormal uq) + return () + +-- | set the direction in a way, that the camera looks toward a specified point +cameraLookAt :: Camera -> Vec3 -> IO () +cameraLookAt (Camera c _ _) v = do + Camera.lookAt c v + return () + +-- | Background colour of the 3d drawing window +setBackgroundColour :: Graphics3DSystem -> Camera -> Colour -> IO Camera +setBackgroundColour g3ds cam@(Camera camera viewport schema) bgColour = do + let Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgr) = schema + let schema' = Cam.Camera (Cam.Frustum nd fd fov) (Cam.Viewport z pos bgColour) + updateCamera g3ds cam schema' + diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs index f77f32d..b88c336 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Light.hs @@ -5,7 +5,7 @@ -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.hgamer3d.org -- --- (c) 2011-2013 Peter Althainz +-- (c) 2011-2014 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. @@ -81,50 +81,55 @@ import qualified HGamer3D.Graphics3D.Schema.Light as L -- | The light. -data Light = Light (Maybe HG3DClass) L.Light +data Light = Light ONode OLight L.Light -instance HasPosition Light where +instance HasNode Light where + getNode (Light node _ _) = node - position (Light ml _) = case ml of - Just l -> Light.getPosition l - Nothing -> error "HGamer3D.Graphics3D.Internal.Light: this light does not have a position" - - positionTo (Light ml _) (Vec3 x y z) = case ml of - Just l -> Light.setPosition l x y z - Nothing -> return () +instance HasPosition Light where + position obj = Node.getPosition (getNode' obj) + positionTo obj pos = Node.setPosition (getNode' obj) pos + +instance HasOrientation Light where + orientation obj = do + q <- Node.getOrientation (getNode' obj) + let uq = mkNormal q + return uq + orientationTo obj uq = do + Node.setOrientation (getNode' obj) (fromNormal uq) + return () addLight :: Graphics3DSystem -> L.Light -> IO Light addLight g3ds schema = do let (SceneManager scm) = (g3dsSceneManager g3ds) let (L.Light diffuse@(Colour r g b _) specular@(Colour r' g' b' _) ltype) = schema - case ltype of - L.AmbientLight -> do - SceneManager.setAmbientLight scm diffuse - return $ Light Nothing schema - _ -> do - lightName <- nextUniqueName (g3dsUniqueName g3ds) - light <- SceneManager.createLight scm lightName - Light.setDiffuseColour light r g b - Light.setSpecularColour light r' g' b' - case ltype of - L.PointLight -> Light.setType light LT_POINT - L.DirectionalLight dir -> do - Light.setType light LT_DIRECTIONAL - Light.setDirection2 light dir - L.SpotLight dir inner outer -> do - Light.setType light LT_SPOTLIGHT - Light.setDirection2 light dir - Light.setSpotlightInnerAngle light (fromAngle inner) - Light.setSpotlightOuterAngle light (fromAngle outer) - return $ Light (Just light) schema + lightName <- nextUniqueName (g3dsUniqueName g3ds) + light <- SceneManager.createLight scm lightName + Light.setDiffuseColour light r g b + Light.setSpecularColour light r' g' b' + case ltype of + L.PointLight -> Light.setType light LT_POINT + L.DirectionalLight dir -> do + Light.setType light LT_DIRECTIONAL + Light.setDirection2 light dir + L.SpotLight dir inner outer -> do + Light.setType light LT_SPOTLIGHT + Light.setDirection2 light dir + Light.setSpotlightInnerAngle light (fromAngle inner) + Light.setSpotlightOuterAngle light (fromAngle outer) + let l = OL light + rn <- _getRootNode g3ds + n <- _createSubNode rn + attachToNode l n + return $ Light n l schema removeLight :: Graphics3DSystem -> Light -> IO () -removeLight g3ds (Light ml schema) = do +removeLight g3ds (Light n@(ON node) l@(OL light) schema) = do let (SceneManager scm) = (g3dsSceneManager g3ds) - let (L.Light diffuse@(Colour r g b _) specular@(Colour r' g' b' _) ltype) = schema - case ltype of - L.AmbientLight -> SceneManager.setAmbientLight scm black -- set to black -> no light - _ -> SceneManager.destroyLight2 scm (fromJust ml) -- remove light from scene + detachFromNode l n + (ON rn) <- _getRootNode g3ds + Node.removeChild2 rn node + SceneManager.destroyLight2 scm light updateLight :: Graphics3DSystem -> Light -> L.Light -> IO Light updateLight g3ds l schema = do @@ -170,7 +175,7 @@ spotLight g3ds diffuse specular pos dir inner outer = do -- | sets spotlight direction spotLightSetDirection :: Graphics3DSystem -> Light -> Vec3 -> IO Light spotLightSetDirection g3ds light dir' = do - let (Light l schema) = light + let (Light n l schema) = light let (L.Light diffuse@(Colour r g b _) specular@(Colour r' g' b' _) ltype) = schema case ltype of (L.SpotLight dir inner outer) -> updateLight g3ds light (L.Light diffuse specular (L.SpotLight dir' inner outer)) diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs index 93134fa..51e689a 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs @@ -97,36 +97,9 @@ _createGeometry g3ds geo = do _ -> error "HGamer3D.Graphics3D.Internal.Shapes._createMesh: Geo not implemented" return $ OE entity -_getRootNode :: Graphics3DSystem -> IO ONode -_getRootNode g3ds = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - rootNode <- SceneManager.getRootSceneNode scm - return (ON rootNode) - -_createSubNode :: ONode -> IO ONode -_createSubNode (ON parent) = SceneNode.createChildSceneNode parent zeroVec3 unitQ >>= (return . ON) - _buildTV :: OEntity -> IO () _buildTV (OE entity) = HG3DUtils.buildTangentVectors entity -_addEntityToNode :: Graphics3DSystem -> ONode -> OEntity -> IO () -_addEntityToNode g3ds(ON node) (OE meshEntity) = SceneNode.attachObject node meshEntity - -_exchangeEntityInNode :: Graphics3DSystem -> ONode -> OEntity -> OEntity -> IO () -_exchangeEntityInNode g3ds (ON meshNode) (OE oldMeshEntity) (OE newMeshEntity) = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - SceneNode.detachObject2 meshNode oldMeshEntity - SceneManager.destroyEntity scm oldMeshEntity - SceneNode.attachObject meshNode newMeshEntity - -_removeEntityAndNode :: Graphics3DSystem -> ONode -> OEntity -> ONode -> IO () -_removeEntityAndNode g3ds (ON parent) (OE meshEntity ) (ON meshNode) = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - rootNode <- SceneManager.getRootSceneNode scm - SceneNode.detachObject2 meshNode meshEntity - SceneManager.destroyEntity scm meshEntity - Node.removeChild2 parent meshNode - SceneManager.destroySceneNode2 scm meshNode {- ------------------------------------------------------------------------------- EngineItem for Figure @@ -139,28 +112,6 @@ _createResourceFigure g3ds name = do entity <- SceneManager.createEntity3 scm name return $ OE entity -_setNodeP :: EngineData -> Position -> IO () -_setNodeP edata pos = do - let (ON node) = _getNode edata - Node.setPosition node pos - -_setNodeO :: EngineData -> Orientation -> IO () -_setNodeO edata ori = do - let (ON node) = _getNode edata - Node.setOrientation node (fromNormal ori) - -_setNodeS :: EngineData -> Size -> IO () -_setNodeS edata size = do - let (ON node) = _getNode edata - Node.setScale node size - -_setNodePOS :: EngineData -> Position -> Orientation -> Size -> IO () -_setNodePOS edata pos ori size = do - let (ON node) = _getNode edata - Node.setPosition node pos - Node.setOrientation node (fromNormal ori) - Node.setScale node size - _setMaterial :: OEntity -> Material -> IO () _setMaterial (OE entity) material = do case material of @@ -168,6 +119,11 @@ _setMaterial (OE entity) material = do Entity.setMaterialName entity name "General" _ -> error "HGamer3D.Graphics3D.Internal.Shapes._setMaterial: Material not implemented" +_setNodePOS n pos ori siz = do + setNodePos n pos + setNodeOri n ori + setNodeSiz n siz + _createFigure :: Graphics3DSystem -> ONode -> Figure -> IO (EngineData) _createFigure g3ds parent fig = do node <- _createSubNode parent @@ -202,7 +158,7 @@ data UpdateActions = ResetMaterial _updateFigure :: Graphics3DSystem -> ONode -> EngineData -> Figure -> Figure -> IO (EngineData) _updateFigure g3ds parent edata oldFig newFig = do - let node = _getNode edata + let node = getNode edata -- check, which action is needed @@ -262,9 +218,9 @@ _updateFigure g3ds parent edata oldFig newFig = do let (EDNodeAndSub node' edOldArr) = edata outArr <- mapM ( \(oldED, (posO, oriO, sizeO, oldFig), (posN, oriN, sizeN, newFig)) -> do newED <- _updateFigure g3ds node' oldED oldFig newFig - if posO /= posN then _setNodeP newED posN else return () - if oriO /= oriN then _setNodeO newED oriN else return () - if sizeO /= sizeN then _setNodeS newED sizeN else return () + if posO /= posN then setNodePos newED posN else return () + if oriO /= oriN then setNodeOri newED oriN else return () + if sizeO /= sizeN then setNodeSiz newED sizeN else return () return newED ) (zip3 edOldArr oldSubs newSubs) return (EDNodeAndSub node' outArr) @@ -338,20 +294,20 @@ ikosaeder g3ds len material = object3D g3ds (CombinedFigure [ (zeroVec3, unitU, Vec3 len len len, SimpleFigure Ikosaeder material) ]) instance HasPosition (Object3D Figure) where - position obj = Node.getPosition (_getNode' obj) - positionTo obj pos = Node.setPosition (_getNode' obj) pos + position obj = Node.getPosition (getNode' obj) + positionTo obj pos = Node.setPosition (getNode' obj) pos instance HasSize (Object3D Figure) where - size obj = Node.getScale (_getNode' obj) - sizeTo obj pos = Node.setScale (_getNode' obj) pos + size obj = Node.getScale (getNode' obj) + sizeTo obj pos = Node.setScale (getNode' obj) pos instance HasOrientation (Object3D Figure) where orientation obj = do - q <- Node.getOrientation (_getNode' obj) + q <- Node.getOrientation (getNode' obj) let uq = mkNormal q return uq orientationTo obj uq = do - Node.setOrientation (_getNode' obj) (fromNormal uq) + Node.setOrientation (getNode' obj) (fromNormal uq) return () {- diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs index 5e61d44..2a19866 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Light.hs @@ -28,22 +28,21 @@ import Data.Typeable import HGamer3D.Data as Dat -{- - Basic facts about light: - - Ambient light is just a colour value, which is the light, which is everywhere, when no other light is shining. - - pointlight does have a position and emitts equally from there - - spotlight has position, direction, inner and outer angle specifiyng the cone of the spotlight --} -- | The Light data type -data Light = Light Colour Colour LightType -- ^ diffuse colour, specular colour, light type +data Light = Light { + diffuseColour :: Colour, + specularColour :: Colour, + lightType :: LightType + } deriving (Eq, Show, Typeable) -data LightType = AmbientLight -- ^ Light which is magically everywhere (specular colour ignored) - | PointLight -- ^ A source shining from one location - | DirectionalLight Vec3 -- ^ A source shining from one direction (like hte sun) - | SpotLight Vec3 Angle Angle -- ^ A source shining from one location into one direction with a cone, angles are inner angle, outer angle (a flashlight). Angles should be between 5 and 355 degrees. +data LightType = PointLight -- ^ A source shining from one location + | DirectionalLight Vec3 -- ^ A source shining from one direction (like the sun) + | SpotLight Vec3 Angle Angle -- ^ A source shining from one location into one direction with a cone, + -- angles are inner angle, outer angle (a flashlight). + -- Angles should be between 5 and 355 degrees. deriving (Eq, Show, Typeable) diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Scene.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Scene.hs new file mode 100644 index 0000000..b392304 --- /dev/null +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Scene.hs @@ -0,0 +1,42 @@ +{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Graphics3D/Schema/Scene.hs + +-- | Types which describe global Scene Parameters +module HGamer3D.Graphics3D.Schema.Scene + +where + +import Data.Typeable + +import HGamer3D.Data as Dat + +data SceneParameter = SceneParameter { + ambientLight :: Colour, + shadowType :: ShadowType + } deriving (Eq, Show, Typeable) + +data ShadowType = NoShadows + | TextureAdditive + | TextureModulativevi + | StencilAdditive + | StencilModulative + deriving (Eq, Show, Typeable) + diff --git a/Graphics3D/HGamer3D/Internal/Graphics3D.hs b/Graphics3D/HGamer3D/Internal/Graphics3D.hs index 7a60c07..08318f8 100644 --- a/Graphics3D/HGamer3D/Internal/Graphics3D.hs +++ b/Graphics3D/HGamer3D/Internal/Graphics3D.hs @@ -25,7 +25,8 @@ module HGamer3D.Internal.Graphics3D module HGamer3D.Graphics3D.Internal.Base, module HGamer3D.Graphics3D.Internal.Shapes, module HGamer3D.Graphics3D.Internal.Light, - module HGamer3D.Graphics3D.Internal.PlatonShapes + module HGamer3D.Graphics3D.Internal.PlatonShapes, + module HGamer3D.Graphics3D.Internal.Camera ) where @@ -34,3 +35,4 @@ import HGamer3D.Graphics3D.Internal.Base import HGamer3D.Graphics3D.Internal.Shapes import HGamer3D.Graphics3D.Internal.Light import HGamer3D.Graphics3D.Internal.PlatonShapes +import HGamer3D.Graphics3D.Internal.Camera diff --git a/Main/HGamer3D/Audio/Internal/SystemAudio.hs b/Main/HGamer3D/Audio/Internal/SystemAudio.hs index f233669..ac81118 100644 --- a/Main/HGamer3D/Audio/Internal/SystemAudio.hs +++ b/Main/HGamer3D/Audio/Internal/SystemAudio.hs @@ -46,16 +46,11 @@ import qualified HGamer3D.Audio.Internal.Base as A import qualified HGamer3D.Audio.Schema.AudioSource as AS import qualified HGamer3D.Audio.Schema.AudioListener as AL -type IdHashTable v = HT.BasicHashTable ComponentId v -- | the Audio System of the Entity-Component-System World data ECSAudio = ECSAudio { - audioSlots :: MVar [(Component, Maybe Component)], -- AudioSlots, Position - audioSlotsCache :: IdHashTable ( - A.AudioSlots, - StampedValue AS.AudioSlots, - Maybe (StampedValue D.Position) - ) + audioSlots :: ListAndCache AS.AudioSlots A.AudioSlots, + positions :: ListAndCache D.Position () } _handleEvent map evt = do @@ -74,65 +69,26 @@ _handleEvent map evt = do instance System ECSAudio where addEntity system entity = do - oldList <- takeMVar (audioSlots system) - let mCom = entity #? CTASl - let newList = case mCom of - Just com -> let - p = entity #? CTPos - in ((com, p) : oldList) - Nothing -> oldList - putMVar (audioSlots system) newList + lacAdd entity (audioSlots system) + lacAdd entity (positions system) return system - removeEntity system entity = return system - -{- - removeEntity ecsg3d entity = do - let (g3ds, guis, camera, viewport) = g3d - let removeFunction mvList cache = do - oldList <- takeMVar mvList - - let newList = filter ( (/=) --} + removeEntity system entity = do + lacRemove entity (audioSlots system) + lacRemove entity (positions system) + return system initializeSystem = do - audioSlots <- newMVar [] - audioSlotsCache <- HT.new - return $ (ECSAudio audioSlots audioSlotsCache) + audioSlots <- lacInitialize CTASl + positions <- lacInitialize CTPos + return $ (ECSAudio audioSlots positions) stepSystem system = do - -- update audio objects - cList <- takeMVar (audioSlots system) - mapM (\(com, mcp) -> do - mOldCache <- HT.lookup (audioSlotsCache system) (idC com) - -- handle events - evts <- _popEvents com - case mOldCache of - Just (A.AudioSlots map _, _, _) -> mapM (_handleEvent map) evts >> return () - Nothing -> return () - -- handle changes per single entity item - comTVal <- readC com >>= return . fromJust - let newCom = fromStamped comTVal - -- first create/update the audiosource object - newOb <- case mOldCache of - Nothing -> A.audioSlots newCom - Just (oldOb, oldComTVal, mPos) -> if oldComTVal /= comTVal then A.updateAudioSlots oldOb newCom else return oldOb - -- then handle the PO information - Position - newPos <- case mcp of - Just cp -> do - posTVal <- readC cp >>= return . fromJust - let posVal = fromStamped posTVal - case mOldCache of - Nothing -> D.positionTo newOb posVal - Just (oldOb, oldComTVal, mPos) -> if (fromJust mPos) /= posTVal then D.positionTo newOb posVal else return () - return $ Just posTVal - Nothing -> return Nothing - -- insert new values into cache - HT.insert (audioSlotsCache system) (idC com) (newOb, comTVal, newPos) - ) cList - putMVar (audioSlots system) cList + lacApplyChanges (audioSlots system) A.audioSlots A.updateAudioSlots A.removeAudioSlots + let update' pos edata schema = D.positionTo edata pos + lacApplyOtherChanges (positions system) (audioSlots system) update' return (system, False) - + shutdownSystem system = return () runSystemAudio :: D.TimeMS -> IO ECSAudio diff --git a/Main/HGamer3D/Engine/Internal/ComponentType.hs b/Main/HGamer3D/Engine/Internal/ComponentType.hs index a0c4eae..cec1dd3 100644 --- a/Main/HGamer3D/Engine/Internal/ComponentType.hs +++ b/Main/HGamer3D/Engine/Internal/ComponentType.hs @@ -34,6 +34,7 @@ data ComponentType = CTPos -- ^ Position | CTASl -- ^ Audio Slots | CTALs -- ^ Audio Listener | CTCam -- ^ Cameras + | CTLig -- ^ Light deriving (Eq, Ord, Show) diff --git a/Main/HGamer3D/Engine/Internal/Entity.hs b/Main/HGamer3D/Engine/Internal/Entity.hs index 3555a86..0cbca1c 100644 --- a/Main/HGamer3D/Engine/Internal/Entity.hs +++ b/Main/HGamer3D/Engine/Internal/Entity.hs @@ -34,8 +34,10 @@ import Control.Concurrent.MVar import qualified Data.Map as M import Data.Maybe import Data.Typeable +import System.Mem.StableName -data Entity = Entity (M.Map ComponentType Component) +type EntityId = StableName (M.Map ComponentType Component) +data Entity = Entity (M.Map ComponentType Component) EntityId -- -- pure Data functions, creating, traversing and getting components from entities @@ -46,16 +48,21 @@ entity inList = do outList <- mapM (\(c, val) -> do val' <- val return (c, val')) inList - return $ Entity (M.fromList outList) + let cMap = M.fromList outList + eId <- makeStableName cMap + return $ Entity cMap eId + +idE :: Entity -> EntityId +idE (Entity _ eId) = eId sendEvent :: Entity -> HG3DEvent -> IO () -sendEvent (Entity map) event = mapM (\(ct, c) -> _pushEvent c event) (M.toList map) >> return () +sendEvent (Entity map _) event = mapM (\(ct, c) -> _pushEvent c event) (M.toList map) >> return () (#:) :: Typeable a => ComponentType -> a -> (ComponentType, IO Component) (#:) ec val = (ec, newC val) (#?) :: Entity -> ComponentType -> Maybe Component -(Entity map) #? name = M.lookup name map +(Entity map _) #? name = M.lookup name map infix 8 #? (#) :: Entity -> ComponentType -> Component diff --git a/Main/HGamer3D/Engine/Internal/System.hs b/Main/HGamer3D/Engine/Internal/System.hs index 360c9a5..c64c100 100644 --- a/Main/HGamer3D/Engine/Internal/System.hs +++ b/Main/HGamer3D/Engine/Internal/System.hs @@ -32,15 +32,172 @@ import Control.Concurrent.MVar import qualified Data.Map as M import Data.Maybe import Data.Typeable +import Data.IORef import HGamer3D.Data as D import HGamer3D.Engine.Internal.Component +import HGamer3D.Engine.Internal.ComponentType import HGamer3D.Engine.Internal.Entity import System.Clock import System.Mem.StableName import Data.Hashable +import qualified Data.HashTable.IO as HT + +-- the class of data types which have a pure and engine implementation and which can be updated + + + +-- utility functions for systems + +type IdHashTable v = HT.BasicHashTable EntityId v + +data ListAndCache schema engine = ListAndCache { + -- access from two threads + lacAddList :: MVar [(EntityId, Component)], + lacRemoveList :: MVar [EntityId], + -- access from g3ds thread only + lacList :: IORef [(EntityId, Component)], + lacCache :: IdHashTable (engine, StampedValue schema), + lacType :: ComponentType + } + +-- initialize +lacInitialize :: (Typeable schema, Eq schema) => ComponentType -> IO (ListAndCache schema engine) +lacInitialize ct = do + listAdd <- newMVar [] + listRemove <- newMVar [] + listIO <- newIORef [] + cache <- HT.new + return (ListAndCache listAdd listRemove listIO cache ct) + +-- add component for entry +lacAdd :: (Typeable schema, Eq schema) => Entity -> ListAndCache schema engine -> IO () +lacAdd e lac = do + oldList <- takeMVar (lacAddList lac) + let mCom = e #? (lacType lac) + let newList = case mCom of + Just com -> ((idE e, com) : oldList) + Nothing -> oldList + putMVar (lacAddList lac) newList + +-- add component for delete +lacRemove :: (Typeable schema, Eq schema) => Entity -> ListAndCache schema engine -> IO () +lacRemove e lac = do + oldList <- takeMVar (lacRemoveList lac) + putMVar (lacRemoveList lac) (idE e : oldList) + + +-- step system, apply all changes, this is for main components, where direct responsibility exists +lacApplyChanges :: (Typeable schema, Eq schema) => + ListAndCache schema engine -- ^ list and cache data structure + -> (schema -> IO engine) -- ^ create function for new entries + -> (engine -> schema -> IO engine) -- ^ update function for changing entries + -> (engine -> IO ()) -- ^ remove functions for removed entries + -> IO () +lacApplyChanges lac create update remove = do + -- insert + insertList <- takeMVar (lacAddList lac) + mapM (\(eid, c) -> do + stampedVal <- readC c >>= return . fromJust + let val = fromStamped stampedVal + engineVal <- create val + HT.insert (lacCache lac) eid (engineVal, stampedVal) + modifyIORef (lacList lac) ( (:) (eid, c) ) + ) insertList + putMVar (lacAddList lac) [] + + -- remove + removeList <- takeMVar (lacRemoveList lac) + mapM (\eid -> do + -- get cached value and remove + mCacheVal <- HT.lookup (lacCache lac) eid + case mCacheVal of + Just (engineVal, stampedCacheVal) -> do + remove engineVal + HT.delete (lacCache lac) eid + Nothing -> error "HGamer3D.Engine.Internal.System.applyAnyChanges: cache value not found" + -- remove from current list + modifyIORef (lacList lac) (filter (\(eid', c) -> eid /= eid')) + ) removeList + putMVar (lacRemoveList lac) [] + + -- apply changes from compenents, taken from stamp + currList <- readIORef (lacList lac) + mapM (\(eid, c) -> do + -- handle Events + evts <- _popEvents c + mCacheVal <- HT.lookup (lacCache lac) eid + case mCacheVal of + Just (engineVal, stampedCacheVal) -> do + newStampedVal <- readC c >>= return . fromJust + if stampedCacheVal /= newStampedVal then do + newEngineVal <- update engineVal (fromStamped newStampedVal) + HT.insert (lacCache lac) eid (newEngineVal, newStampedVal) + return () + else return () + Nothing -> return (error "HGamer3D.Engine.Internal.System.applyAnyChanges: cache value not found") + return () + ) currList + return () + +-- step changes, apply all changes for supplementary components, where responsibility reside in other components +lacApplyOtherChanges :: (Typeable schema, Eq schema) => + ListAndCache schema () -- ^ this component, where add and remove functions are done (list ops only) + -> ListAndCache schema' engine' -- ^ the main component, which is influenced by this component + -> (schema -> engine' -> schema' -> IO ()) -- ^ update function, updates from this component to main engine + -> IO () +lacApplyOtherChanges lac lac' update' = do + -- insert + insertList <- takeMVar (lacAddList lac) + mapM (\(eid, c) -> do + stampedVal <- readC c >>= return . fromJust + let val = fromStamped stampedVal + HT.insert (lacCache lac) eid ((), stampedVal) -- empty engine value, only need to store stampedValue + modifyIORef (lacList lac) ( (:) (eid, c) ) + ) insertList + putMVar (lacAddList lac) [] + + -- remove + removeList <- takeMVar (lacRemoveList lac) + mapM (\eid -> do + -- get cached value and remove + mCacheVal <- HT.lookup (lacCache lac) eid + case mCacheVal of + Just (engineVal, stampedCacheVal) -> do + HT.delete (lacCache lac) eid + Nothing -> error "HGamer3D.Engine.Internal.System.applyAnyChanges: cache value not found" + -- remove from current list + modifyIORef (lacList lac) (filter (\(eid', c) -> eid /= eid')) + ) removeList + putMVar (lacRemoveList lac) [] + + -- apply changes from compenents, taken from stamp + currList <- readIORef (lacList lac) + mapM (\(eid, c) -> do + -- handle Events + evts <- _popEvents c + mCacheVal <- HT.lookup (lacCache lac) eid + case mCacheVal of + Just (engineVal, stampedCacheVal) -> do -- engineVal is () + newStampedVal <- readC c >>= return . fromJust + if stampedCacheVal /= newStampedVal then do + let newVal = fromStamped newStampedVal + -- lookup engine val and val from main current value + mMainCacheVal <- HT.lookup (lacCache lac') eid + case mMainCacheVal of + Just (engineMainVal, stampedMainCacheVal) -> update' newVal engineMainVal (fromStamped stampedMainCacheVal) + Nothing -> return (error "HGamer3D.Engine.Internal.System.applyAnyChanges: cache value not found") + HT.insert (lacCache lac) eid ((), newStampedVal) + return () + else return () + Nothing -> return (error "HGamer3D.Engine.Internal.System.applyAnyChanges: cache value not found") + return () + ) currList + return () + + -- the system of entity component system, in general a system has internal state -- entities can be added to it and the system has a step function, to run it diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index 31e9982..9079a8f 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -43,7 +43,7 @@ import qualified Data.HashTable.IO as HT import qualified HGamer3D.Data as D -import qualified HGamer3D.Graphics3D.BaseAPI as BA +import qualified HGamer3D.Internal.Graphics3D as Gr import qualified HGamer3D.Engine.BaseAPI as E import qualified HGamer3D.GUI.BaseAPI as GU @@ -51,169 +51,110 @@ import HGamer3D.Graphics3D.Schema.Figure import HGamer3D.Graphics3D.Schema.Geometry import HGamer3D.Graphics3D.Schema.Material import HGamer3D.Graphics3D.Schema.Camera +import HGamer3D.Graphics3D.Schema.Light + -- the system of entity component system, in general a system has internal state -- entities can be added to it and the system has a step function, to run it -- Systems are self-contained, so they can be run in a thread and manage their state themselves -type IdHashTable v = HT.BasicHashTable ComponentId v data ECSGraphics3D = ECSGraphics3D { -- status of graphics engine - g3d :: (BA.Graphics3DSystem, GU.GUISystem), - -- system handling of figure components - figures :: MVar [(Component, Maybe Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori, size)] - figCache :: IdHashTable ( - BA.Object3D Figure, - StampedValue Figure, - Maybe (StampedValue D.Position), - Maybe (StampedValue D.Orientation), - Maybe (StampedValue D.Size) - ), - -- system handling of camera components - cameras :: MVar [(Component, Maybe Component, Maybe Component)], -- MVar [(fig, pos, ori)] - camCache :: IdHashTable ( - BA.Camera, - StampedValue Camera, - Maybe (StampedValue D.Position), - Maybe (StampedValue D.Orientation) - ) + g3d :: (Gr.Graphics3DSystem, GU.GUISystem), + + -- figures + figures :: ListAndCache Figure (Gr.Object3D Figure), + posfig :: ListAndCache D.Position (), + orifig :: ListAndCache D.Orientation (), + + -- cameras + cameras :: ListAndCache Camera Gr.Camera, + poscam :: ListAndCache D.Position (), + oricam :: ListAndCache D.Orientation (), + + -- lights + lights :: ListAndCache Light Gr.Light, + poslig :: ListAndCache D.Position (), + orilig :: ListAndCache D.Orientation () } instance System ECSGraphics3D where addEntity ecsg3d entity = do - -- figures - oldList <- takeMVar (figures ecsg3d) - let mFig = entity #? CTFig - let newList = case mFig of - Just fig -> let - (p, o, s) = (entity #? CTPos, entity #? CTOri, entity #? CTSiz) - in ((fig, p, o, s) : oldList) - Nothing -> oldList - putMVar (figures ecsg3d) newList - -- cameras - oldList <- takeMVar (cameras ecsg3d) - let mCam = entity #? CTCam - let newList = case mCam of - Just cam -> let - (p, o) = (entity #? CTPos, entity #? CTOri) - in ((cam, p, o) : oldList) - Nothing -> oldList - putMVar (cameras ecsg3d) newList + lacAdd entity (figures ecsg3d) + lacAdd entity (posfig ecsg3d) + lacAdd entity (orifig ecsg3d) + + lacAdd entity (cameras ecsg3d) + lacAdd entity (poscam ecsg3d) + lacAdd entity (oricam ecsg3d) + + lacAdd entity (lights ecsg3d) + lacAdd entity (poslig ecsg3d) + lacAdd entity (orilig ecsg3d) + return ecsg3d - removeEntity ecsg3d entity = return ecsg3d - -{- removeEntity ecsg3d entity = do - let (g3ds, guis, camera, viewport) = g3d - let removeFunction mvList cache = do - oldList <- takeMVar mvList - - let newList = filter ( (/=) --} - + lacRemove entity (figures ecsg3d) + lacRemove entity (posfig ecsg3d) + lacRemove entity (orifig ecsg3d) + + lacRemove entity (cameras ecsg3d) + lacRemove entity (poscam ecsg3d) + lacRemove entity (oricam ecsg3d) + + lacRemove entity (lights ecsg3d) + lacRemove entity (poslig ecsg3d) + lacRemove entity (orilig ecsg3d) + + return ecsg3d + initializeSystem = do - g3d <- E.initHGamer3D "HGamer3D - System" True True True --- setupBasicCamera g3d - figures <- newMVar [] - figCache <- HT.new - cameras <- newMVar [] - camCache <- HT.new - return $ (ECSGraphics3D g3d figures figCache cameras camCache) + g3d <- E.initHGamer3D "HGamer3D - System" True True True + let (g3ds, guis) = g3d + Gr.setAmbientLight g3ds D.white + + figs <- lacInitialize CTFig + posfig <- lacInitialize CTPos + orifig <- lacInitialize CTOri + cams <- lacInitialize CTCam + poscam <- lacInitialize CTPos + oricam <- lacInitialize CTOri + + ligs <- lacInitialize CTLig + poslig <- lacInitialize CTPos + orilig <- lacInitialize CTOri + + return $ (ECSGraphics3D g3d figs posfig orifig cams poscam oricam ligs poslig orilig) stepSystem ecsg3d = do let (g3ds, guis) = (g3d ecsg3d) - -- update 3d objects - figures - cList <- takeMVar (figures ecsg3d) - mapM (\(cf, mcp, mco, mcs) -> do - -- empty event queues - _popEvents cf - -- handle changes per single entity item - figTVal <- readC cf >>= return . fromJust - let newFig = fromStamped figTVal - mCache <- HT.lookup (figCache ecsg3d) (idC cf) - -- first create/update the figure object - newOb <- case mCache of - Nothing -> BA.object3D g3ds newFig - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if oldFig /= figTVal then BA.update3D g3ds oldOb newFig else return oldOb - -- then handle the POS information - Position - newPos <- case mcp of - Just cp -> do - cpTVal <- readC cp >>= return . fromJust - let cpVal = fromStamped cpTVal - case mCache of - Nothing -> D.positionTo newOb cpVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mPos) /= cpTVal then D.positionTo newOb cpVal else return () - return $ Just cpTVal - Nothing -> return Nothing - -- then handle the POS information - Orientation - newOri <- case mco of - Just co -> do - coTVal <- readC co >>= return . fromJust - let coVal = fromStamped coTVal - case mCache of - Nothing -> D.orientationTo newOb coVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mOri) /= coTVal then D.orientationTo newOb coVal else return () - return $ Just coTVal - Nothing -> return Nothing - -- then handle the POS information - Size - newSiz <- case mcs of - Just cs -> do - csTVal <- readC cs >>= return . fromJust - let csVal = fromStamped csTVal - case mCache of - Nothing -> D.sizeTo newOb csVal - Just (oldOb, oldFig, mPos, mOri, mSiz) -> if (fromJust mSiz) /= csTVal then D.sizeTo newOb csVal else return () - return $ Just csTVal - Nothing -> return Nothing - -- insert new values into cache - HT.insert (figCache ecsg3d) (idC cf) (newOb, figTVal, newPos, newOri, newSiz) - ) cList - putMVar (figures ecsg3d) cList - -- update 3d objects - cameras - cList <- takeMVar (cameras ecsg3d) - mapM (\(cc, mcp, mco) -> do - -- empty event queues - _popEvents cc - -- handle changes per single entity item - camTVal <- readC cc >>= return . fromJust - let newCam = fromStamped camTVal - mCache <- HT.lookup (camCache ecsg3d) (idC cc) - -- first create/update the figure object - newOb <- case mCache of - Nothing -> BA.addCamera g3ds newCam - Just (oldOb, oldCam, mPos, mOri) -> if oldCam /= camTVal then BA.updateCamera g3ds oldOb newCam else return oldOb - -- then handle the POS information - Position - newPos <- case mcp of - Just cp -> do - cpTVal <- readC cp >>= return . fromJust - let cpVal = fromStamped cpTVal - case mCache of - Nothing -> D.positionTo newOb cpVal - Just (oldOb, oldCam, mPos, mOri) -> if (fromJust mPos) /= cpTVal then D.positionTo newOb cpVal else return () - return $ Just cpTVal - Nothing -> return Nothing - -- then handle the POS information - Orientation - newOri <- case mco of - Just co -> do - coTVal <- readC co >>= return . fromJust - let coVal = fromStamped coTVal - case mCache of - Nothing -> D.orientationTo newOb coVal - Just (oldOb, oldCam, mPos, mOri) -> if (fromJust mOri) /= coTVal then D.orientationTo newOb coVal else return () - return $ Just coTVal - Nothing -> return Nothing - -- insert new values into cache - HT.insert (camCache ecsg3d) (idC cc) (newOb, camTVal, newPos, newOri) - ) cList - putMVar (cameras ecsg3d) cList - -- run graphics + + -- figures + lacApplyChanges (figures ecsg3d) (Gr.object3D g3ds) (Gr.update3D g3ds) (Gr.remove3D g3ds) + let update' pos edata schema = D.positionTo edata pos + lacApplyOtherChanges (posfig ecsg3d) (figures ecsg3d) update' + let update'' pos edata schema = D.orientationTo edata pos + lacApplyOtherChanges (orifig ecsg3d) (figures ecsg3d) update'' + + -- cameras + lacApplyChanges (cameras ecsg3d) (Gr.addCamera g3ds) (Gr.updateCamera g3ds) (Gr.removeCamera g3ds) + lacApplyOtherChanges (poscam ecsg3d) (cameras ecsg3d) update' + lacApplyOtherChanges (orifig ecsg3d) (cameras ecsg3d) update'' + + -- lights + lacApplyChanges (lights ecsg3d) (Gr.addLight g3ds) (Gr.updateLight g3ds) (Gr.removeLight g3ds) + lacApplyOtherChanges (poslig ecsg3d) (lights ecsg3d) update' + lacApplyOtherChanges (orilig ecsg3d) (lights ecsg3d) update'' + + -- step graphics system (evt, qFlag) <- E.stepHGamer3D g3ds guis return (ecsg3d, qFlag) + shutdownSystem ecsg3d = do let (g3ds, guis) = (g3d ecsg3d) @@ -224,24 +165,3 @@ runSystemGraphics3D :: D.TimeMS -> IO ECSGraphics3D runSystemGraphics3D sleepT = runSystem sleepT -setupBasicCamera g3d = do - let (g3ds, guis) = g3d - -- camera creation and position - camera <- BA.addCamera g3ds ( - Camera - (Frustum 5.0 5000.0 (D.Deg 90)) - (Viewport 0 (D.Rectangle 0.0 0.0 1.0 1.0) D.black) ) - D.positionTo camera (D.Vec3 5.0 5.0 80.0) - BA.cameraLookAt camera (D.Vec3 0.0 0.0 (-300.0)) - - -- define light - - BA.setAmbientLight g3ds D.white - BA.pointLight g3ds D.white (D.Vec3 10.0 10.0 20.0) - - -- GUI Code starts here, display hg3d logo - GU.loadGuiScheme guis "hg3d.scheme" - logo <- GU.loadGuiLayoutFromFile guis "hgamer3d.layout" "" - GU.addGuiElToDisplay guis logo - - return () From 462daa08bb0237604092a6137100a99b8ed8ae14 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Sun, 20 Jul 2014 21:46:16 +0200 Subject: [PATCH 12/28] Event System redesign --- Graphics3D/HGamer3D-Graphics3D.cabal | 2 +- .../HGamer3D/Graphics3D/Internal/Base.hs | 22 ++ .../HGamer3D/Graphics3D/Schema/Scene.hs | 12 +- Main/HGamer3D.cabal | 2 +- Main/HGamer3D/Audio/Internal/SystemAudio.hs | 8 +- Main/HGamer3D/Engine/EcsAPI.hs | 3 + Main/HGamer3D/Engine/Internal/Component.hs | 44 ++-- .../HGamer3D/Engine/Internal/ComponentType.hs | 6 +- Main/HGamer3D/Engine/Internal/Entity.hs | 36 +++- Main/HGamer3D/Engine/Internal/Event.hs | 2 + Main/HGamer3D/Engine/Internal/System.hs | 20 +- Main/HGamer3D/Engine/Internal/SystemEvent.hs | 198 ++++++++++++++++++ .../Engine/Internal/SystemGraphics3D.hs | 41 +++- Main/HGamer3D/Engine/Schema/EventReceiver.hs | 39 ++++ Main/HGamer3D/Engine/Schema/EventSender.hs | 33 +++ Main/HGamer3D/Internal/Engine.hs | 4 +- Main/SConstruct | 1 + 17 files changed, 431 insertions(+), 42 deletions(-) create mode 100644 Main/HGamer3D/Engine/Internal/SystemEvent.hs create mode 100644 Main/HGamer3D/Engine/Schema/EventReceiver.hs create mode 100644 Main/HGamer3D/Engine/Schema/EventSender.hs diff --git a/Graphics3D/HGamer3D-Graphics3D.cabal b/Graphics3D/HGamer3D-Graphics3D.cabal index bf4122b..14a0e0f 100644 --- a/Graphics3D/HGamer3D-Graphics3D.cabal +++ b/Graphics3D/HGamer3D-Graphics3D.cabal @@ -21,7 +21,7 @@ Library Build-Depends: base >= 3 && < 5, containers, mtl, transformers, filepath, directory, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Ogre-Binding >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Graphics3D.Schema.Figure, HGamer3D.Graphics3D.Schema.Geometry, HGamer3D.Graphics3D.Schema.Camera, HGamer3D.Graphics3D.Schema.Light, HGamer3D.Graphics3D.Schema.Material, HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D.Internal.Camera, HGamer3D.Graphics3D.BaseAPI, HGamer3D.Internal.Graphics3D + Exposed-modules: HGamer3D.Graphics3D.Schema.Figure, HGamer3D.Graphics3D.Schema.Geometry, HGamer3D.Graphics3D.Schema.Camera, HGamer3D.Graphics3D.Schema.Light, HGamer3D.Graphics3D.Schema.Material, HGamer3D.Graphics3D.Schema.Scene, HGamer3D.Graphics3D.Internal.Base, HGamer3D.Graphics3D.Internal.Shapes, HGamer3D.Graphics3D.Internal.Light, HGamer3D.Graphics3D.Internal.PlatonShapes, HGamer3D.Graphics3D.Internal.Camera, HGamer3D.Graphics3D.BaseAPI, HGamer3D.Internal.Graphics3D Other-modules: diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs index c8ae244..b67d2cc 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Base.hs @@ -67,6 +67,7 @@ import HGamer3D.Util import HGamer3D.Graphics3D.Schema.Material import HGamer3D.Graphics3D.Schema.Geometry import HGamer3D.Graphics3D.Schema.Figure +import qualified HGamer3D.Graphics3D.Schema.Scene as Sc import qualified HGamer3D.Graphics3D.Schema.Camera as Cam data SceneManager = SceneManager HG3DClass @@ -361,3 +362,24 @@ _removeEntityAndNode g3ds (ON parent) (OE meshEntity ) (ON meshNode) = do Node.removeChild2 parent meshNode SceneManager.destroySceneNode2 scm meshNode +setSceneParameter :: Graphics3DSystem -> Sc.SceneParameter -> IO () +setSceneParameter g3ds scene = do + let (SceneManager scm) = g3dsSceneManager g3ds + let (Sc.SceneParameter aLightColour shadow sky) = scene + -- set ambient Light + SceneManager.setAmbientLight scm aLightColour + -- set Shadow Mode to be done + + -- set skybox + case sky of + Sc.NoSky -> do + SceneManager.setSkyBoxEnabled scm False + SceneManager.setSkyDomeEnabled scm False + Sc.SkyBox (ResourceMaterial mname) distance -> do + SceneManager.setSkyDomeEnabled scm False + SceneManager.setSkyBox scm True mname distance True unitQ "General" + Sc.SkyDome (ResourceMaterial mname) curvature tiling distance -> do + SceneManager.setSkyBoxEnabled scm False + SceneManager.setSkyDome scm True mname curvature tiling distance True unitQ 16 16 (-1) "General" + + return () diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Scene.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Scene.hs index b392304..53c7608 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Scene.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Scene.hs @@ -27,16 +27,22 @@ where import Data.Typeable import HGamer3D.Data as Dat +import HGamer3D.Graphics3D.Schema.Material data SceneParameter = SceneParameter { ambientLight :: Colour, - shadowType :: ShadowType + shadowType :: ShadowType, + skyType :: SkyType } deriving (Eq, Show, Typeable) data ShadowType = NoShadows | TextureAdditive - | TextureModulativevi + | TextureModulative | StencilAdditive | StencilModulative deriving (Eq, Show, Typeable) - + +data SkyType = NoSky + | SkyBox Material Float -- Distance + | SkyDome Material Float Float Float -- Curvature, Tiling, Distance + deriving (Eq, Show, Typeable) diff --git a/Main/HGamer3D.cabal b/Main/HGamer3D.cabal index 1950628..aed4805 100644 --- a/Main/HGamer3D.cabal +++ b/Main/HGamer3D.cabal @@ -33,7 +33,7 @@ Flag InputSystem Library Build-Depends: base >= 3 && < 5, clock, containers, hashtables, hashable, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Engine.Internal.Component, HGamer3D.Engine.Internal.ComponentType, HGamer3D.Engine.Internal.Entity, HGamer3D.Engine.Internal.System, HGamer3D.Engine.Internal.SystemGraphics3D, HGamer3D.Engine.Internal.GameLoop, HGamer3D.Engine.Internal.Event, HGamer3D.Engine.EcsAPI, HGamer3D.Engine.BaseAPI, HGamer3D.Internal.Engine + Exposed-modules: HGamer3D.Engine.Internal.Component, HGamer3D.Engine.Internal.ComponentType, HGamer3D.Engine.Internal.Entity, HGamer3D.Engine.Internal.System, HGamer3D.Engine.Internal.SystemGraphics3D, HGamer3D.Engine.Internal.SystemEvent, HGamer3D.Engine.Internal.GameLoop, HGamer3D.Engine.Internal.Event, HGamer3D.Engine.Schema.EventReceiver, HGamer3D.Engine.Schema.EventSender, HGamer3D.Engine.EcsAPI, HGamer3D.Engine.BaseAPI, HGamer3D.Internal.Engine Other-modules: c-sources: diff --git a/Main/HGamer3D/Audio/Internal/SystemAudio.hs b/Main/HGamer3D/Audio/Internal/SystemAudio.hs index ac81118..c7e41c2 100644 --- a/Main/HGamer3D/Audio/Internal/SystemAudio.hs +++ b/Main/HGamer3D/Audio/Internal/SystemAudio.hs @@ -53,7 +53,8 @@ data ECSAudio = ECSAudio { positions :: ListAndCache D.Position () } -_handleEvent map evt = do +_handleEvent aslots evt = do + let (A.AudioSlots map schema) = aslots case evt of AudioEvt (PlaySound slot) -> do let mAS = (M.lookup slot map) @@ -84,7 +85,10 @@ instance System ECSAudio where return $ (ECSAudio audioSlots positions) stepSystem system = do - lacApplyChanges (audioSlots system) A.audioSlots A.updateAudioSlots A.removeAudioSlots + let handleUserEvents evts aslots = do + mapM (_handleEvent aslots) evts + return () + lacApplyChanges (audioSlots system) A.audioSlots A.updateAudioSlots A.removeAudioSlots handleUserEvents lacHandleC2UEvents let update' pos edata schema = D.positionTo edata pos lacApplyOtherChanges (positions system) (audioSlots system) update' return (system, False) diff --git a/Main/HGamer3D/Engine/EcsAPI.hs b/Main/HGamer3D/Engine/EcsAPI.hs index ad231a0..578a2e4 100644 --- a/Main/HGamer3D/Engine/EcsAPI.hs +++ b/Main/HGamer3D/Engine/EcsAPI.hs @@ -52,6 +52,9 @@ module HGamer3D.Engine.EcsAPI ECSGraphics3D, runSystemGraphics3D, + ECSEventQueues, + runSystemEvent, + SomeSystem, (#+), addToWorld, diff --git a/Main/HGamer3D/Engine/Internal/Component.hs b/Main/HGamer3D/Engine/Internal/Component.hs index 016e099..1c9ef44 100644 --- a/Main/HGamer3D/Engine/Internal/Component.hs +++ b/Main/HGamer3D/Engine/Internal/Component.hs @@ -60,7 +60,8 @@ data Component = Component { componentData :: Dynamic, componentId :: ComponentId, componentType :: TypeRep, - componentEvents :: MVar [HG3DEvent] + componentU2CEvents :: MVar [HG3DEvent], + componentC2UEvents :: MVar [HG3DEvent] } instance Eq Component where @@ -72,11 +73,12 @@ newC val = do mv <- newMVar tval let dyn = toDyn mv ident <- makeStableName dyn - evts <- newMVar [] - return (Component dyn ident (typeOf val) evts) + evtsU2C <- newMVar [] + evtsC2U <- newMVar [] + return (Component dyn ident (typeOf val) evtsU2C evtsC2U) readC :: Typeable a => Component -> IO (Maybe (StampedValue a)) -readC (Component dyn _ _ _) +readC (Component dyn _ _ _ _) | Just mv <- fromDynamic dyn = do val <- takeMVar mv putMVar mv val @@ -88,10 +90,10 @@ valC :: Typeable a => Component -> IO a valC c = readC c >>= return . fromStamped . fromJust isTypeC :: Typeable a => a -> Component -> Bool -isTypeC val (Component dyn _ tr _) = (typeOf val == tr) +isTypeC val (Component dyn _ tr _ _) = (typeOf val == tr) updateC :: Typeable a => Component -> (a -> a) -> IO () -updateC (Component dyn _ _ _) f +updateC (Component dyn _ _ _ _) f | Just mv <- fromDynamic dyn = do val <- (takeMVar mv >>= (return . fromStamped)) newTVal <- _stamp (f val) @@ -101,17 +103,31 @@ updateC (Component dyn _ _ _) f return () idC :: Component -> ComponentId -idC (Component _ ident _ _) = ident +idC (Component _ ident _ _ _) = ident -_pushEvent :: Component -> HG3DEvent -> IO () -_pushEvent c evt = do - let mv = (componentEvents c) + +_pushU2CEvents :: Component -> [HG3DEvent] -> IO () +_pushU2CEvents c newEvts = do + let mv = (componentU2CEvents c) + evts <- takeMVar mv + putMVar mv (evts ++ newEvts) + +_popU2CEvents :: Component -> IO [HG3DEvent] +_popU2CEvents c = do + let mv = (componentU2CEvents c) + evts <- takeMVar mv + putMVar mv [] + return evts + +_pushC2UEvents :: Component -> [HG3DEvent] -> IO () +_pushC2UEvents c newEvts = do + let mv = (componentC2UEvents c) evts <- takeMVar mv - putMVar mv (evts ++ [evt]) + putMVar mv (evts ++ newEvts) -_popEvents :: Component -> IO [HG3DEvent] -_popEvents c = do - let mv = (componentEvents c) +_popC2UEvents :: Component -> IO [HG3DEvent] +_popC2UEvents c = do + let mv = (componentC2UEvents c) evts <- takeMVar mv putMVar mv [] return evts diff --git a/Main/HGamer3D/Engine/Internal/ComponentType.hs b/Main/HGamer3D/Engine/Internal/ComponentType.hs index cec1dd3..a1a3765 100644 --- a/Main/HGamer3D/Engine/Internal/ComponentType.hs +++ b/Main/HGamer3D/Engine/Internal/ComponentType.hs @@ -31,11 +31,13 @@ data ComponentType = CTPos -- ^ Position | CTOri -- ^ Orientation | CTSiz -- ^ Size | CTFig -- ^ Figure - | CTASl -- ^ Audio Slots + | CTASl -- ^ Audio Slots | CTALs -- ^ Audio Listener | CTCam -- ^ Cameras | CTLig -- ^ Light - + | CTScP -- ^ Scene Parameter + | CTEvR -- ^ Event Receiver (GUI, Window, Joystick, Channel, ...) + | CTEvS -- ^ Event Sender (Channel, ...) deriving (Eq, Ord, Show) diff --git a/Main/HGamer3D/Engine/Internal/Entity.hs b/Main/HGamer3D/Engine/Internal/Entity.hs index 0cbca1c..808d4b7 100644 --- a/Main/HGamer3D/Engine/Internal/Entity.hs +++ b/Main/HGamer3D/Engine/Internal/Entity.hs @@ -37,7 +37,12 @@ import Data.Typeable import System.Mem.StableName type EntityId = StableName (M.Map ComponentType Component) -data Entity = Entity (M.Map ComponentType Component) EntityId +data Entity = Entity { + entityCMap :: (M.Map ComponentType Component), + entityId :: EntityId , + entityU2CEvents :: MVar [HG3DEvent], + entityC2UEvents :: MVar [HG3DEvent] +} -- -- pure Data functions, creating, traversing and getting components from entities @@ -50,19 +55,40 @@ entity inList = do return (c, val')) inList let cMap = M.fromList outList eId <- makeStableName cMap - return $ Entity cMap eId + evtsU2C <- newMVar [] + evtsC2U <- newMVar [] + return $ Entity cMap eId evtsU2C evtsC2U idE :: Entity -> EntityId -idE (Entity _ eId) = eId +idE (Entity _ eId _ _) = eId sendEvent :: Entity -> HG3DEvent -> IO () -sendEvent (Entity map _) event = mapM (\(ct, c) -> _pushEvent c event) (M.toList map) >> return () +sendEvent (Entity map _ evtsU2C _) event = do + evts <- takeMVar evtsU2C + putMVar evtsU2C (evts ++ [event]) + +_popEntityU2CEvents :: Entity -> IO [HG3DEvent] +_popEntityU2CEvents (Entity map _ evtsU2C _) = do + evts <- takeMVar evtsU2C + putMVar evtsU2C [] + return evts + +receiveEvents :: Entity -> IO [HG3DEvent] +receiveEvents (Entity map _ _ evtsC2U) = do + evts <- takeMVar evtsC2U + putMVar evtsC2U [] + return evts + +_pushEntityC2UEvents :: Entity -> [HG3DEvent] -> IO () +_pushEntityC2UEvents (Entity map _ _ evtsC2U) events = do + evts <- takeMVar evtsC2U + putMVar evtsC2U (evts ++ events) (#:) :: Typeable a => ComponentType -> a -> (ComponentType, IO Component) (#:) ec val = (ec, newC val) (#?) :: Entity -> ComponentType -> Maybe Component -(Entity map _) #? name = M.lookup name map +(Entity map _ _ _) #? name = M.lookup name map infix 8 #? (#) :: Entity -> ComponentType -> Component diff --git a/Main/HGamer3D/Engine/Internal/Event.hs b/Main/HGamer3D/Engine/Internal/Event.hs index 12fc27c..6371195 100644 --- a/Main/HGamer3D/Engine/Internal/Event.hs +++ b/Main/HGamer3D/Engine/Internal/Event.hs @@ -27,6 +27,7 @@ where import HGamer3D.WinEvent.BaseAPI import HGamer3D.GUI.BaseAPI +import Data.Dynamic data AudioEvent = PlaySound String | StopSound String @@ -34,6 +35,7 @@ data AudioEvent = PlaySound String data HG3DEvent = WindowEvt SDLEvent | GUIEvt GUIEvent | AudioEvt AudioEvent + | UserEvt Dynamic diff --git a/Main/HGamer3D/Engine/Internal/System.hs b/Main/HGamer3D/Engine/Internal/System.hs index c64c100..499ca68 100644 --- a/Main/HGamer3D/Engine/Internal/System.hs +++ b/Main/HGamer3D/Engine/Internal/System.hs @@ -38,6 +38,7 @@ import HGamer3D.Data as D import HGamer3D.Engine.Internal.Component import HGamer3D.Engine.Internal.ComponentType import HGamer3D.Engine.Internal.Entity +import HGamer3D.Engine.Internal.Event import System.Clock import System.Mem.StableName @@ -88,6 +89,12 @@ lacRemove e lac = do oldList <- takeMVar (lacRemoveList lac) putMVar (lacRemoveList lac) (idE e : oldList) +-- empty event handling functions, for re-use in case no event handling is needed +lacHandleU2CEvents :: [HG3DEvent] -> engine -> IO () +lacHandleU2CEvents evts eng= return () + +lacHandleC2UEvents :: engine -> IO [HG3DEvent] +lacHandleC2UEvents eng = return [] -- step system, apply all changes, this is for main components, where direct responsibility exists lacApplyChanges :: (Typeable schema, Eq schema) => @@ -95,8 +102,10 @@ lacApplyChanges :: (Typeable schema, Eq schema) => -> (schema -> IO engine) -- ^ create function for new entries -> (engine -> schema -> IO engine) -- ^ update function for changing entries -> (engine -> IO ()) -- ^ remove functions for removed entries + -> ([HG3DEvent] -> engine -> IO ()) -- ^ handle user events (U2C) function + -> (engine -> IO [HG3DEvent] ) -- ^ handle component events (C2U) function -> IO () -lacApplyChanges lac create update remove = do +lacApplyChanges lac create update remove handleU2CEvents handleC2UEvents = do -- insert insertList <- takeMVar (lacAddList lac) mapM (\(eid, c) -> do @@ -126,11 +135,15 @@ lacApplyChanges lac create update remove = do -- apply changes from compenents, taken from stamp currList <- readIORef (lacList lac) mapM (\(eid, c) -> do - -- handle Events - evts <- _popEvents c + -- handle Events, user event received + userEvts <- _popU2CEvents c mCacheVal <- HT.lookup (lacCache lac) eid case mCacheVal of Just (engineVal, stampedCacheVal) -> do + -- event handling + handleU2CEvents userEvts engineVal + comEvents <- handleC2UEvents engineVal + _pushC2UEvents c comEvents newStampedVal <- readC c >>= return . fromJust if stampedCacheVal /= newStampedVal then do newEngineVal <- update engineVal (fromStamped newStampedVal) @@ -177,7 +190,6 @@ lacApplyOtherChanges lac lac' update' = do currList <- readIORef (lacList lac) mapM (\(eid, c) -> do -- handle Events - evts <- _popEvents c mCacheVal <- HT.lookup (lacCache lac) eid case mCacheVal of Just (engineVal, stampedCacheVal) -> do -- engineVal is () diff --git a/Main/HGamer3D/Engine/Internal/SystemEvent.hs b/Main/HGamer3D/Engine/Internal/SystemEvent.hs new file mode 100644 index 0000000..4d10495 --- /dev/null +++ b/Main/HGamer3D/Engine/Internal/SystemEvent.hs @@ -0,0 +1,198 @@ +{-# Language StandaloneDeriving #-} +{-# OPTIONS_HADDOCK hide #-} + +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Internal/ECS/SystemEvent.hs + +-- | the Event System of the Entity-Component-System World +-- The event system is handling the event distribution and is responsible to send incoming events and distribute them to the receivers. The following scenarios explain the event distribution in detail: +-- ** From user to component +-- The event is placed in the incoming event queue of the entity by the sendEvent function. The event systems distributes them towards the target component of the same entity. Example: play audio sound, receiving component is the audio component. +-- ** From component to user +-- The component places incoming events into the component event queue, from there the event system puts them into the entity event queue, from where they can be received by the user. Example: joystick component, window event component. +-- ** Signal/Slot/Channels to facilitate entity - entity communication +-- A channel component is a simple name, the event system holds for each channel an event list and all events, which are received by the entity are distributed to all other entities, which subscribe to the same channel. The mechanism works for incoming events from users and for incoming events from components alike. +-- ** GUI events +-- GUI elements needs events in two directions, one direction, to set element value and another one, to receive changes in the element value. Therefore also the components need two different event queues, each. +-- ** Naming conventions +-- All queues holding events in the chain user to component communication are named with U2C the queues in the direction component to user have the names C2U, this holds for the queues in the components and in the entities as well as in the event system. + + + +module HGamer3D.Engine.Internal.SystemEvent + +where + +import Control.Concurrent.MVar +import Data.Maybe +import Data.Typeable +import Data.Dynamic +import Data.IORef + +import HGamer3D.Engine.Internal.Entity +import HGamer3D.Engine.Internal.Component +import HGamer3D.Engine.Internal.ComponentType +import HGamer3D.Engine.Internal.System +import HGamer3D.Engine.Internal.Event + +import Data.Hashable +import qualified Data.HashTable.IO as HT + + +import qualified HGamer3D.Data as D +import qualified HGamer3D.Internal.Graphics3D as Gr +import qualified HGamer3D.Engine.BaseAPI as E +import qualified HGamer3D.GUI.BaseAPI as GU + +import HGamer3D.Graphics3D.Schema.Figure +import HGamer3D.Graphics3D.Schema.Geometry +import HGamer3D.Graphics3D.Schema.Material +import HGamer3D.Graphics3D.Schema.Camera +import HGamer3D.Graphics3D.Schema.Light +import HGamer3D.Graphics3D.Schema.Scene +import HGamer3D.Engine.Schema.EventReceiver +import HGamer3D.Engine.Schema.EventSender + +data ECSEventQueues = ECSEventQueues { + addList :: MVar [Entity], + removeList :: MVar [Entity], + entities :: IORef [Entity], + namedQueues :: HT.BasicHashTable String [HG3DEvent] +} + +instance System ECSEventQueues where + + initializeSystem = do + al <- newMVar [] + rl <- newMVar [] + es <- newIORef [] + nq <- HT.new + return $ (ECSEventQueues al rl es nq) + + addEntity esys entity = do + al <- takeMVar (addList esys) + putMVar (addList esys) (al ++ [entity]) + return esys + + removeEntity esys entity = do + rl <- takeMVar (removeList esys) + putMVar (removeList esys) (rl ++ [entity]) + return esys + + stepSystem esys = do + + -- add/remove entities from other thread + al <- takeMVar (addList esys) + putMVar (addList esys) [] + modifyIORef (entities esys) (\oldList -> oldList ++ al) + + -- remove, to be done + + es <- readIORef (entities esys) + -- map over all events and handle single events coming from + -- user and from receiver components, send them to targets + mapM (\entity -> do + -- User Events to specific components, which want them + u2cEvts <- _popEntityU2CEvents entity + -- audio evts + let audioEvts = filter (\evt -> case evt of + (AudioEvt _) -> True + _ -> False) u2cEvts + case (entity #? CTASl) of + Nothing -> return () + Just com -> _pushU2CEvents com audioEvts + -- sender channels + case (entity #? CTEvS) of + Nothing -> return () + Just com -> _pushU2CEvents com u2cEvts + + -- C2U events from receiver components + case (entity #? CTEvR) of + Nothing -> return () + Just com -> do + recVal <- readC com >>= return . fromStamped . fromJust + c2uEvts <- _popC2UEvents com + let filterF = case recVal of + WinEventReceiver -> (\evt -> case evt of + (WindowEvt _) -> True + _ -> False) + GUIEventReceiver -> (\evt -> case evt of + (GUIEvt _) -> True + _ -> False) + UserEventReceiver -> (\evt -> case evt of + (UserEvt _) -> True + _ -> False) + AllEventsReceiver -> (\evt -> True) + _ -> (\evt -> False) + let evts = filter filterF c2uEvts + _pushEntityC2UEvents entity evts + -- copy to sender, in case existing + case (entity #? CTEvS) of + Nothing -> return () + Just com -> _pushU2CEvents com evts + + -- Channel handling, sender to named channel + case (entity #? CTEvS) of + Nothing -> return () + Just com -> do + recVal <- readC com >>= return . fromStamped . fromJust + case recVal of + ChannelEventReceiver channel -> do + evts <- _popU2CEvents com + mOldEvents <- HT.lookup (namedQueues esys) channel + case mOldEvents of + Just oldEvents -> HT.insert (namedQueues esys) channel (oldEvents ++ evts) + + Nothing -> HT.insert (namedQueues esys) channel evts + _ -> return () + ) es + + + -- map over all events and handle channel events towards channel + -- receiver + mapM (\entity -> do + case (entity #? CTEvR) of + Nothing -> return () + Just com -> do + recVal <- readC com >>= return . fromStamped . fromJust + case recVal of + ChannelEventReceiver channel -> do + mEvents <- HT.lookup (namedQueues esys) channel + case mEvents of + Just events -> _pushC2UEvents com events + Nothing -> return () + _ -> return () + ) es + + -- clear all channels, after sending/receiving + namedQueueList <- HT.toList (namedQueues esys) + mapM (\(channel, events) -> do + HT.insert (namedQueues esys) channel [] + ) namedQueueList + + return (esys, False) + + + shutdownSystem esys = return () + +runSystemEvent :: D.TimeMS -> IO ECSEventQueues +runSystemEvent sleepT = runSystem sleepT + + diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index 9079a8f..3ffd4ce 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -52,6 +52,7 @@ import HGamer3D.Graphics3D.Schema.Geometry import HGamer3D.Graphics3D.Schema.Material import HGamer3D.Graphics3D.Schema.Camera import HGamer3D.Graphics3D.Schema.Light +import HGamer3D.Graphics3D.Schema.Scene @@ -77,7 +78,10 @@ data ECSGraphics3D = ECSGraphics3D { -- lights lights :: ListAndCache Light Gr.Light, poslig :: ListAndCache D.Position (), - orilig :: ListAndCache D.Orientation () + orilig :: ListAndCache D.Orientation (), + + -- scene parameter + scenepars :: ListAndCache SceneParameter () } instance System ECSGraphics3D where @@ -95,6 +99,8 @@ instance System ECSGraphics3D where lacAdd entity (poslig ecsg3d) lacAdd entity (orilig ecsg3d) + lacAdd entity (scenepars ecsg3d) + return ecsg3d removeEntity ecsg3d entity = do @@ -110,6 +116,7 @@ instance System ECSGraphics3D where lacRemove entity (poslig ecsg3d) lacRemove entity (orilig ecsg3d) + lacRemove entity (scenepars ecsg3d) return ecsg3d initializeSystem = do @@ -128,31 +135,47 @@ instance System ECSGraphics3D where ligs <- lacInitialize CTLig poslig <- lacInitialize CTPos orilig <- lacInitialize CTOri - - return $ (ECSGraphics3D g3d figs posfig orifig cams poscam oricam ligs poslig orilig) + + scpars <- lacInitialize CTScP + + return $ (ECSGraphics3D g3d figs posfig orifig cams poscam oricam ligs poslig orilig scpars) stepSystem ecsg3d = do let (g3ds, guis) = (g3d ecsg3d) + + -- small helper functions + let update' pos edata schema = D.positionTo edata pos + let update'' pos edata schema = D.orientationTo edata pos -- figures - lacApplyChanges (figures ecsg3d) (Gr.object3D g3ds) (Gr.update3D g3ds) (Gr.remove3D g3ds) - let update' pos edata schema = D.positionTo edata pos + lacApplyChanges (figures ecsg3d) (Gr.object3D g3ds) (Gr.update3D g3ds) (Gr.remove3D g3ds) lacHandleU2CEvents lacHandleC2UEvents lacApplyOtherChanges (posfig ecsg3d) (figures ecsg3d) update' - let update'' pos edata schema = D.orientationTo edata pos lacApplyOtherChanges (orifig ecsg3d) (figures ecsg3d) update'' -- cameras - lacApplyChanges (cameras ecsg3d) (Gr.addCamera g3ds) (Gr.updateCamera g3ds) (Gr.removeCamera g3ds) + lacApplyChanges (cameras ecsg3d) (Gr.addCamera g3ds) (Gr.updateCamera g3ds) (Gr.removeCamera g3ds) lacHandleU2CEvents lacHandleC2UEvents lacApplyOtherChanges (poscam ecsg3d) (cameras ecsg3d) update' lacApplyOtherChanges (orifig ecsg3d) (cameras ecsg3d) update'' -- lights - lacApplyChanges (lights ecsg3d) (Gr.addLight g3ds) (Gr.updateLight g3ds) (Gr.removeLight g3ds) + lacApplyChanges (lights ecsg3d) (Gr.addLight g3ds) (Gr.updateLight g3ds) (Gr.removeLight g3ds) lacHandleU2CEvents lacHandleC2UEvents lacApplyOtherChanges (poslig ecsg3d) (lights ecsg3d) update' lacApplyOtherChanges (orilig ecsg3d) (lights ecsg3d) update'' + -- scene parameters + let updateScene eng new = Gr.setSceneParameter g3ds new + let removeScene eng = return () + lacApplyChanges (scenepars ecsg3d) (Gr.setSceneParameter g3ds) updateScene removeScene lacHandleU2CEvents lacHandleC2UEvents + -- step graphics system - (evt, qFlag) <- E.stepHGamer3D g3ds guis + (evts, qFlag) <- E.stepHGamer3D g3ds guis + + -- handover evts towards the event system, map over + + -- next steps, put Entity handling in system, (from SystemEvent) + -- then add also here to this system + -- then ad events to all Event Receiver components (C2U) + return (ecsg3d, qFlag) diff --git a/Main/HGamer3D/Engine/Schema/EventReceiver.hs b/Main/HGamer3D/Engine/Schema/EventReceiver.hs new file mode 100644 index 0000000..7e0db9f --- /dev/null +++ b/Main/HGamer3D/Engine/Schema/EventReceiver.hs @@ -0,0 +1,39 @@ +{-# Language StandaloneDeriving, DeriveDataTypeable #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Engine/Schema/EventReceiver Module +-- + +-- | Schema for EventReceiver +module HGamer3D.Engine.Schema.EventReceiver + +where + +import Data.Typeable +import qualified HGamer3D.Data as D + +data EventReceiver = ChannelEventReceiver String + | WinEventReceiver + | GUIEventReceiver + | JoystickEventReceiver + | UserEventReceiver + | AllEventsReceiver + + deriving (Eq, Show, Typeable) + diff --git a/Main/HGamer3D/Engine/Schema/EventSender.hs b/Main/HGamer3D/Engine/Schema/EventSender.hs new file mode 100644 index 0000000..1cc9cf5 --- /dev/null +++ b/Main/HGamer3D/Engine/Schema/EventSender.hs @@ -0,0 +1,33 @@ +{-# Language StandaloneDeriving, DeriveDataTypeable #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.althainz.de/HGamer3D.html +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/Engine/Schema/EventSender Module +-- + +-- | Schema for EventSender +module HGamer3D.Engine.Schema.EventSender + +where + +import Data.Typeable +import qualified HGamer3D.Data as D + +data EventSender = ChannelEventSender String + deriving (Eq, Show, Typeable) + diff --git a/Main/HGamer3D/Internal/Engine.hs b/Main/HGamer3D/Internal/Engine.hs index c1b257a..1c3f3dc 100644 --- a/Main/HGamer3D/Internal/Engine.hs +++ b/Main/HGamer3D/Internal/Engine.hs @@ -28,7 +28,8 @@ module HGamer3D.Internal.Engine module HGamer3D.Engine.Internal.Event, module HGamer3D.Engine.Internal.GameLoop, module HGamer3D.Engine.Internal.System, - module HGamer3D.Engine.Internal.SystemGraphics3D + module HGamer3D.Engine.Internal.SystemGraphics3D, + module HGamer3D.Engine.Internal.SystemEvent ) where import HGamer3D.Engine.Internal.Component @@ -38,3 +39,4 @@ import HGamer3D.Engine.Internal.Event import HGamer3D.Engine.Internal.GameLoop import HGamer3D.Engine.Internal.System import HGamer3D.Engine.Internal.SystemGraphics3D +import HGamer3D.Engine.Internal.SystemEvent diff --git a/Main/SConstruct b/Main/SConstruct index a5d3187..9390956 100644 --- a/Main/SConstruct +++ b/Main/SConstruct @@ -24,6 +24,7 @@ dependsOn = [ Glob("HGamer3D/Network/Internal/*"), Glob("HGamer3D/Engine/*"), Glob("HGamer3D/Engine/Internal/*"), + Glob("HGamer3D/Engine/Schema/*"), Glob("*.cabal"), "LICENSE", From 4d06abcff78c992943a17be1541722ce7f4afb44 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Tue, 22 Jul 2014 17:19:29 +0200 Subject: [PATCH 13/28] GUI in ECS integrated, new Time module in data, time injection in GUI --- Bindings-HBind-Source/SDL2/SDL2.cfg | 132 +++++++++--------- .../HGamer3D/Bindings/SDL2/StructSDLEvent.chs | 20 +-- Data/HGamer3D-Data.cabal | 4 +- Data/HGamer3D/Data.hs | 4 +- Data/HGamer3D/Data/GameTime.hs | 92 ++++++++++++ GUI/HGamer3D-GUI.cabal | 2 +- GUI/HGamer3D/GUI/BaseAPI.hs | 22 ++- GUI/HGamer3D/GUI/Internal/Base.hs | 9 ++ GUI/HGamer3D/GUI/Internal/Form.hs | 131 +++++++++++++++++ GUI/HGamer3D/GUI/Internal/Properties.hs | 11 +- GUI/HGamer3D/GUI/Internal/Widgets.hs | 53 ++++++- GUI/HGamer3D/GUI/Schema/Form.hs | 37 +++++ .../HGamer3D/GUI/Schema/GUIDim.hs | 72 +++++----- GUI/HGamer3D/GUI/Schema/Layout.hs | 46 ++++++ GUI/HGamer3D/GUI/Schema/Widget.hs | 63 +++++++++ GUI/SConstruct | 1 + Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs | 1 + Main/HGamer3D/Audio/Internal/SystemAudio.hs | 2 +- .../HGamer3D/Engine/Internal/ComponentType.hs | 1 + Main/HGamer3D/Engine/Internal/Event.hs | 10 +- Main/HGamer3D/Engine/Internal/GameLoop.hs | 19 ++- Main/HGamer3D/Engine/Internal/System.hs | 62 ++++++-- Main/HGamer3D/Engine/Internal/SystemEvent.hs | 27 ++-- .../Engine/Internal/SystemGraphics3D.hs | 70 ++++++++-- Network/HGamer3D/Network/Internal/Base.hs | 12 +- 25 files changed, 718 insertions(+), 185 deletions(-) create mode 100644 Data/HGamer3D/Data/GameTime.hs create mode 100644 GUI/HGamer3D/GUI/Internal/Form.hs create mode 100644 GUI/HGamer3D/GUI/Schema/Form.hs rename Data/HGamer3D/Data/TimeMS.hs => GUI/HGamer3D/GUI/Schema/GUIDim.hs (62%) create mode 100644 GUI/HGamer3D/GUI/Schema/Layout.hs create mode 100644 GUI/HGamer3D/GUI/Schema/Widget.hs diff --git a/Bindings-HBind-Source/SDL2/SDL2.cfg b/Bindings-HBind-Source/SDL2/SDL2.cfg index 7c18e99..6edbfbf 100644 --- a/Bindings-HBind-Source/SDL2/SDL2.cfg +++ b/Bindings-HBind-Source/SDL2/SDL2.cfg @@ -836,75 +836,75 @@ items: \ Word8 -> SDLButton\n_getButton w = case w of\n 1 -> SDLButtonLeft\n \ \ 2 -> SDLButtonMiddle\n 3 -> SDLButtonRight\n 4 -> SDLButtonX1\n 5\ \ -> SDLButtonX2\n _ -> SDLButtonNumber ((fromIntegral . toInteger) w)\n\ - \ndata SDLEvent = EvtKeyUp TimeMS Window EnumSDLScancode Keycode Keymod |\n\ - \ EvtKeyDown TimeMS Window EnumSDLScancode Keycode Keymod |\n\ - \ EvtText TimeMS Window String | \n EvtQuit TimeMS\ - \ |\n EvtWindow TimeMS Window EnumSDLWindowEventID Int Int |\n\ - \ EvtMouseButtonDown TimeMS Window MouseID SDLButton Int Int |\n\ - \ EvtMouseButtonUp TimeMS Window MouseID SDLButton Int Int |\n\ - \ EvtMouseMotion TimeMS Window MouseID Int Int Int Int | \n \ - \ EvtCommon TimeMS EnumSDLEventType |\n EvtNotValid\n\ - \ninstance Storable SDLEvent where\n sizeOf _ = 56\n alignment _ = 4\n \ - \ \n peek p = do\n typ <- (peekByteOff p 0 :: IO CUInt)\n time <- (peekByteOff\ - \ p 4 :: IO CUInt)\n Control.Exception.catch (do\n let evttyp = (toEnum\ - \ . fromIntegral . toInteger) typ -- this first throws exception if enum\ - \ not ok !\n let t = TimeMS ((fromIntegral . toInteger) time)\n\n \ - \ case (evttyp) of\n SDL_QUIT -> return $ EvtQuit t\n SDL_KEYDOWN\ - \ -> EvtKeyDown <$> return t\n <*> fmap (Window\ + \ndata SDLEvent = EvtKeyUp GameTime Window EnumSDLScancode Keycode Keymod\ + \ |\n EvtKeyDown GameTime Window EnumSDLScancode Keycode Keymod\ + \ |\n EvtText GameTime Window String | \n EvtQuit\ + \ GameTime |\n EvtWindow GameTime Window EnumSDLWindowEventID\ + \ Int Int |\n EvtMouseButtonDown GameTime Window MouseID SDLButton\ + \ Int Int |\n EvtMouseButtonUp GameTime Window MouseID SDLButton\ + \ Int Int |\n EvtMouseMotion GameTime Window MouseID Int Int Int\ + \ Int | \n EvtCommon GameTime EnumSDLEventType |\n \ + \ EvtNotValid\n\ninstance Storable SDLEvent where\n sizeOf _ = 56\n alignment\ + \ _ = 4\n \n peek p = do\n typ <- (peekByteOff p 0 :: IO CUInt)\n time\ + \ <- (peekByteOff p 4 :: IO CUInt)\n Control.Exception.catch (do\n \ + \ let evttyp = (toEnum . fromIntegral . toInteger) typ -- this first throws\ + \ exception if enum not ok !\n let t = ((fromIntegral . (* 1000000) .\ + \ toInteger) time) :: GameTime\n\n case (evttyp) of\n SDL_QUIT\ + \ -> return $ EvtQuit t\n SDL_KEYDOWN -> EvtKeyDown <$> return t\n\ + \ <*> fmap (Window . fromIntegral . toInteger)\ + \ (peekByteOff p 8 :: IO CUInt)\n <*> fmap (toEnum\ + \ . fromIntegral . toInteger) (peekByteOff p 16 :: IO CUInt)\n \ + \ <*> fmap (toEnum . fromIntegral . toInteger) (peekByteOff\ + \ p 20 :: IO Keycode)\n <*> fmap (toEnum . fromIntegral\ + \ . toInteger) (peekByteOff p 24 :: IO Keymod)\n SDL_KEYUP -> EvtKeyUp\ + \ <$> return t\n <*> fmap (Window . fromIntegral\ + \ . toInteger) (peekByteOff p 8 :: IO CUInt)\n \ + \ <*> fmap (toEnum . fromIntegral . toInteger) (peekByteOff p 16 :: IO CUInt)\n\ + \ <*> fmap (toEnum . fromIntegral . toInteger)\ + \ (peekByteOff p 20 :: IO Keycode)\n <*> fmap (toEnum\ + \ . fromIntegral . toInteger) (peekByteOff p 24 :: IO Keymod)\n SDL_WINDOWEVENT\ + \ -> EvtWindow <$> return t\n <*> fmap (Window\ \ . fromIntegral . toInteger) (peekByteOff p 8 :: IO CUInt)\n \ \ <*> fmap (toEnum . fromIntegral . toInteger) (peekByteOff\ - \ p 16 :: IO CUInt)\n <*> fmap (toEnum . fromIntegral\ - \ . toInteger) (peekByteOff p 20 :: IO Keycode)\n \ - \ <*> fmap (toEnum . fromIntegral . toInteger) (peekByteOff p 24 :: IO\ - \ Keymod)\n SDL_KEYUP -> EvtKeyUp <$> return t\n \ - \ <*> fmap (Window . fromIntegral . toInteger) (peekByteOff p 8\ - \ :: IO CUInt)\n <*> fmap (toEnum . fromIntegral\ - \ . toInteger) (peekByteOff p 16 :: IO CUInt)\n \ - \ <*> fmap (toEnum . fromIntegral . toInteger) (peekByteOff p 20 :: IO Keycode)\n\ - \ <*> fmap (toEnum . fromIntegral . toInteger)\ - \ (peekByteOff p 24 :: IO Keymod)\n SDL_WINDOWEVENT -> EvtWindow <$>\ - \ return t\n <*> fmap (Window . fromIntegral .\ - \ toInteger) (peekByteOff p 8 :: IO CUInt)\n <*>\ - \ fmap (toEnum . fromIntegral . toInteger) (peekByteOff p 12 :: IO Word8)\n\ + \ p 12 :: IO Word8)\n <*> fmap (fromIntegral .\ + \ toInteger) (peekByteOff p 16 :: IO CInt)\n <*>\ + \ fmap (fromIntegral . toInteger) (peekByteOff p 20 :: IO CInt)\n \ + \ SDL_TEXTINPUT -> EvtText <$> return t\n <*> fmap\ + \ (Window . fromIntegral . toInteger) (peekByteOff p 8 :: IO CUInt)\n\t\t\t\ + \ -- this text conversion is neccessary, the C-String of the event contains\ + \ a UTF8-encoding\n\t\t\t -- with BSC8.pack the string is converted to\ + \ ByteString without additional UTF8-encoding\n\t\t\t -- the remaining\ + \ decoding, creates a normal (Unicode) Haskell string from that\n \ + \ <*> fmap (UTF8.toString . UTF8.fromRep . BSC8.pack) (peekCAString\ + \ (castPtr (plusPtr p 12)) )\n SDL_MOUSEBUTTONDOWN -> EvtMouseButtonDown\ + \ <$> return t\n <*> fmap (Window . fromIntegral\ + \ . toInteger) (peekByteOff p 8 :: IO CUInt)\n \ + \ <*> fmap (fromIntegral . toInteger) (peekByteOff p 12 :: IO CUInt )\n \ + \ <*> fmap _getButton (peekByteOff p 16 :: IO Word8)\n\ \ <*> fmap (fromIntegral . toInteger) (peekByteOff\ - \ p 16 :: IO CInt)\n <*> fmap (fromIntegral . toInteger)\ - \ (peekByteOff p 20 :: IO CInt)\n SDL_TEXTINPUT -> EvtText <$> return\ - \ t\n <*> fmap (Window . fromIntegral . toInteger)\ - \ (peekByteOff p 8 :: IO CUInt)\n\t\t\t -- this text conversion is neccessary,\ - \ the C-String of the event contains a UTF8-encoding\n\t\t\t -- with BSC8.pack\ - \ the string is converted to ByteString without additional UTF8-encoding\n\ - \t\t\t -- the remaining decoding, creates a normal (Unicode) Haskell string\ - \ from that\n <*> fmap (UTF8.toString . UTF8.fromRep\ - \ . BSC8.pack) (peekCAString (castPtr (plusPtr p 12)) )\n SDL_MOUSEBUTTONDOWN\ - \ -> EvtMouseButtonDown <$> return t\n <*> fmap\ - \ (Window . fromIntegral . toInteger) (peekByteOff p 8 :: IO CUInt)\n \ - \ <*> fmap (fromIntegral . toInteger) (peekByteOff\ - \ p 12 :: IO CUInt )\n <*> fmap _getButton (peekByteOff\ - \ p 16 :: IO Word8)\n <*> fmap (fromIntegral .\ - \ toInteger) (peekByteOff p 20 :: IO CInt)\n <*>\ - \ fmap (fromIntegral . toInteger) (peekByteOff p 24 :: IO CInt)\n \ - \ SDL_MOUSEBUTTONUP -> EvtMouseButtonUp <$> return t\n \ - \ <*> fmap (Window . fromIntegral . toInteger) (peekByteOff p 8 ::\ - \ IO CUInt)\n <*> fmap (fromIntegral . toInteger)\ - \ (peekByteOff p 12 :: IO CUInt )\n <*> fmap _getButton\ - \ (peekByteOff p 16 :: IO Word8)\n <*> fmap (fromIntegral\ - \ . toInteger) (peekByteOff p 20 :: IO CInt)\n \ - \ <*> fmap (fromIntegral . toInteger) (peekByteOff p 24 :: IO CInt)\n \ - \ SDL_MOUSEMOTION -> EvtMouseMotion <$> return t\n \ - \ <*> fmap (Window . fromIntegral . toInteger) (peekByteOff p 8 ::\ - \ IO CUInt)\n <*> fmap (fromIntegral . toInteger)\ - \ (peekByteOff p 12 :: IO CUInt )\n <*> fmap (fromIntegral\ - \ . toInteger) (peekByteOff p 20 :: IO CInt)\n \ - \ <*> fmap (fromIntegral . toInteger) (peekByteOff p 24 :: IO CInt)\n \ - \ <*> fmap (fromIntegral . toInteger) (peekByteOff\ - \ p 28 :: IO CInt)\n <*> fmap (fromIntegral . toInteger)\ - \ (peekByteOff p 32 :: IO CInt)\n _ -> return $ EvtCommon t evttyp\n\ - \ ) ((\\e -> return EvtNotValid) ::(SomeException -> IO SDLEvent))\n\ - \n poke p evt = error \"poke of SDLEvent not implemented\"\n \n{#pointer\ - \ *sdlevent_struct as SDLEventPtr -> SDLEvent #}\n\nwithSDLEvent :: SDLEvent\ - \ -> (SDLEventPtr -> IO b) -> IO b\nwithSDLEvent = with\n\npeekSDLEvent ::\ - \ SDLEventPtr -> IO SDLEvent\npeekSDLEvent = peek\n", !!python/unicode 'SDL_Event', - true, !!python/unicode ''] + \ p 20 :: IO CInt)\n <*> fmap (fromIntegral . toInteger)\ + \ (peekByteOff p 24 :: IO CInt)\n SDL_MOUSEBUTTONUP -> EvtMouseButtonUp\ + \ <$> return t\n <*> fmap (Window . fromIntegral\ + \ . toInteger) (peekByteOff p 8 :: IO CUInt)\n \ + \ <*> fmap (fromIntegral . toInteger) (peekByteOff p 12 :: IO CUInt )\n \ + \ <*> fmap _getButton (peekByteOff p 16 :: IO Word8)\n\ + \ <*> fmap (fromIntegral . toInteger) (peekByteOff\ + \ p 20 :: IO CInt)\n <*> fmap (fromIntegral . toInteger)\ + \ (peekByteOff p 24 :: IO CInt)\n SDL_MOUSEMOTION -> EvtMouseMotion\ + \ <$> return t\n <*> fmap (Window . fromIntegral\ + \ . toInteger) (peekByteOff p 8 :: IO CUInt)\n \ + \ <*> fmap (fromIntegral . toInteger) (peekByteOff p 12 :: IO CUInt )\n \ + \ <*> fmap (fromIntegral . toInteger) (peekByteOff\ + \ p 20 :: IO CInt)\n <*> fmap (fromIntegral . toInteger)\ + \ (peekByteOff p 24 :: IO CInt)\n <*> fmap (fromIntegral\ + \ . toInteger) (peekByteOff p 28 :: IO CInt)\n \ + \ <*> fmap (fromIntegral . toInteger) (peekByteOff p 32 :: IO CInt)\n \ + \ _ -> return $ EvtCommon t evttyp\n ) ((\\e -> return EvtNotValid)\ + \ ::(SomeException -> IO SDLEvent))\n\n poke p evt = error \"poke of SDLEvent\ + \ not implemented\"\n \n{#pointer *sdlevent_struct as SDLEventPtr -> SDLEvent\ + \ #}\n\nwithSDLEvent :: SDLEvent -> (SDLEventPtr -> IO b) -> IO b\nwithSDLEvent\ + \ = with\n\npeekSDLEvent :: SDLEventPtr -> IO SDLEvent\npeekSDLEvent = peek\n", + !!python/unicode 'SDL_Event', true, !!python/unicode ''] /config/base: class: BaseConfig values: [!!python/unicode 'HGamer3D - SDL2 Bindings', !!python/unicode 'HGamer3D'] diff --git a/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/StructSDLEvent.chs b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/StructSDLEvent.chs index 910a337..706676f 100644 --- a/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/StructSDLEvent.chs +++ b/Bindings/SDL2/hBuild/HGamer3D/Bindings/SDL2/StructSDLEvent.chs @@ -74,15 +74,15 @@ _getButton w = case w of 5 -> SDLButtonX2 _ -> SDLButtonNumber ((fromIntegral . toInteger) w) -data SDLEvent = EvtKeyUp TimeMS Window EnumSDLScancode Keycode Keymod | - EvtKeyDown TimeMS Window EnumSDLScancode Keycode Keymod | - EvtText TimeMS Window String | - EvtQuit TimeMS | - EvtWindow TimeMS Window EnumSDLWindowEventID Int Int | - EvtMouseButtonDown TimeMS Window MouseID SDLButton Int Int | - EvtMouseButtonUp TimeMS Window MouseID SDLButton Int Int | - EvtMouseMotion TimeMS Window MouseID Int Int Int Int | - EvtCommon TimeMS EnumSDLEventType | +data SDLEvent = EvtKeyUp GameTime Window EnumSDLScancode Keycode Keymod | + EvtKeyDown GameTime Window EnumSDLScancode Keycode Keymod | + EvtText GameTime Window String | + EvtQuit GameTime | + EvtWindow GameTime Window EnumSDLWindowEventID Int Int | + EvtMouseButtonDown GameTime Window MouseID SDLButton Int Int | + EvtMouseButtonUp GameTime Window MouseID SDLButton Int Int | + EvtMouseMotion GameTime Window MouseID Int Int Int Int | + EvtCommon GameTime EnumSDLEventType | EvtNotValid instance Storable SDLEvent where @@ -94,7 +94,7 @@ instance Storable SDLEvent where time <- (peekByteOff p 4 :: IO CUInt) Control.Exception.catch (do let evttyp = (toEnum . fromIntegral . toInteger) typ -- this first throws exception if enum not ok ! - let t = TimeMS ((fromIntegral . toInteger) time) + let t = ((fromIntegral . (* 1000000) . toInteger) time) :: GameTime case (evttyp) of SDL_QUIT -> return $ EvtQuit t diff --git a/Data/HGamer3D-Data.cabal b/Data/HGamer3D-Data.cabal index 03b9b53..1680aea 100644 --- a/Data/HGamer3D-Data.cabal +++ b/Data/HGamer3D-Data.cabal @@ -17,9 +17,9 @@ Category: Game Engine Extra-source-files: Setup.hs Library - Build-Depends: base >= 3 && < 5, FindBin, directory, filepath, vect + Build-Depends: base >= 3 && < 5, FindBin, directory, filepath, vect, clock - Exposed-modules: HGamer3D.Data.TypeSynonyms, HGamer3D.Data.Vector,HGamer3D.Data.Colour,HGamer3D.Data.HG3DClass,HGamer3D.Data.Angle,HGamer3D.Data.TimeMS,HGamer3D.Data.Transform3D,HGamer3D.Data.Geometry2D,HGamer3D.Data.Window,HGamer3D.Util.FileLocation, HGamer3D.Util.UniqueName, HGamer3D.Data, HGamer3D.Util + Exposed-modules: HGamer3D.Data.TypeSynonyms, HGamer3D.Data.Vector,HGamer3D.Data.Colour,HGamer3D.Data.HG3DClass,HGamer3D.Data.Angle,HGamer3D.Data.GameTime,HGamer3D.Data.Transform3D,HGamer3D.Data.Geometry2D,HGamer3D.Data.Window,HGamer3D.Util.FileLocation, HGamer3D.Util.UniqueName, HGamer3D.Data, HGamer3D.Util Other-modules: c-sources: diff --git a/Data/HGamer3D/Data.hs b/Data/HGamer3D/Data.hs index f8c8eb1..30d3c95 100644 --- a/Data/HGamer3D/Data.hs +++ b/Data/HGamer3D/Data.hs @@ -26,7 +26,7 @@ module HGamer3D.Data module HGamer3D.Data.Angle, module HGamer3D.Data.Colour, module HGamer3D.Data.Transform3D, - module HGamer3D.Data.TimeMS, + module HGamer3D.Data.GameTime, module HGamer3D.Data.Vector, module HGamer3D.Data.Geometry2D, module HGamer3D.Data.TypeSynonyms, @@ -38,7 +38,7 @@ where import HGamer3D.Data.Angle import HGamer3D.Data.Colour import HGamer3D.Data.Transform3D -import HGamer3D.Data.TimeMS +import HGamer3D.Data.GameTime import HGamer3D.Data.Vector import HGamer3D.Data.Geometry2D import HGamer3D.Data.Window diff --git a/Data/HGamer3D/Data/GameTime.hs b/Data/HGamer3D/Data/GameTime.hs new file mode 100644 index 0000000..ffa1b53 --- /dev/null +++ b/Data/HGamer3D/Data/GameTime.hs @@ -0,0 +1,92 @@ +{-# LANGUAGE TypeSynonymInstances #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- TimeMS.hs + +-- | Module providing the time type for HGamer3D +module HGamer3D.Data.GameTime + +( + GameTime, + sec, + msec, + usec, + + secT, + msecT, + usecT, + + getTime, + getThreadCPUTime, + getProcessCPUTime +) + +where + +import qualified System.Clock as C + +type GameTime = C.TimeSpec + +_toInteger :: C.TimeSpec -> Integer +_toInteger ts = let + s = (fromIntegral (C.sec ts)) :: Integer + ns = (fromIntegral (C.nsec ts)) :: Integer + in s * 1000000000 + ns + +_fromInteger :: Integer -> C.TimeSpec +_fromInteger i = let + s = fromIntegral (i `quot` 1000000000) + ns = fromIntegral (i `rem` 1000000000) + in C.TimeSpec s ns + +instance Num GameTime where + (+) a b = _fromInteger((_toInteger a) Prelude.+ (_toInteger b) ) + (-) a b = _fromInteger((_toInteger a) Prelude.- (_toInteger b) ) + (*) a b = _fromInteger((_toInteger a) Prelude.* (_toInteger b) ) + abs a = _fromInteger( Prelude.abs (_toInteger a)) + signum a = _fromInteger( Prelude.signum (_toInteger a)) + fromInteger i = _fromInteger i + +sec :: C.TimeSpec -> Int +sec ts = fromIntegral ((_toInteger ts) `quot` 1000000000) + +msec :: C.TimeSpec -> Int +msec ts = fromIntegral ((_toInteger ts) `quot` 1000000) + +usec :: C.TimeSpec -> Int +usec ts = fromIntegral ((_toInteger ts) `quot` 1000) + +secT :: Int -> C.TimeSpec +secT i = _fromInteger ((fromIntegral i) * 1000000000) + +msecT :: Int -> C.TimeSpec +msecT i = _fromInteger ((fromIntegral i) * 1000000) + +usecT :: Int -> C.TimeSpec +usecT i = _fromInteger ((fromIntegral i) * 1000) + +getTime :: IO GameTime +getTime = C.getTime C.Realtime + +getThreadCPUTime :: IO GameTime +getThreadCPUTime = C.getTime C.ThreadCPUTime + +getProcessCPUTime :: IO GameTime +getProcessCPUTime = C.getTime C.ProcessCPUTime + diff --git a/GUI/HGamer3D-GUI.cabal b/GUI/HGamer3D-GUI.cabal index ebead0d..f7ebcc2 100644 --- a/GUI/HGamer3D-GUI.cabal +++ b/GUI/HGamer3D-GUI.cabal @@ -20,7 +20,7 @@ Extra-source-files: Setup.hs Library Build-Depends: base >= 3 && < 5, split, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-CEGUI-Binding >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.GUI.Internal.Base, HGamer3D.GUI.Internal.Widgets, HGamer3D.GUI.Internal.Properties, HGamer3D.GUI.BaseAPI, HGamer3D.Internal.GUI + Exposed-modules: HGamer3D.GUI.Internal.Base, HGamer3D.GUI.Internal.Widgets, HGamer3D.GUI.Internal.Properties, HGamer3D.GUI.Internal.Form, HGamer3D.GUI.BaseAPI, HGamer3D.Internal.GUI, HGamer3D.GUI.Schema.GUIDim, HGamer3D.GUI.Schema.Widget, HGamer3D.GUI.Schema.Layout, HGamer3D.GUI.Schema.Form Other-modules: c-sources: diff --git a/GUI/HGamer3D/GUI/BaseAPI.hs b/GUI/HGamer3D/GUI/BaseAPI.hs index c3e51d7..7ae75f4 100644 --- a/GUI/HGamer3D/GUI/BaseAPI.hs +++ b/GUI/HGamer3D/GUI/BaseAPI.hs @@ -81,6 +81,7 @@ module HGamer3D.GUI.BaseAPI -- * Event Handling injectWinEventToGUI, + injectGUITimeDelta, GUIEvent (..), registerGUIEvent, @@ -176,6 +177,24 @@ module HGamer3D.GUI.BaseAPI findSlider, findSpinner, + -- ** Layout Container Widgets + GUIHLayout, + GUIVLayout, + GUIGridLayout, + + hLayout, + vLayout, + gridLayout, + + toHLayout, + toVLayout, + toGridLayout, + + -- ** CRUD for Form based GUIs + GUIEngineData, + createForm, + updateForm, + removeForm, ) where @@ -183,4 +202,5 @@ where import HGamer3D.GUI.Internal.Base import HGamer3D.GUI.Internal.Widgets import HGamer3D.GUI.Internal.Properties - +import HGamer3D.GUI.Internal.Form +import HGamer3D.GUI.Schema.GUIDim diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs index 64cf151..75daf82 100644 --- a/GUI/HGamer3D/GUI/Internal/Base.hs +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -104,6 +104,11 @@ data GEComboBox = GEComboBox data GESlider = GESlider data GESpinner = GESpinner +data GEWindow = GEWindow +data GEHLayout = GEHLayout +data GEVLayout = GEVLayout +data GEGridLayout = GEGridLayout + -- | The GUI Element, a window, a button, any widget or widget element, organized in a hierarchy data GUIElement a = GUIElement HG3DClass a -- ^ only one constructor, phantom type a, to allow GUIElement sub-typing @@ -409,3 +414,7 @@ pollGUIEvent guis = do return $ Just evt else return Nothing +injectGUITimeDelta :: GUISystem -> GameTime -> IO () +injectGUITimeDelta guis gtime = do + CEGUISystem.injectTimePulse (guiRoot guis) ((fromIntegral . msec) gtime) + return () diff --git a/GUI/HGamer3D/GUI/Internal/Form.hs b/GUI/HGamer3D/GUI/Internal/Form.hs new file mode 100644 index 0000000..9b55819 --- /dev/null +++ b/GUI/HGamer3D/GUI/Internal/Form.hs @@ -0,0 +1,131 @@ +{-# OPTIONS_HADDOCK hide #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2013 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- GUI/Internal/Form.hs + +-- |Form functionality of the GUI. Implementation module with internal data structures exposed. Public API in HGamer3D.GUI. + +module HGamer3D.GUI.Internal.Form +where + +import HGamer3D.GUI.Internal.Base +import HGamer3D.GUI.Internal.Widgets +import HGamer3D.GUI.Internal.Properties + +import HGamer3D.GUI.Schema.Widget +import HGamer3D.GUI.Schema.Layout +import HGamer3D.GUI.Schema.Form +import HGamer3D.GUI.Schema.GUIDim + +import Data.Maybe + + +{- ---------------------------------------------------------------- + Functions for ECS API + ---------------------------------------------------------------- -} + +data GUIEngineDataWidget = GEDButton GUIButton + | GEDRadioButton GUIRadioButton + | GEDCheckBox GUICheckBox + | GEDComboBox GUIComboBox + +data GUIEngineDataLayout = GEDHLayout GUIHLayout + | GEDVLayout GUIVLayout + | GEDGridLayout GUIGridLayout + +data GUIEngineData = GUIEngineData GUIEngineDataElement Form + +data GUIEngineDataElement = GEDSingleElement GUIEngineDataWidget + | GEDCombinedElement GUIEngineDataLayout [GUIEngineDataElement] + +-- there is a big distinction in the typesystem between a type which is not known to the function but it is assumed it has a specific type on calling (typevariable a) and the return value of being any possible type which is requested by outer world type (typevariable b). So _undef is polymorphic in its out value, this only can be accomplished by undef! +_toUndef :: GUIElement a -> GUIElement b +_toUndef (GUIElement window _) = (GUIElement window undefined) + +_getWidget :: GUIEngineDataElement -> GUIElement a +_getWidget (GEDSingleElement (GEDButton w)) = _toUndef w +_getWidget (GEDSingleElement (GEDRadioButton w)) = _toUndef w +_getWidget (GEDSingleElement (GEDCheckBox w)) = _toUndef w +_getWidget (GEDSingleElement (GEDComboBox w)) = _toUndef w + +_getWidget (GEDCombinedElement (GEDHLayout l) _) = _toUndef l +_getWidget (GEDCombinedElement (GEDVLayout l) _) = _toUndef l +_getWidget (GEDCombinedElement (GEDGridLayout l) _) = _toUndef l + +_createLayout :: GUISystem -> Layout -> IO GUIEngineDataLayout +_createLayout guis layout = do + case layout of + Layout VerticalLayout props -> vLayout guis "Taharez" (_createLayoutProps props) >>= return . GEDVLayout + Layout HorizontalLayout props -> hLayout guis "Taharez" (_createLayoutProps props) >>= return . GEDHLayout + Layout (GridLayout x y) props -> gridLayout guis "Taharez" (_createLayoutProps props) >>= return . GEDGridLayout + +_createProps :: [WidgetProperty] -> [GUIElement a -> IO ()] +_createProps props = + let oneProp prop = case prop of + XPos gd -> pX =: gd + YPos gd -> pY =: gd + Width gd -> pWidth =: gd + Height gd -> pHeight =: gd + Visible v -> pVisible =: v + Alpha f -> pAlpha =: f + Text t -> pText =: t + in map oneProp props + +_createLayoutProps :: [LayoutParameter] -> [GUIElement a -> IO ()] +_createLayoutProps paras = + + let onePara para = case para of + (WP widgetProperty) -> Just (head (_createProps [widgetProperty])) + _ -> Nothing + in map fromJust (filter isJust (map onePara paras)) + +_createWidget :: GUISystem -> Widget -> IO GUIEngineDataElement +_createWidget guis widget = do + case widget of + Widget name Button val props -> button guis "TaharezLook" (_createProps props) >>= return . GEDSingleElement . GEDButton + Widget name RadioButton val props -> radioButton guis "TaharezLook" (_createProps props) >>= return . GEDSingleElement . GEDRadioButton + Widget name CheckBox val props -> checkBox guis "TaharezLook" (_createProps props) >>= return . GEDSingleElement . GEDCheckBox + Widget name ComboBox val props -> comboBox guis "TaharezLook" (_createProps props) >>= return . GEDSingleElement . GEDComboBox + +createForm :: GUISystem -> Form -> IO GUIEngineData +createForm guis form = do + let (Form typename formelement) = form + + let createFormElement formelement = do + case formelement of + WidgetFE widget -> _createWidget guis widget + LayoutFE layout formList -> do + layoutW <- _createLayout guis layout + widgetsW <- mapM createFormElement formList + let cl = GEDCombinedElement layoutW widgetsW + mapM (\f -> addChildGuiEl (_getWidget cl) (_getWidget f)) widgetsW + return $ cl + + formW <- createFormElement formelement + addGuiElToDisplay guis (_getWidget formW) + return $ GUIEngineData formW form + +removeForm :: GUISystem -> GUIEngineData -> IO () +removeForm guis form = do + return () + +updateForm :: GUISystem -> GUIEngineData -> Form -> IO GUIEngineData +updateForm guis edata form = do + return edata + diff --git a/GUI/HGamer3D/GUI/Internal/Properties.hs b/GUI/HGamer3D/GUI/Internal/Properties.hs index b79f445..b8ebec8 100644 --- a/GUI/HGamer3D/GUI/Internal/Properties.hs +++ b/GUI/HGamer3D/GUI/Internal/Properties.hs @@ -38,16 +38,7 @@ import HGamer3D.Data.HG3DClass import qualified HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions as WinStat import qualified HGamer3D.Bindings.CEGUI.ClassWindow as Win import qualified HGamer3D.Bindings.CEGUI.ClassUDim as Ud - -data GUIDim = GUIDim { - gdScale :: Float, - gdOffset :: Float -} - -data GUIVec2 = GUIVec2 { - gv2X :: GUIDim, - gv2Y :: GUIDim -} +import HGamer3D.GUI.Schema.GUIDim type GUIElementProperty a b = (GUIElement a -> IO b, GUIElement a -> b -> IO ()) type GUIButtonProperty b = GUIElementProperty GEButton b diff --git a/GUI/HGamer3D/GUI/Internal/Widgets.hs b/GUI/HGamer3D/GUI/Internal/Widgets.hs index 555452c..b1c4d47 100644 --- a/GUI/HGamer3D/GUI/Internal/Widgets.hs +++ b/GUI/HGamer3D/GUI/Internal/Widgets.hs @@ -82,6 +82,10 @@ import HGamer3D.GUI.Internal.Base import HGamer3D.GUI.Internal.Properties import HGamer3D.Data.HG3DClass +import qualified HGamer3D.GUI.Schema.Widget as ScW +import qualified HGamer3D.GUI.Schema.Layout as ScL +import qualified HGamer3D.GUI.Schema.Form as ScF + -- | GUI Element, Sybtype Button type GUIButton = GUIElement GEButton @@ -112,6 +116,21 @@ type GUISlider = GUIHasValue GESlider -- | GUI Element, Sybtype Spinner type GUISpinner = GUIHasValue GESpinner +-- | GUI Element, Subtype FrameWindow +type GUIWindow = GUIElement GEWindow + +-- | GUI Element, which is a layout container +type GUILayout a = GUIElement a + +-- | GUI Element, vertical layout container +type GUIVLayout = GUILayout GEVLayout + +-- | GUI Element, horizontal layout container +type GUIHLayout = GUILayout GEHLayout + +-- | GUI Element, grid layout container +type GUIGridLayout = GUILayout GEGridLayout + -- | get Type of GUI element as string typeOfGuiEl :: GUIElement a -- ^ GUI element to enable @@ -123,7 +142,8 @@ toGuiType :: String -> b -> GUIElement a -> IO (GUIElement b) toGuiType typestr cons guiel@(GUIElement window _) = do tp <- typeOfGuiEl guiel -- CEGUI Types as String have the format "WindowLook/Button" for example - let tp' = (splitOn "/" tp) !! 1 + -- sometimes they have no "xyzLook" part and no / + let tp' = last (splitOn "/" tp) let guiel' = case tp' of typestr -> GUIElement window cons _ -> error ("HGamer3D.GUI.Internal.Widgets.toGuiType: " ++ typestr ++ " not found!") @@ -140,6 +160,17 @@ _createElement elType convFunc guis style proplist = do setP el proplist return el +_createElement' :: String -> (GUIElement a -> IO (GUIElement b)) -> GUISystem -> String -> [GUIElement b -> IO ()] -> IO (GUIElement b) +_createElement' elType convFunc guis style proplist = do + let winMgr = guiWindowManager guis + let uname = guiUniqueName guis + elName <- nextUniqueName uname + window <- WindowManager.createWindow winMgr (elType) elName + el <- convFunc (GUIElement window undefined) + -- set the properties + setP el proplist + return el + button :: GUISystem -> String -> [GUIButton -> IO ()] -> IO GUIButton button = _createElement "Button" toButton @@ -164,6 +195,18 @@ spinner = _createElement "Spinner" toSpinner slider :: GUISystem -> String -> [GUISlider -> IO ()] -> IO GUISlider slider = _createElement "Slider" toSlider +window :: GUISystem -> String -> [GUIWindow -> IO ()] -> IO GUIWindow +window = _createElement "FrameWindow" toWindow + +hLayout :: GUISystem -> String -> [GUIHLayout -> IO ()] -> IO GUIHLayout +hLayout = _createElement' "HorizontalLayoutContainer" toHLayout + +vLayout :: GUISystem -> String -> [GUIVLayout -> IO ()] -> IO GUIVLayout +vLayout = _createElement' "VerticalLayoutContainer" toVLayout + +gridLayout :: GUISystem -> String -> [GUIGridLayout -> IO ()] -> IO GUIGridLayout +gridLayout = _createElement' "GridLayoutContainer" toGridLayout + toButton = toGuiType "Button" GEButton toRadioButton = toGuiType "RadioButton" GERadioButton toCheckBox = toGuiType "Checkbox" GECheckBox @@ -176,6 +219,11 @@ toListBox = toGuiType "Listbox" GEListBox toSlider = toGuiType "Slider" GESlider toSpinner = toGuiType "Spinner" GESpinner +toHLayout = toGuiType "HorizontalLayoutContainer" GEHLayout +toVLayout = toGuiType "VerticalLayoutContainer" GEVLayout +toGridLayout = toGuiType "GridLayoutContainer" GEGridLayout +toWindow = toGuiType "FrameWindow" GEWindow + findElement :: (GUIElement a -> IO (GUIElement b)) ->String -> GUIElement a @@ -272,3 +320,6 @@ listboxRemoveAllText (GUIElement window GEListBox) = do reallistbox <- WindowSF.castWindowToListbox window Listbox.resetList reallistbox + + + diff --git a/GUI/HGamer3D/GUI/Schema/Form.hs b/GUI/HGamer3D/GUI/Schema/Form.hs new file mode 100644 index 0000000..bb8a641 --- /dev/null +++ b/GUI/HGamer3D/GUI/Schema/Form.hs @@ -0,0 +1,37 @@ +{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/GUI/Schema/Form.hs + +-- | Types which describe the GUI Form +module HGamer3D.GUI.Schema.Form +where + +import Data.Typeable +import HGamer3D.Data as Dat +import HGamer3D.GUI.Schema.GUIDim +import HGamer3D.GUI.Schema.Widget +import HGamer3D.GUI.Schema.Layout + +data Form = Form String FormElement deriving (Eq, Show, Typeable) + +data FormElement = WidgetFE Widget + | LayoutFE Layout [FormElement] + deriving (Eq, Show, Typeable) + diff --git a/Data/HGamer3D/Data/TimeMS.hs b/GUI/HGamer3D/GUI/Schema/GUIDim.hs similarity index 62% rename from Data/HGamer3D/Data/TimeMS.hs rename to GUI/HGamer3D/GUI/Schema/GUIDim.hs index 4156ecc..9df0afd 100644 --- a/Data/HGamer3D/Data/TimeMS.hs +++ b/GUI/HGamer3D/GUI/Schema/GUIDim.hs @@ -1,34 +1,38 @@ --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- TimeMS.hs - --- | Module providing the time type for HGamer3D -module HGamer3D.Data.TimeMS - -( - TimeMS (..) -) - -where - --- | the time type of HGamer3D (in milliseconds) -data TimeMS = TimeMS Int deriving (Eq) -- time in milliseconds - -instance Show TimeMS where - show (TimeMS s) = (show s) ++ " Milliseconds" +{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/GUI/Schema/GUIDim.hs + +-- | Types which describe the GUI Dimensions +module HGamer3D.GUI.Schema.GUIDim +where + +import Data.Typeable +import HGamer3D.Data as Dat + +data GUIDim = GUIDim { + gdScale :: Float, + gdOffset :: Float + } deriving (Eq, Show, Typeable) + +data GUIVec2 = GUIVec2 { + gv2X :: GUIDim, + gv2Y :: GUIDim +} + diff --git a/GUI/HGamer3D/GUI/Schema/Layout.hs b/GUI/HGamer3D/GUI/Schema/Layout.hs new file mode 100644 index 0000000..6c16ed3 --- /dev/null +++ b/GUI/HGamer3D/GUI/Schema/Layout.hs @@ -0,0 +1,46 @@ +{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/GUI/Schema/Layout.hs + +-- | Types which describe the GUI Layout Schemes +module HGamer3D.GUI.Schema.Layout +where + +import Data.Typeable +import HGamer3D.Data as Dat +import HGamer3D.GUI.Schema.GUIDim +import HGamer3D.GUI.Schema.Widget + +data Layout = Layout LayoutType [LayoutParameter] + deriving (Eq, Show, Typeable) + +data LayoutType = VerticalLayout + | HorizontalLayout + | GridLayout Int Int -- ^ x y dimensions of grid units + deriving (Eq, Show, Typeable) + +data LayoutParameter = VerticalSpace Float + | HorizontalSpace Float + | WP WidgetProperty + | MaxSize GUIDim GUIDim + | MinSize GUIDim GUIDim + deriving (Eq, Show, Typeable) + + diff --git a/GUI/HGamer3D/GUI/Schema/Widget.hs b/GUI/HGamer3D/GUI/Schema/Widget.hs new file mode 100644 index 0000000..321ec51 --- /dev/null +++ b/GUI/HGamer3D/GUI/Schema/Widget.hs @@ -0,0 +1,63 @@ +{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- HGamer3D/GUI/Schema/Widget.hs + +-- | Types which describe the GUI Widgets +module HGamer3D.GUI.Schema.Widget +where + +import Data.Typeable +import HGamer3D.Data as Dat +import HGamer3D.GUI.Schema.GUIDim + +type WidgetName = String + +-- | The data to specify a widget +data Widget = Widget WidgetName WidgetType WidgetValue [WidgetProperty] deriving (Eq, Show, Typeable) + +-- | Widget Types +data WidgetType = Button + | RadioButton + | CheckBox + | ComboBox + | ListBox + | EditText + | Spinner + | Slider + deriving (Eq, Show, Typeable) + +-- | Widget Properties +data WidgetProperty = XPos GUIDim + | YPos GUIDim + | Width GUIDim + | Height GUIDim + | Visible Bool + | Alpha Float + | Choice [String] + | Text String + deriving (Eq, Show, Typeable) + +-- | The editable value a widget represents +data WidgetValue = TextValue String + | FloatValue Float + | BoolValue Bool + | StringListValue [String] + deriving (Eq, Show, Typeable) + diff --git a/GUI/SConstruct b/GUI/SConstruct index 4c138c1..d6235d9 100644 --- a/GUI/SConstruct +++ b/GUI/SConstruct @@ -16,6 +16,7 @@ env["ENV"]["HOME"] = os.environ.get("HOME") dependsOn = [ "HGamer3D/GUI/BaseAPI.hs", Glob("HGamer3D/GUI/Internal/*"), + Glob("HGamer3D/GUI/Schema/*"), Glob("HGamer3D/Internal/*"), Glob("*.cabal"), "LICENSE", diff --git a/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs index f58cb7e..f9c3048 100644 --- a/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs +++ b/Graphics3D/HGamer3D/Graphics3D/BaseAPI.hs @@ -68,6 +68,7 @@ module HGamer3D.Graphics3D.BaseAPI removeCamera, updateCamera, cameraLookAt, + cameraAdaptAspectRatio, addResourceLocationMedia, addResourceZipfileMedia, diff --git a/Main/HGamer3D/Audio/Internal/SystemAudio.hs b/Main/HGamer3D/Audio/Internal/SystemAudio.hs index c7e41c2..8b42a12 100644 --- a/Main/HGamer3D/Audio/Internal/SystemAudio.hs +++ b/Main/HGamer3D/Audio/Internal/SystemAudio.hs @@ -95,7 +95,7 @@ instance System ECSAudio where shutdownSystem system = return () -runSystemAudio :: D.TimeMS -> IO ECSAudio +runSystemAudio :: D.GameTime -> IO ECSAudio runSystemAudio sleepT = runSystem sleepT diff --git a/Main/HGamer3D/Engine/Internal/ComponentType.hs b/Main/HGamer3D/Engine/Internal/ComponentType.hs index a1a3765..948b46f 100644 --- a/Main/HGamer3D/Engine/Internal/ComponentType.hs +++ b/Main/HGamer3D/Engine/Internal/ComponentType.hs @@ -38,6 +38,7 @@ data ComponentType = CTPos -- ^ Position | CTScP -- ^ Scene Parameter | CTEvR -- ^ Event Receiver (GUI, Window, Joystick, Channel, ...) | CTEvS -- ^ Event Sender (Channel, ...) + | CTGFo -- ^ GUI Forms deriving (Eq, Ord, Show) diff --git a/Main/HGamer3D/Engine/Internal/Event.hs b/Main/HGamer3D/Engine/Internal/Event.hs index 6371195..613013a 100644 --- a/Main/HGamer3D/Engine/Internal/Event.hs +++ b/Main/HGamer3D/Engine/Internal/Event.hs @@ -22,18 +22,24 @@ -- module HGamer3D.Engine.Internal.Event - where import HGamer3D.WinEvent.BaseAPI import HGamer3D.GUI.BaseAPI +import qualified HGamer3D.GUI.Schema.Widget as W import Data.Dynamic data AudioEvent = PlaySound String | StopSound String +data GUIElementEvent = GELSetValue W.WidgetValue + | GELSetProperty W.WidgetProperty + | GELValueChange W.WidgetValue + | GELButtonClick + data HG3DEvent = WindowEvt SDLEvent - | GUIEvt GUIEvent + | GUIEvt GUIEvent -- ^ Low level GUI evts + | GELEvt W.WidgetName GUIElementEvent -- ^ High level GUI evts | AudioEvt AudioEvent | UserEvt Dynamic diff --git a/Main/HGamer3D/Engine/Internal/GameLoop.hs b/Main/HGamer3D/Engine/Internal/GameLoop.hs index 30cf464..a08d2a5 100644 --- a/Main/HGamer3D/Engine/Internal/GameLoop.hs +++ b/Main/HGamer3D/Engine/Internal/GameLoop.hs @@ -60,10 +60,14 @@ module HGamer3D.Engine.Internal.GameLoop -- after that the call returns. stepHGamer3D :: Graphics3DSystem -- ^ the Graphics System -> GUISystem -- ^ the GUI System - -> IO ([HG3DEvent], Bool) -- ^ list of Events received, quit flag (True if quit received) + -> GameTime -- ^ last time called + -> IO ([HG3DEvent], GameTime, Bool) -- ^ list of Events received, quit flag (True if quit received) - stepHGamer3D g3ds guis = do + stepHGamer3D g3ds guis lastTime = do + now <- getTime + let tdiff = now - lastTime + injectGUITimeDelta guis tdiff let getEvents evts = do mWinEvt <- pollWinEvent case mWinEvt of @@ -74,21 +78,22 @@ module HGamer3D.Engine.Internal.GameLoop mGuiEvt <- pollGUIEvent guis case mGuiEvt of Just guiEvt -> getEvents (evts ++ [GUIEvt guiEvt]) - Nothing -> do - return evts + Nothing -> return evts qFlag <- stepGraphics3D g3ds events <- getEvents [] - return (events, qFlag) + + return (events, now, qFlag) initHGamer3D :: String -- ^ Window Title -> Bool -- ^ Flag show config dialogue -> Bool -- ^ Flag logging enabled -> Bool -- ^ show Graphics Cursor - -> IO (Graphics3DSystem, GUISystem) + -> IO (Graphics3DSystem, GUISystem, GameTime) initHGamer3D windowTitle fConfigDialogue fLog fGraphicsCursor = do success <- initWinEvent [WEV_INIT_EVENTS, WEV_INIT_TIMER, WEV_INIT_VIDEO] (g3ds, window) <- initGraphics3D windowTitle "DefaultSceneManager" fConfigDialogue fLog win <- attachToWindow window guis <- initGUI fLog fGraphicsCursor - return (g3ds, guis) + now <- getTime + return (g3ds, guis, now) diff --git a/Main/HGamer3D/Engine/Internal/System.hs b/Main/HGamer3D/Engine/Internal/System.hs index 499ca68..aa7c3eb 100644 --- a/Main/HGamer3D/Engine/Internal/System.hs +++ b/Main/HGamer3D/Engine/Internal/System.hs @@ -40,7 +40,6 @@ import HGamer3D.Engine.Internal.ComponentType import HGamer3D.Engine.Internal.Entity import HGamer3D.Engine.Internal.Event -import System.Clock import System.Mem.StableName import Data.Hashable import qualified Data.HashTable.IO as HT @@ -49,8 +48,51 @@ import qualified Data.HashTable.IO as HT -- the class of data types which have a pure and engine implementation and which can be updated +{- ---------------------------------------------------------- + utility functions for systems + ---------------------------------------------------------- -} --- utility functions for systems +-- Entity List + +data EntityList = EntityList { + entAddList :: MVar [Entity], + entRemoveList :: MVar [Entity], + entities :: IORef [Entity] +} + +entInitialize :: IO EntityList +entInitialize = do + al <- newMVar [] + rl <- newMVar [] + es <- newIORef [] + return $ EntityList al rl es + +entAdd :: EntityList -> Entity -> IO EntityList +entAdd esys entity = do + al <- takeMVar (entAddList esys) + putMVar (entAddList esys) (al ++ [entity]) + return esys + +entRemove :: EntityList -> Entity -> IO EntityList +entRemove esys entity = do + rl <- takeMVar (entRemoveList esys) + putMVar (entRemoveList esys) (rl ++ [entity]) + return esys + +stepEntityList :: EntityList -> IO EntityList +stepEntityList esys = do + -- add/remove entities from other thread + al <- takeMVar (entAddList esys) + putMVar (entAddList esys) [] + modifyIORef (entities esys) (\oldList -> oldList ++ al) + + -- remove, to be done + + return esys + + + +-- List and Cache type IdHashTable v = HT.BasicHashTable EntityId v @@ -220,27 +262,23 @@ class System a where initializeSystem :: IO a shutdownSystem :: a -> IO () - runSystem :: D.TimeMS -> IO a + runSystem :: D.GameTime -> IO a runSystem stepT = do mv <- newEmptyMVar forkOS $ (\mv' -> do status <- initializeSystem putMVar mv' status let runS s = do - let (TimeMS msecStepT) = stepT - nowT <- getTime Monotonic + nowT <- getTime (s', qFlag) <- stepSystem s if qFlag then do shutdownSystem s' return () else do - nowT' <- getTime Monotonic - let diffSec = (fromIntegral ((sec nowT') - (sec nowT)))::Integer - let diffNSec = (fromIntegral ((nsec nowT') - (nsec nowT)))::Integer - let diffMSec = diffSec * 1000 + (diffNSec `div` 1000000) - let msecDelay = (fromIntegral msecStepT) - diffMSec - if msecDelay > 0 then do - threadDelay ((fromIntegral msecDelay) * 1000) + nowT' <- getTime + let timeUsed = nowT' - nowT + if timeUsed < stepT then do + threadDelay ((fromIntegral . usec) (stepT - timeUsed) ) else do return () runS s' diff --git a/Main/HGamer3D/Engine/Internal/SystemEvent.hs b/Main/HGamer3D/Engine/Internal/SystemEvent.hs index 4d10495..4906aef 100644 --- a/Main/HGamer3D/Engine/Internal/SystemEvent.hs +++ b/Main/HGamer3D/Engine/Internal/SystemEvent.hs @@ -60,6 +60,7 @@ import qualified HGamer3D.Data as D import qualified HGamer3D.Internal.Graphics3D as Gr import qualified HGamer3D.Engine.BaseAPI as E import qualified HGamer3D.GUI.BaseAPI as GU +import qualified HGamer3D.WinEvent.BaseAPI as WinEvt import HGamer3D.Graphics3D.Schema.Figure import HGamer3D.Graphics3D.Schema.Geometry @@ -71,41 +72,33 @@ import HGamer3D.Engine.Schema.EventReceiver import HGamer3D.Engine.Schema.EventSender data ECSEventQueues = ECSEventQueues { - addList :: MVar [Entity], - removeList :: MVar [Entity], - entities :: IORef [Entity], + entList :: EntityList, namedQueues :: HT.BasicHashTable String [HG3DEvent] } instance System ECSEventQueues where initializeSystem = do - al <- newMVar [] - rl <- newMVar [] - es <- newIORef [] + el <- entInitialize nq <- HT.new - return $ (ECSEventQueues al rl es nq) + return $ (ECSEventQueues el nq) addEntity esys entity = do - al <- takeMVar (addList esys) - putMVar (addList esys) (al ++ [entity]) + entAdd (entList esys) entity return esys removeEntity esys entity = do - rl <- takeMVar (removeList esys) - putMVar (removeList esys) (rl ++ [entity]) + entRemove (entList esys) entity return esys stepSystem esys = do -- add/remove entities from other thread - al <- takeMVar (addList esys) - putMVar (addList esys) [] - modifyIORef (entities esys) (\oldList -> oldList ++ al) + stepEntityList (entList esys) -- remove, to be done - es <- readIORef (entities esys) + es <- readIORef (entities (entList esys)) -- map over all events and handle single events coming from -- user and from receiver components, send them to targets mapM (\entity -> do @@ -147,7 +140,7 @@ instance System ECSEventQueues where case (entity #? CTEvS) of Nothing -> return () Just com -> _pushU2CEvents com evts - + -- Channel handling, sender to named channel case (entity #? CTEvS) of Nothing -> return () @@ -192,7 +185,7 @@ instance System ECSEventQueues where shutdownSystem esys = return () -runSystemEvent :: D.TimeMS -> IO ECSEventQueues +runSystemEvent :: D.GameTime -> IO ECSEventQueues runSystemEvent sleepT = runSystem sleepT diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index 3ffd4ce..333805c 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -38,6 +38,7 @@ import HGamer3D.Engine.Internal.Component import HGamer3D.Engine.Internal.ComponentType import HGamer3D.Engine.Internal.System +import Data.IORef import Data.Hashable import qualified Data.HashTable.IO as HT @@ -46,6 +47,7 @@ import qualified HGamer3D.Data as D import qualified HGamer3D.Internal.Graphics3D as Gr import qualified HGamer3D.Engine.BaseAPI as E import qualified HGamer3D.GUI.BaseAPI as GU +import qualified HGamer3D.WinEvent.BaseAPI as WinEvt import HGamer3D.Graphics3D.Schema.Figure import HGamer3D.Graphics3D.Schema.Geometry @@ -53,6 +55,8 @@ import HGamer3D.Graphics3D.Schema.Material import HGamer3D.Graphics3D.Schema.Camera import HGamer3D.Graphics3D.Schema.Light import HGamer3D.Graphics3D.Schema.Scene +import HGamer3D.Engine.Schema.EventReceiver +import HGamer3D.GUI.Schema.Form @@ -64,6 +68,7 @@ import HGamer3D.Graphics3D.Schema.Scene data ECSGraphics3D = ECSGraphics3D { -- status of graphics engine g3d :: (Gr.Graphics3DSystem, GU.GUISystem), + receivers :: ListAndCache EventReceiver (), -- figures figures :: ListAndCache Figure (Gr.Object3D Figure), @@ -80,13 +85,21 @@ data ECSGraphics3D = ECSGraphics3D { poslig :: ListAndCache D.Position (), orilig :: ListAndCache D.Orientation (), + -- gui forms + guiforms :: ListAndCache Form GU.GUIEngineData, + -- scene parameter - scenepars :: ListAndCache SceneParameter () + scenepars :: ListAndCache SceneParameter (), + + -- gametime + gt :: IORef D.GameTime } instance System ECSGraphics3D where addEntity ecsg3d entity = do + lacAdd entity (receivers ecsg3d) + lacAdd entity (figures ecsg3d) lacAdd entity (posfig ecsg3d) lacAdd entity (orifig ecsg3d) @@ -99,11 +112,14 @@ instance System ECSGraphics3D where lacAdd entity (poslig ecsg3d) lacAdd entity (orilig ecsg3d) + lacAdd entity (guiforms ecsg3d) lacAdd entity (scenepars ecsg3d) return ecsg3d removeEntity ecsg3d entity = do + lacRemove entity (receivers ecsg3d) + lacRemove entity (figures ecsg3d) lacRemove entity (posfig ecsg3d) lacRemove entity (orifig ecsg3d) @@ -116,14 +132,17 @@ instance System ECSGraphics3D where lacRemove entity (poslig ecsg3d) lacRemove entity (orilig ecsg3d) + lacRemove entity (guiforms ecsg3d) lacRemove entity (scenepars ecsg3d) return ecsg3d initializeSystem = do g3d <- E.initHGamer3D "HGamer3D - System" True True True - let (g3ds, guis) = g3d + let (g3ds, guis, gtime) = g3d Gr.setAmbientLight g3ds D.white + recv <- lacInitialize CTEvR + figs <- lacInitialize CTFig posfig <- lacInitialize CTPos orifig <- lacInitialize CTOri @@ -136,9 +155,12 @@ instance System ECSGraphics3D where poslig <- lacInitialize CTPos orilig <- lacInitialize CTOri + gfos <- lacInitialize CTGFo scpars <- lacInitialize CTScP - return $ (ECSGraphics3D g3d figs posfig orifig cams poscam oricam ligs poslig orilig scpars) + mgt <- newIORef gtime + + return $ (ECSGraphics3D (g3ds, guis) recv figs posfig orifig cams poscam oricam ligs poslig orilig gfos scpars mgt) stepSystem ecsg3d = do let (g3ds, guis) = (g3d ecsg3d) @@ -147,13 +169,22 @@ instance System ECSGraphics3D where let update' pos edata schema = D.positionTo edata pos let update'' pos edata schema = D.orientationTo edata pos + -- receivers + lacApplyChanges (receivers ecsg3d) (\s -> return ()) (\s e -> return ()) (\e -> return ()) lacHandleU2CEvents lacHandleC2UEvents + -- figures lacApplyChanges (figures ecsg3d) (Gr.object3D g3ds) (Gr.update3D g3ds) (Gr.remove3D g3ds) lacHandleU2CEvents lacHandleC2UEvents lacApplyOtherChanges (posfig ecsg3d) (figures ecsg3d) update' lacApplyOtherChanges (orifig ecsg3d) (figures ecsg3d) update'' -- cameras - lacApplyChanges (cameras ecsg3d) (Gr.addCamera g3ds) (Gr.updateCamera g3ds) (Gr.removeCamera g3ds) lacHandleU2CEvents lacHandleC2UEvents + let handleU2CEvents evts cam = do + mapM (\evt -> case evt of + (E.WindowEvt (WinEvt.EvtWindow _ _ WinEvt.SDL_WINDOWEVENT_SIZE_CHANGED x y)) -> Gr.cameraAdaptAspectRatio cam + _ -> return () + ) evts + return () + lacApplyChanges (cameras ecsg3d) (Gr.addCamera g3ds) (Gr.updateCamera g3ds) (Gr.removeCamera g3ds) handleU2CEvents lacHandleC2UEvents lacApplyOtherChanges (poscam ecsg3d) (cameras ecsg3d) update' lacApplyOtherChanges (orifig ecsg3d) (cameras ecsg3d) update'' @@ -162,20 +193,33 @@ instance System ECSGraphics3D where lacApplyOtherChanges (poslig ecsg3d) (lights ecsg3d) update' lacApplyOtherChanges (orilig ecsg3d) (lights ecsg3d) update'' + -- gui forms + lacApplyChanges (guiforms ecsg3d) (GU.createForm guis) (GU.updateForm guis) (GU.removeForm guis) lacHandleU2CEvents lacHandleC2UEvents + -- scene parameters let updateScene eng new = Gr.setSceneParameter g3ds new let removeScene eng = return () lacApplyChanges (scenepars ecsg3d) (Gr.setSceneParameter g3ds) updateScene removeScene lacHandleU2CEvents lacHandleC2UEvents -- step graphics system - (evts, qFlag) <- E.stepHGamer3D g3ds guis - - -- handover evts towards the event system, map over - - -- next steps, put Entity handling in system, (from SystemEvent) - -- then add also here to this system - -- then ad events to all Event Receiver components (C2U) - + t <- readIORef (gt ecsg3d) + (evts, nt, qFlag) <- E.stepHGamer3D g3ds guis t + writeIORef (gt ecsg3d) nt + + -- handover evts towards the event system + inList <- readIORef (lacList (receivers ecsg3d)) + mapM (\(eid, com) -> do + _pushC2UEvents com evts + ) inList + + + -- send camera resize events + let camEvts = filter (\evt -> case evt of + (E.WindowEvt (WinEvt.EvtWindow _ _ WinEvt.SDL_WINDOWEVENT_SIZE_CHANGED x y)) -> True + _ -> False) evts + camList <- readIORef (lacList (cameras ecsg3d)) + mapM (\cam -> _pushU2CEvents (snd cam) camEvts) camList + return (ecsg3d, qFlag) @@ -184,7 +228,7 @@ instance System ECSGraphics3D where E.freeHGamer3D g3ds guis return () -runSystemGraphics3D :: D.TimeMS -> IO ECSGraphics3D +runSystemGraphics3D :: D.GameTime -> IO ECSGraphics3D runSystemGraphics3D sleepT = runSystem sleepT diff --git a/Network/HGamer3D/Network/Internal/Base.hs b/Network/HGamer3D/Network/Internal/Base.hs index cb3666c..c105d5f 100644 --- a/Network/HGamer3D/Network/Internal/Base.hs +++ b/Network/HGamer3D/Network/Internal/Base.hs @@ -26,7 +26,7 @@ where import GHC.Ptr import HGamer3D.Data.HG3DClass -import HGamer3D.Data.TimeMS +import HGamer3D.Data.GameTime import HGamer3D.Bindings.Enet.ClassEnet as EnetClass import HGamer3D.Bindings.Enet.ClassEnetServer as EnetServer @@ -96,7 +96,7 @@ class NetworkNode a where -- | receive pending messages receiveNetworkMessages :: a -- ^ the node itself - -> TimeMS -- ^ the time in ms, which the node waits for incoming messages. If zero only delivers pending messages. + -> GameTime -- ^ the time, which the node waits for incoming messages. If zero only delivers pending messages. -> IO [NetworkPacket] -- ^ array of received network packages @@ -138,8 +138,8 @@ instance NetworkNode NetworkClient where EnetClient.send client message channel return () - receiveNetworkMessages (NetworkClient client) (TimeMS ms) = do - allPs <- _receiveClient client ms [] + receiveNetworkMessages (NetworkClient client) gtime = do + allPs <- _receiveClient client (msec gtime) [] return allPs instance NetworkNode NetworkServer where @@ -148,8 +148,8 @@ instance NetworkNode NetworkServer where EnetServer.send server clientname message channel return () - receiveNetworkMessages (NetworkServer server) (TimeMS ms) = do - allPs <- _receiveServer server ms [] + receiveNetworkMessages (NetworkServer server) gtime = do + allPs <- _receiveServer server (msec gtime) [] return allPs From e548a4ba05c70b1b9dbaf902e3896fdd77601e81 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Wed, 23 Jul 2014 18:31:36 +0200 Subject: [PATCH 14/28] GUI now working quite well, events missing in ECS API --- .../Source/HG3DWindowStaticFunctions.cpp | 20 ++++++ .../CEGUI/Source/HG3DWindowStaticFunctions.h | 7 ++ .../cBuild/ClassHG3DWindowStaticFunctions.cpp | 27 ++++++++ .../cBuild/HG3DWindowStaticFunctions.cpp | 20 ++++++ .../include/ClassHG3DWindowStaticFunctions.h | 10 +++ .../include/HG3DWindowStaticFunctions.h | 7 ++ .../CEGUI/ClassHG3DWindowStaticFunctions.chs | 16 +++++ .../include/ClassHG3DWindowStaticFunctions.h | 10 +++ .../include/HG3DWindowStaticFunctions.h | 7 ++ .../MediaFiles/media/fonts/Batang-26.font | 2 +- .../MediaFiles/media/fonts/DejaVuSans-10.font | 2 +- Examples/MediaFiles/media/fonts/fkp-16.font | 2 +- .../media/imagesets/DriveIcons.imageset | 2 +- .../media/imagesets/FairChar.imageset | 2 +- .../media/imagesets/HGamer3DLogo.imageset | 2 +- .../media/imagesets/OgreTray.imageset | 2 +- .../media/imagesets/TaharezLook.imageset | 2 +- .../media/imagesets/Vanilla.imageset | 2 +- .../media/imagesets/WindowsLook.imageset | 2 +- GUI/HGamer3D/GUI/BaseAPI.hs | 8 +++ GUI/HGamer3D/GUI/Internal/Base.hs | 5 ++ GUI/HGamer3D/GUI/Internal/Form.hs | 67 +++++++++++-------- GUI/HGamer3D/GUI/Internal/Properties.hs | 14 ++++ GUI/HGamer3D/GUI/Internal/Widgets.hs | 12 ++-- GUI/HGamer3D/GUI/Schema/Form.hs | 6 +- GUI/HGamer3D/GUI/Schema/Layout.hs | 16 ++--- GUI/HGamer3D/GUI/Schema/Widget.hs | 34 ++++------ Main/HGamer3D/Engine/Internal/Event.hs | 5 +- .../Engine/Internal/SystemGraphics3D.hs | 9 ++- 29 files changed, 235 insertions(+), 85 deletions(-) diff --git a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp index 57b661a..c498443 100644 --- a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp +++ b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp @@ -118,3 +118,23 @@ CEGUI::UDim* HG3DWindowStaticFunctions::getWindowHeight(const CEGUI::Window* win *pud = window->getHeight(); return pud; } + +void HG3DWindowStaticFunctions::setNewWindowSize(CEGUI::System* system, float width, float height) +{ + CEGUI::Size new_size = CEGUI::Size(width, height); + system->notifyDisplaySizeChanged(new_size); +} + +CEGUI::UDim* HG3DWindowStaticFunctions::getWindowMargin(const CEGUI::Window* window) +{ + CEGUI::UBox margin; + CEGUI::UDim* pud = new CEGUI::UDim(0.0, 0.0); + margin = window->getMargin(); + *pud = margin.d_top; + return pud; +} + +void HG3DWindowStaticFunctions::setWindowMargin (CEGUI::Window* window, const CEGUI::UDim* margin) +{ + window->setMargin(CEGUI::UBox(*margin, *margin, CEGUI::UDim(0.0,0.0), CEGUI::UDim(0.0,0.0))); +} diff --git a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h index 9143643..83a66bd 100644 --- a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h +++ b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h @@ -49,5 +49,12 @@ class HG3DWindowStaticFunctions static CEGUI::UDim* getWindowWidth(const CEGUI::Window* window); static CEGUI::UDim* getWindowHeight(const CEGUI::Window* window); + + // utility function to set new window positions + static void setNewWindowSize(CEGUI::System* system, float width, float height); + + // utility functions to get and set margin (only one parameter) + static CEGUI::UDim* getWindowMargin(const CEGUI::Window* window); + static void setWindowMargin (CEGUI::Window* window, const CEGUI::UDim* margin); }; diff --git a/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp b/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp index 34dea08..c137f7c 100644 --- a/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp +++ b/Bindings/CEGUI/cBuild/ClassHG3DWindowStaticFunctions.cpp @@ -215,3 +215,30 @@ extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_getWindowHeight(struct hg3dclass ; }; +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_setNewWindowSize(struct hg3dclass_struct * system_c, float width_c, float height_c) +{ + CEGUI::System * system_cpp = static_cast (getHG3DClassPtr(*system_c, "CEGUI::System")); + float width_cpp = (float)width_c; + float height_cpp = (float)height_c; + (HG3DWindowStaticFunctions::setNewWindowSize(system_cpp, width_cpp, height_cpp)); +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_getWindowMargin(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c) +{ + const CEGUI::Window * window_cpp = static_cast (getHG3DClassPtr(*window_c, "CEGUI::Window")); + CEGUI::UDim * result_cpp; + result_cpp = (HG3DWindowStaticFunctions::getWindowMargin(window_cpp)); + *result_c = getHG3DClass_UDim((void *) result_cpp); +; +}; + +// +extern "C" CEGUI_LIB_EXPORT void cegui_hg3dwsfs_setWindowMargin(struct hg3dclass_struct * window_c, struct hg3dclass_struct * margin_c) +{ + CEGUI::Window * window_cpp = static_cast (getHG3DClassPtr(*window_c, "CEGUI::Window")); + const CEGUI::UDim * margin_cpp = static_cast (getHG3DClassPtr(*margin_c, "CEGUI::UDim")); + (HG3DWindowStaticFunctions::setWindowMargin(window_cpp, margin_cpp)); +}; + diff --git a/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp b/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp index 57b661a..c498443 100644 --- a/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp +++ b/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp @@ -118,3 +118,23 @@ CEGUI::UDim* HG3DWindowStaticFunctions::getWindowHeight(const CEGUI::Window* win *pud = window->getHeight(); return pud; } + +void HG3DWindowStaticFunctions::setNewWindowSize(CEGUI::System* system, float width, float height) +{ + CEGUI::Size new_size = CEGUI::Size(width, height); + system->notifyDisplaySizeChanged(new_size); +} + +CEGUI::UDim* HG3DWindowStaticFunctions::getWindowMargin(const CEGUI::Window* window) +{ + CEGUI::UBox margin; + CEGUI::UDim* pud = new CEGUI::UDim(0.0, 0.0); + margin = window->getMargin(); + *pud = margin.d_top; + return pud; +} + +void HG3DWindowStaticFunctions::setWindowMargin (CEGUI::Window* window, const CEGUI::UDim* margin) +{ + window->setMargin(CEGUI::UBox(*margin, *margin, CEGUI::UDim(0.0,0.0), CEGUI::UDim(0.0,0.0))); +} diff --git a/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h b/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h index ecc4cff..a08a286 100644 --- a/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h @@ -39,6 +39,7 @@ #include "ClassMultiColumnList.h" #include "ClassUDim.h" #include "ClassUVector2.h" +#include "ClassSystem.h" // @@ -92,4 +93,13 @@ void cegui_hg3dwsfs_getWindowWidth(struct hg3dclass_struct * window_c, struct hg // void cegui_hg3dwsfs_getWindowHeight(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); +// +void cegui_hg3dwsfs_setNewWindowSize(struct hg3dclass_struct * system_c, float width_c, float height_c); + +// +void cegui_hg3dwsfs_getWindowMargin(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); + +// +void cegui_hg3dwsfs_setWindowMargin(struct hg3dclass_struct * window_c, struct hg3dclass_struct * margin_c); + #endif diff --git a/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h b/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h index 9143643..83a66bd 100644 --- a/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h @@ -49,5 +49,12 @@ class HG3DWindowStaticFunctions static CEGUI::UDim* getWindowWidth(const CEGUI::Window* window); static CEGUI::UDim* getWindowHeight(const CEGUI::Window* window); + + // utility function to set new window positions + static void setNewWindowSize(CEGUI::System* system, float width, float height); + + // utility functions to get and set margin (only one parameter) + static CEGUI::UDim* getWindowMargin(const CEGUI::Window* window); + static void setWindowMargin (CEGUI::Window* window, const CEGUI::UDim* margin); }; diff --git a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs index ecad584..36daf15 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs @@ -126,3 +126,19 @@ import HGamer3D.Data.Angle { withHG3DClass* `HG3DClass' , alloca- `HG3DClass' peek*} -> `()' #} +{- function setNewWindowSize -} +{#fun cegui_hg3dwsfs_setNewWindowSize as setNewWindowSize +{ withHG3DClass* `HG3DClass' , + realToFrac `Float' , + realToFrac `Float' } -> `()' #} + +{- function getWindowMargin -} +{#fun cegui_hg3dwsfs_getWindowMargin as getWindowMargin +{ withHG3DClass* `HG3DClass' , + alloca- `HG3DClass' peek*} -> `()' #} + +{- function setWindowMargin -} +{#fun cegui_hg3dwsfs_setWindowMargin as setWindowMargin +{ withHG3DClass* `HG3DClass' , + withHG3DClass* `HG3DClass' } -> `()' #} + diff --git a/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h b/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h index ecc4cff..a08a286 100644 --- a/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h @@ -39,6 +39,7 @@ #include "ClassMultiColumnList.h" #include "ClassUDim.h" #include "ClassUVector2.h" +#include "ClassSystem.h" // @@ -92,4 +93,13 @@ void cegui_hg3dwsfs_getWindowWidth(struct hg3dclass_struct * window_c, struct hg // void cegui_hg3dwsfs_getWindowHeight(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); +// +void cegui_hg3dwsfs_setNewWindowSize(struct hg3dclass_struct * system_c, float width_c, float height_c); + +// +void cegui_hg3dwsfs_getWindowMargin(struct hg3dclass_struct * window_c, struct hg3dclass_struct * result_c); + +// +void cegui_hg3dwsfs_setWindowMargin(struct hg3dclass_struct * window_c, struct hg3dclass_struct * margin_c); + #endif diff --git a/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h b/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h index 9143643..83a66bd 100644 --- a/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h @@ -49,5 +49,12 @@ class HG3DWindowStaticFunctions static CEGUI::UDim* getWindowWidth(const CEGUI::Window* window); static CEGUI::UDim* getWindowHeight(const CEGUI::Window* window); + + // utility function to set new window positions + static void setNewWindowSize(CEGUI::System* system, float width, float height); + + // utility functions to get and set margin (only one parameter) + static CEGUI::UDim* getWindowMargin(const CEGUI::Window* window); + static void setWindowMargin (CEGUI::Window* window, const CEGUI::UDim* margin); }; diff --git a/Examples/MediaFiles/media/fonts/Batang-26.font b/Examples/MediaFiles/media/fonts/Batang-26.font index f74848d..5caf8e5 100644 --- a/Examples/MediaFiles/media/fonts/Batang-26.font +++ b/Examples/MediaFiles/media/fonts/Batang-26.font @@ -1,2 +1,2 @@ - + diff --git a/Examples/MediaFiles/media/fonts/DejaVuSans-10.font b/Examples/MediaFiles/media/fonts/DejaVuSans-10.font index 25e51b2..848f535 100644 --- a/Examples/MediaFiles/media/fonts/DejaVuSans-10.font +++ b/Examples/MediaFiles/media/fonts/DejaVuSans-10.font @@ -1,2 +1,2 @@ - + diff --git a/Examples/MediaFiles/media/fonts/fkp-16.font b/Examples/MediaFiles/media/fonts/fkp-16.font index ee97e30..a274d35 100644 --- a/Examples/MediaFiles/media/fonts/fkp-16.font +++ b/Examples/MediaFiles/media/fonts/fkp-16.font @@ -1,2 +1,2 @@ - + diff --git a/Examples/MediaFiles/media/imagesets/DriveIcons.imageset b/Examples/MediaFiles/media/imagesets/DriveIcons.imageset index 3b5ef21..2f36714 100644 --- a/Examples/MediaFiles/media/imagesets/DriveIcons.imageset +++ b/Examples/MediaFiles/media/imagesets/DriveIcons.imageset @@ -1,5 +1,5 @@ - + diff --git a/Examples/MediaFiles/media/imagesets/FairChar.imageset b/Examples/MediaFiles/media/imagesets/FairChar.imageset index 50b7a3d..cdb7cfa 100644 --- a/Examples/MediaFiles/media/imagesets/FairChar.imageset +++ b/Examples/MediaFiles/media/imagesets/FairChar.imageset @@ -1,5 +1,5 @@ - + diff --git a/Examples/MediaFiles/media/imagesets/HGamer3DLogo.imageset b/Examples/MediaFiles/media/imagesets/HGamer3DLogo.imageset index e214784..be8e6a5 100644 --- a/Examples/MediaFiles/media/imagesets/HGamer3DLogo.imageset +++ b/Examples/MediaFiles/media/imagesets/HGamer3DLogo.imageset @@ -1,5 +1,5 @@ - + diff --git a/Examples/MediaFiles/media/imagesets/OgreTray.imageset b/Examples/MediaFiles/media/imagesets/OgreTray.imageset index 39b8394..ad7ee88 100644 --- a/Examples/MediaFiles/media/imagesets/OgreTray.imageset +++ b/Examples/MediaFiles/media/imagesets/OgreTray.imageset @@ -1,5 +1,5 @@ - + diff --git a/Examples/MediaFiles/media/imagesets/TaharezLook.imageset b/Examples/MediaFiles/media/imagesets/TaharezLook.imageset index 9b4f837..ad11de8 100644 --- a/Examples/MediaFiles/media/imagesets/TaharezLook.imageset +++ b/Examples/MediaFiles/media/imagesets/TaharezLook.imageset @@ -1,5 +1,5 @@ - + diff --git a/Examples/MediaFiles/media/imagesets/Vanilla.imageset b/Examples/MediaFiles/media/imagesets/Vanilla.imageset index 3b3d72d..0e6ef39 100644 --- a/Examples/MediaFiles/media/imagesets/Vanilla.imageset +++ b/Examples/MediaFiles/media/imagesets/Vanilla.imageset @@ -1,5 +1,5 @@ - + diff --git a/Examples/MediaFiles/media/imagesets/WindowsLook.imageset b/Examples/MediaFiles/media/imagesets/WindowsLook.imageset index 708bb9c..089933b 100644 --- a/Examples/MediaFiles/media/imagesets/WindowsLook.imageset +++ b/Examples/MediaFiles/media/imagesets/WindowsLook.imageset @@ -1,5 +1,5 @@ - + diff --git a/GUI/HGamer3D/GUI/BaseAPI.hs b/GUI/HGamer3D/GUI/BaseAPI.hs index 7ae75f4..31fd0dc 100644 --- a/GUI/HGamer3D/GUI/BaseAPI.hs +++ b/GUI/HGamer3D/GUI/BaseAPI.hs @@ -82,6 +82,7 @@ module HGamer3D.GUI.BaseAPI injectWinEventToGUI, injectGUITimeDelta, + notifyDisplaySizeChanged, GUIEvent (..), registerGUIEvent, @@ -105,6 +106,7 @@ module HGamer3D.GUI.BaseAPI pAlpha, pTooltip, pAlwaysOnTop, + pMargin, pX, pY, @@ -190,6 +192,12 @@ module HGamer3D.GUI.BaseAPI toVLayout, toGridLayout, + -- ** Window Widget + GUIWindow, + window, + toWindow, + + -- ** CRUD for Form based GUIs GUIEngineData, createForm, diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs index 75daf82..78ede14 100644 --- a/GUI/HGamer3D/GUI/Internal/Base.hs +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -418,3 +418,8 @@ injectGUITimeDelta :: GUISystem -> GameTime -> IO () injectGUITimeDelta guis gtime = do CEGUISystem.injectTimePulse (guiRoot guis) ((fromIntegral . msec) gtime) return () + +notifyDisplaySizeChanged :: GUISystem -> Float -> Float -> IO () +notifyDisplaySizeChanged guis width height = do + WindowSF.setNewWindowSize (guiRoot guis) width height + return () diff --git a/GUI/HGamer3D/GUI/Internal/Form.hs b/GUI/HGamer3D/GUI/Internal/Form.hs index 9b55819..1e3d5e6 100644 --- a/GUI/HGamer3D/GUI/Internal/Form.hs +++ b/GUI/HGamer3D/GUI/Internal/Form.hs @@ -44,10 +44,15 @@ data GUIEngineDataWidget = GEDButton GUIButton | GEDRadioButton GUIRadioButton | GEDCheckBox GUICheckBox | GEDComboBox GUIComboBox + | GEDListBox GUIListBox + | GEDSpinner GUISpinner + | GEDSlider GUISlider + | GEDEditText GUIEditText data GUIEngineDataLayout = GEDHLayout GUIHLayout | GEDVLayout GUIVLayout | GEDGridLayout GUIGridLayout + | GEDWindow GUIWindow data GUIEngineData = GUIEngineData GUIEngineDataElement Form @@ -63,17 +68,23 @@ _getWidget (GEDSingleElement (GEDButton w)) = _toUndef w _getWidget (GEDSingleElement (GEDRadioButton w)) = _toUndef w _getWidget (GEDSingleElement (GEDCheckBox w)) = _toUndef w _getWidget (GEDSingleElement (GEDComboBox w)) = _toUndef w +_getWidget (GEDSingleElement (GEDListBox w)) = _toUndef w +_getWidget (GEDSingleElement (GEDSpinner w)) = _toUndef w +_getWidget (GEDSingleElement (GEDSlider w)) = _toUndef w +_getWidget (GEDSingleElement (GEDEditText w)) = _toUndef w _getWidget (GEDCombinedElement (GEDHLayout l) _) = _toUndef l _getWidget (GEDCombinedElement (GEDVLayout l) _) = _toUndef l _getWidget (GEDCombinedElement (GEDGridLayout l) _) = _toUndef l +_getWidget (GEDCombinedElement (GEDWindow l) _) = _toUndef l -_createLayout :: GUISystem -> Layout -> IO GUIEngineDataLayout -_createLayout guis layout = do +_createLayout :: GUISystem -> Layout -> String -> IO GUIEngineDataLayout +_createLayout guis layout typename = do case layout of - Layout VerticalLayout props -> vLayout guis "Taharez" (_createLayoutProps props) >>= return . GEDVLayout - Layout HorizontalLayout props -> hLayout guis "Taharez" (_createLayoutProps props) >>= return . GEDHLayout - Layout (GridLayout x y) props -> gridLayout guis "Taharez" (_createLayoutProps props) >>= return . GEDGridLayout + VerticalLayout props -> vLayout guis (_createProps props) >>= return . GEDVLayout + HorizontalLayout props -> hLayout guis (_createProps props) >>= return . GEDHLayout + GridLayout x y props -> gridLayout guis (_createProps props) >>= return . GEDGridLayout + Window name props -> window guis typename (_createProps props) >>= return . GEDWindow _createProps :: [WidgetProperty] -> [GUIElement a -> IO ()] _createProps props = @@ -85,39 +96,39 @@ _createProps props = Visible v -> pVisible =: v Alpha f -> pAlpha =: f Text t -> pText =: t + Margin m -> pMargin =: m + Tooltip t -> pTooltip =: t +-- MaxSize w h -> pMaxSize =: (w, h) +-- MinSize w h -> pMinSize =: (w, h) in map oneProp props -_createLayoutProps :: [LayoutParameter] -> [GUIElement a -> IO ()] -_createLayoutProps paras = - - let onePara para = case para of - (WP widgetProperty) -> Just (head (_createProps [widgetProperty])) - _ -> Nothing - in map fromJust (filter isJust (map onePara paras)) - -_createWidget :: GUISystem -> Widget -> IO GUIEngineDataElement -_createWidget guis widget = do +_createWidget :: GUISystem -> Widget -> String -> IO GUIEngineDataElement +_createWidget guis widget typename = do case widget of - Widget name Button val props -> button guis "TaharezLook" (_createProps props) >>= return . GEDSingleElement . GEDButton - Widget name RadioButton val props -> radioButton guis "TaharezLook" (_createProps props) >>= return . GEDSingleElement . GEDRadioButton - Widget name CheckBox val props -> checkBox guis "TaharezLook" (_createProps props) >>= return . GEDSingleElement . GEDCheckBox - Widget name ComboBox val props -> comboBox guis "TaharezLook" (_createProps props) >>= return . GEDSingleElement . GEDComboBox - + Button name props -> button guis typename (_createProps props) >>= return . GEDSingleElement . GEDButton + RadioButton name val props -> radioButton guis typename (_createProps props) >>= return . GEDSingleElement . GEDRadioButton + CheckBox name val props -> checkBox guis typename (_createProps props) >>= return . GEDSingleElement . GEDCheckBox + ComboBox name val props -> comboBox guis typename (_createProps props) >>= return . GEDSingleElement . GEDComboBox + ListBox name val props -> listBox guis typename (_createProps props) >>= return . GEDSingleElement . GEDListBox + Spinner name val props -> spinner guis typename (_createProps props) >>= return . GEDSingleElement . GEDSpinner + Slider name val props -> slider guis typename (_createProps props) >>= return . GEDSingleElement . GEDSlider + EditText name val props -> editText guis typename (_createProps props) >>= return . GEDSingleElement . GEDEditText + createForm :: GUISystem -> Form -> IO GUIEngineData createForm guis form = do - let (Form typename formelement) = form + let (Form typename formcontent) = form - let createFormElement formelement = do - case formelement of - WidgetFE widget -> _createWidget guis widget - LayoutFE layout formList -> do - layoutW <- _createLayout guis layout - widgetsW <- mapM createFormElement formList + let createFormContent formcontent = do + case formcontent of + WidgetFC widget -> _createWidget guis widget typename + LayoutFC layout formList -> do + layoutW <- _createLayout guis layout typename + widgetsW <- mapM createFormContent formList let cl = GEDCombinedElement layoutW widgetsW mapM (\f -> addChildGuiEl (_getWidget cl) (_getWidget f)) widgetsW return $ cl - formW <- createFormElement formelement + formW <- createFormContent formcontent addGuiElToDisplay guis (_getWidget formW) return $ GUIEngineData formW form diff --git a/GUI/HGamer3D/GUI/Internal/Properties.hs b/GUI/HGamer3D/GUI/Internal/Properties.hs index b8ebec8..9ec346c 100644 --- a/GUI/HGamer3D/GUI/Internal/Properties.hs +++ b/GUI/HGamer3D/GUI/Internal/Properties.hs @@ -172,6 +172,20 @@ pHeight = (getProp, setProp) where Ud.delete ud return () +pMargin :: GUIElementProperty a GUIDim +pMargin = (getProp, setProp) where + getProp (GUIElement window _) = do + ud <- WinStat.getWindowMargin window + scale <- WinStat.udScale ud + offset <- WinStat.udOffset ud + Ud.delete ud + return $ GUIDim scale offset + setProp (GUIElement window _) (GUIDim scale offset) = do + ud <- Ud.new scale offset + WinStat.setWindowMargin window ud + Ud.delete ud + return () + pSelected :: GUIHasSelectionProperty a Bool pSelected = _boolProp "Selected" diff --git a/GUI/HGamer3D/GUI/Internal/Widgets.hs b/GUI/HGamer3D/GUI/Internal/Widgets.hs index b1c4d47..a213a88 100644 --- a/GUI/HGamer3D/GUI/Internal/Widgets.hs +++ b/GUI/HGamer3D/GUI/Internal/Widgets.hs @@ -160,8 +160,8 @@ _createElement elType convFunc guis style proplist = do setP el proplist return el -_createElement' :: String -> (GUIElement a -> IO (GUIElement b)) -> GUISystem -> String -> [GUIElement b -> IO ()] -> IO (GUIElement b) -_createElement' elType convFunc guis style proplist = do +_createElement' :: String -> (GUIElement a -> IO (GUIElement b)) -> GUISystem -> [GUIElement b -> IO ()] -> IO (GUIElement b) +_createElement' elType convFunc guis proplist = do let winMgr = guiWindowManager guis let uname = guiUniqueName guis elName <- nextUniqueName uname @@ -181,7 +181,7 @@ checkBox :: GUISystem -> String -> [GUICheckBox -> IO ()] -> IO GUICheckBox checkBox = _createElement "Checkbox" toCheckBox editText :: GUISystem -> String -> [GUIEditText -> IO ()] -> IO GUIEditText -editText = _createElement "EditText" toEditText +editText = _createElement "Editbox" toEditText comboBox :: GUISystem -> String -> [GUIComboBox -> IO ()] -> IO GUIComboBox comboBox = _createElement "Combobox" toComboBox @@ -198,13 +198,13 @@ slider = _createElement "Slider" toSlider window :: GUISystem -> String -> [GUIWindow -> IO ()] -> IO GUIWindow window = _createElement "FrameWindow" toWindow -hLayout :: GUISystem -> String -> [GUIHLayout -> IO ()] -> IO GUIHLayout +hLayout :: GUISystem -> [GUIHLayout -> IO ()] -> IO GUIHLayout hLayout = _createElement' "HorizontalLayoutContainer" toHLayout -vLayout :: GUISystem -> String -> [GUIVLayout -> IO ()] -> IO GUIVLayout +vLayout :: GUISystem -> [GUIVLayout -> IO ()] -> IO GUIVLayout vLayout = _createElement' "VerticalLayoutContainer" toVLayout -gridLayout :: GUISystem -> String -> [GUIGridLayout -> IO ()] -> IO GUIGridLayout +gridLayout :: GUISystem -> [GUIGridLayout -> IO ()] -> IO GUIGridLayout gridLayout = _createElement' "GridLayoutContainer" toGridLayout toButton = toGuiType "Button" GEButton diff --git a/GUI/HGamer3D/GUI/Schema/Form.hs b/GUI/HGamer3D/GUI/Schema/Form.hs index bb8a641..66bead2 100644 --- a/GUI/HGamer3D/GUI/Schema/Form.hs +++ b/GUI/HGamer3D/GUI/Schema/Form.hs @@ -29,9 +29,9 @@ import HGamer3D.GUI.Schema.GUIDim import HGamer3D.GUI.Schema.Widget import HGamer3D.GUI.Schema.Layout -data Form = Form String FormElement deriving (Eq, Show, Typeable) +data Form = Form String FormContent deriving (Eq, Show, Typeable) -data FormElement = WidgetFE Widget - | LayoutFE Layout [FormElement] +data FormContent = WidgetFC Widget + | LayoutFC Layout [FormContent] deriving (Eq, Show, Typeable) diff --git a/GUI/HGamer3D/GUI/Schema/Layout.hs b/GUI/HGamer3D/GUI/Schema/Layout.hs index 6c16ed3..34745e6 100644 --- a/GUI/HGamer3D/GUI/Schema/Layout.hs +++ b/GUI/HGamer3D/GUI/Schema/Layout.hs @@ -28,19 +28,11 @@ import HGamer3D.Data as Dat import HGamer3D.GUI.Schema.GUIDim import HGamer3D.GUI.Schema.Widget -data Layout = Layout LayoutType [LayoutParameter] +data Layout = VerticalLayout [WidgetProperty] + | HorizontalLayout [WidgetProperty] + | GridLayout Int Int [WidgetProperty] + | Window String [WidgetProperty] deriving (Eq, Show, Typeable) -data LayoutType = VerticalLayout - | HorizontalLayout - | GridLayout Int Int -- ^ x y dimensions of grid units - deriving (Eq, Show, Typeable) - -data LayoutParameter = VerticalSpace Float - | HorizontalSpace Float - | WP WidgetProperty - | MaxSize GUIDim GUIDim - | MinSize GUIDim GUIDim - deriving (Eq, Show, Typeable) diff --git a/GUI/HGamer3D/GUI/Schema/Widget.hs b/GUI/HGamer3D/GUI/Schema/Widget.hs index 321ec51..a387ffd 100644 --- a/GUI/HGamer3D/GUI/Schema/Widget.hs +++ b/GUI/HGamer3D/GUI/Schema/Widget.hs @@ -27,21 +27,16 @@ import Data.Typeable import HGamer3D.Data as Dat import HGamer3D.GUI.Schema.GUIDim -type WidgetName = String - -- | The data to specify a widget -data Widget = Widget WidgetName WidgetType WidgetValue [WidgetProperty] deriving (Eq, Show, Typeable) - --- | Widget Types -data WidgetType = Button - | RadioButton - | CheckBox - | ComboBox - | ListBox - | EditText - | Spinner - | Slider - deriving (Eq, Show, Typeable) +data Widget = Button String [WidgetProperty] + | RadioButton String Bool [WidgetProperty] + | CheckBox String Bool [WidgetProperty] + | ComboBox String [String] [WidgetProperty] + | ListBox String [String] [WidgetProperty] + | EditText String String [WidgetProperty] + | Spinner String Float [WidgetProperty] + | Slider String Float [WidgetProperty] + deriving (Eq, Show, Typeable) -- | Widget Properties data WidgetProperty = XPos GUIDim @@ -50,14 +45,11 @@ data WidgetProperty = XPos GUIDim | Height GUIDim | Visible Bool | Alpha Float - | Choice [String] | Text String + | Margin GUIDim + | Tooltip String +-- | MaxSize GUIDim GUIDim +-- | MinSize GUIDim GUIDim deriving (Eq, Show, Typeable) --- | The editable value a widget represents -data WidgetValue = TextValue String - | FloatValue Float - | BoolValue Bool - | StringListValue [String] - deriving (Eq, Show, Typeable) diff --git a/Main/HGamer3D/Engine/Internal/Event.hs b/Main/HGamer3D/Engine/Internal/Event.hs index 613013a..ae756e6 100644 --- a/Main/HGamer3D/Engine/Internal/Event.hs +++ b/Main/HGamer3D/Engine/Internal/Event.hs @@ -32,14 +32,15 @@ import Data.Dynamic data AudioEvent = PlaySound String | StopSound String +{- data GUIElementEvent = GELSetValue W.WidgetValue | GELSetProperty W.WidgetProperty | GELValueChange W.WidgetValue | GELButtonClick - +-} data HG3DEvent = WindowEvt SDLEvent | GUIEvt GUIEvent -- ^ Low level GUI evts - | GELEvt W.WidgetName GUIElementEvent -- ^ High level GUI evts +-- | GELEvt W.WidgetName GUIElementEvent -- ^ High level GUI evts | AudioEvt AudioEvent | UserEvt Dynamic diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index 333805c..81104f0 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -213,12 +213,15 @@ instance System ECSGraphics3D where ) inList - -- send camera resize events + -- send camera resize events, set gui size let camEvts = filter (\evt -> case evt of (E.WindowEvt (WinEvt.EvtWindow _ _ WinEvt.SDL_WINDOWEVENT_SIZE_CHANGED x y)) -> True _ -> False) evts - camList <- readIORef (lacList (cameras ecsg3d)) - mapM (\cam -> _pushU2CEvents (snd cam) camEvts) camList + if length camEvts > 0 then do + camList <- readIORef (lacList (cameras ecsg3d)) + mapM (\cam -> _pushU2CEvents (snd cam) camEvts) camList + mapM (\(E.WindowEvt (WinEvt.EvtWindow _ _ WinEvt.SDL_WINDOWEVENT_SIZE_CHANGED x y)) -> GU.notifyDisplaySizeChanged guis (fromIntegral x) (fromIntegral y)) camEvts + else return [()] return (ecsg3d, qFlag) From 0fdb59c1f220ffa7b5cd765f996ef6cb25035bc3 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Fri, 25 Jul 2014 09:05:30 +0200 Subject: [PATCH 15/28] additional GUI functionality --- GUI/HGamer3D/GUI/BaseAPI.hs | 10 ++ GUI/HGamer3D/GUI/Internal/Base.hs | 16 ++++ GUI/HGamer3D/GUI/Internal/Form.hs | 117 +++++++++++++++++++----- GUI/HGamer3D/GUI/Internal/Properties.hs | 26 ++++-- GUI/HGamer3D/GUI/Internal/Widgets.hs | 24 ++++- GUI/HGamer3D/GUI/Schema/Form.hs | 6 ++ GUI/HGamer3D/GUI/Schema/Widget.hs | 1 + Main/HGamer3D/Engine/Internal/Event.hs | 2 + 8 files changed, 166 insertions(+), 36 deletions(-) diff --git a/GUI/HGamer3D/GUI/BaseAPI.hs b/GUI/HGamer3D/GUI/BaseAPI.hs index 31fd0dc..feba1f5 100644 --- a/GUI/HGamer3D/GUI/BaseAPI.hs +++ b/GUI/HGamer3D/GUI/BaseAPI.hs @@ -115,6 +115,9 @@ module HGamer3D.GUI.BaseAPI pSelected, pValue, + + pTextSelection, + pTextChoice, -- * Widget Specific Types, Functions and Properties @@ -147,6 +150,12 @@ module HGamer3D.GUI.BaseAPI toEditText, findEditText, + -- ** MultilineText Widget + GUIMultilineText, + multilineText, + toMultilineText, + findMultilineText, + -- ** Listbox/Combobox Widget GUIListBox, GUIComboBox, @@ -166,6 +175,7 @@ module HGamer3D.GUI.BaseAPI comboboxAddText, comboboxRemoveAllText, + comboboxStatus, -- ** Slider/Spinner Widget GUISlider, diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs index 78ede14..89012d1 100644 --- a/GUI/HGamer3D/GUI/Internal/Base.hs +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -97,6 +97,7 @@ data GEButton = GEButton data GERadioButton = GERadioButton data GECheckBox = GECheckBox data GEEditText = GEEditText +data GEMultilineText = GEMultilineText data GEListBox = GEListBox data GEComboBox = GEComboBox @@ -403,6 +404,9 @@ registerGUIEvent guis (GUIElement el _) eventToRegister registrationTag = do data GUIEvent = GUIEvent String String (GUIElement ()) +instance Show GUIEvent where + show (GUIEvent str1 str2 _) = "GUI Event - " ++ str1 ++ " " ++ str2 + pollGUIEvent :: GUISystem -> IO (Maybe GUIEvent) pollGUIEvent guis = do let eventController = guiEventController guis @@ -423,3 +427,15 @@ notifyDisplaySizeChanged :: GUISystem -> Float -> Float -> IO () notifyDisplaySizeChanged guis width height = do WindowSF.setNewWindowSize (guiRoot guis) width height return () + +type GUIElementProperty a b = (GUIElement a -> IO b, GUIElement a -> b -> IO ()) + +(=:) :: (GUIElementProperty a b) -> b -> (GUIElement a -> IO ()) +(=:) prop val = (\val' guiel -> (snd prop) guiel val') val + +setP :: GUIElement a -> [GUIElement a -> IO ()] -> IO [()] +setP guiel ps = sequence $ fmap (\f -> f guiel) ps + +getP :: GUIElement a -> GUIElementProperty a b -> IO b +getP guiel p = (fst p) guiel + diff --git a/GUI/HGamer3D/GUI/Internal/Form.hs b/GUI/HGamer3D/GUI/Internal/Form.hs index 1e3d5e6..dada6e2 100644 --- a/GUI/HGamer3D/GUI/Internal/Form.hs +++ b/GUI/HGamer3D/GUI/Internal/Form.hs @@ -34,20 +34,22 @@ import HGamer3D.GUI.Schema.Form import HGamer3D.GUI.Schema.GUIDim import Data.Maybe +import Control.Monad {- ---------------------------------------------------------------- Functions for ECS API ---------------------------------------------------------------- -} -data GUIEngineDataWidget = GEDButton GUIButton - | GEDRadioButton GUIRadioButton - | GEDCheckBox GUICheckBox - | GEDComboBox GUIComboBox - | GEDListBox GUIListBox - | GEDSpinner GUISpinner - | GEDSlider GUISlider - | GEDEditText GUIEditText +data GUIEngineDataWidget = GEDButton GUIButton String + | GEDRadioButton GUIRadioButton String + | GEDCheckBox GUICheckBox String + | GEDComboBox GUIComboBox String + | GEDListBox GUIListBox String + | GEDSpinner GUISpinner String + | GEDSlider GUISlider String + | GEDEditText GUIEditText String + | GEDMultilineText GUIMultilineText String data GUIEngineDataLayout = GEDHLayout GUIHLayout | GEDVLayout GUIVLayout @@ -64,14 +66,15 @@ _toUndef :: GUIElement a -> GUIElement b _toUndef (GUIElement window _) = (GUIElement window undefined) _getWidget :: GUIEngineDataElement -> GUIElement a -_getWidget (GEDSingleElement (GEDButton w)) = _toUndef w -_getWidget (GEDSingleElement (GEDRadioButton w)) = _toUndef w -_getWidget (GEDSingleElement (GEDCheckBox w)) = _toUndef w -_getWidget (GEDSingleElement (GEDComboBox w)) = _toUndef w -_getWidget (GEDSingleElement (GEDListBox w)) = _toUndef w -_getWidget (GEDSingleElement (GEDSpinner w)) = _toUndef w -_getWidget (GEDSingleElement (GEDSlider w)) = _toUndef w -_getWidget (GEDSingleElement (GEDEditText w)) = _toUndef w +_getWidget (GEDSingleElement (GEDButton w _)) = _toUndef w +_getWidget (GEDSingleElement (GEDRadioButton w _)) = _toUndef w +_getWidget (GEDSingleElement (GEDCheckBox w _)) = _toUndef w +_getWidget (GEDSingleElement (GEDComboBox w _)) = _toUndef w +_getWidget (GEDSingleElement (GEDListBox w _)) = _toUndef w +_getWidget (GEDSingleElement (GEDSpinner w _)) = _toUndef w +_getWidget (GEDSingleElement (GEDSlider w _)) = _toUndef w +_getWidget (GEDSingleElement (GEDEditText w _)) = _toUndef w +_getWidget (GEDSingleElement (GEDMultilineText w _)) = _toUndef w _getWidget (GEDCombinedElement (GEDHLayout l) _) = _toUndef l _getWidget (GEDCombinedElement (GEDVLayout l) _) = _toUndef l @@ -105,14 +108,52 @@ _createProps props = _createWidget :: GUISystem -> Widget -> String -> IO GUIEngineDataElement _createWidget guis widget typename = do case widget of - Button name props -> button guis typename (_createProps props) >>= return . GEDSingleElement . GEDButton - RadioButton name val props -> radioButton guis typename (_createProps props) >>= return . GEDSingleElement . GEDRadioButton - CheckBox name val props -> checkBox guis typename (_createProps props) >>= return . GEDSingleElement . GEDCheckBox - ComboBox name val props -> comboBox guis typename (_createProps props) >>= return . GEDSingleElement . GEDComboBox - ListBox name val props -> listBox guis typename (_createProps props) >>= return . GEDSingleElement . GEDListBox - Spinner name val props -> spinner guis typename (_createProps props) >>= return . GEDSingleElement . GEDSpinner - Slider name val props -> slider guis typename (_createProps props) >>= return . GEDSingleElement . GEDSlider - EditText name val props -> editText guis typename (_createProps props) >>= return . GEDSingleElement . GEDEditText + Button name props -> do + w <- button guis typename (_createProps props) + registerGUIEvent guis w "Clicked" name + return (GEDSingleElement (GEDButton w name)) + RadioButton name val props -> do + w <- radioButton guis typename (_createProps props) + setP w [pSelected =: val] + registerGUIEvent guis w "SelectStateChanged" name + return (GEDSingleElement (GEDRadioButton w name)) + CheckBox name val props -> do + w <- checkBox guis typename (_createProps props) + setP w [pSelected =: val] + registerGUIEvent guis w "CheckStateChanged" name + return (GEDSingleElement (GEDCheckBox w name)) + ComboBox name val props -> do + w <- comboBox guis typename (_createProps props) + mapM (comboboxAddText w) val + registerGUIEvent guis w "ListSelectionAccepted" name + return (GEDSingleElement (GEDComboBox w name)) + ListBox name val props -> do + w <- listBox guis typename (_createProps props) + mapM (listboxAddText w) val + registerGUIEvent guis w "ItemSelectionChanged" name + return (GEDSingleElement (GEDListBox w name)) + Spinner name val props -> do + w <- spinner guis typename (_createProps props) + setP w [pValue =: val] + registerGUIEvent guis w "ValueChanged" name + return (GEDSingleElement (GEDSpinner w name)) + Slider name val props -> do + w <- slider guis typename (_createProps props) + setP w [pValue =: val] + registerGUIEvent guis w "ValueChanged" name + return (GEDSingleElement (GEDSlider w name)) + EditText name val props -> do + w <- editText guis typename (_createProps props) + setP w [pText =: val] + registerGUIEvent guis w "TextAccepted" name + registerGUIEvent guis w "TextChanged" name + return (GEDSingleElement (GEDEditText w name)) + MultilineText name val props -> do + w <- multilineText guis typename (_createProps props) + setP w [pText =: val] + registerGUIEvent guis w "TextAccepted" name + registerGUIEvent guis w "TextChanged" name + return (GEDSingleElement (GEDMultilineText w name)) createForm :: GUISystem -> Form -> IO GUIEngineData createForm guis form = do @@ -132,6 +173,34 @@ createForm guis form = do addGuiElToDisplay guis (_getWidget formW) return $ GUIEngineData formW form +getFormValues :: GUIEngineData -> IO [(String, FormValue)] +getFormValues (GUIEngineData elem form) = do + + let addTo oldList n con = return . (flip (:)) oldList . (,) n . con + + let getItem oldList eitem = case eitem of + GEDSingleElement widget -> case widget of + GEDButton w n -> return oldList + GEDRadioButton w n -> getP w pSelected >>= addTo oldList n FVB + GEDCheckBox w n -> getP w pSelected >>= addTo oldList n FVB + GEDComboBox w n -> getP w pText >>= addTo oldList n FVS + GEDListBox w n -> getP w pTextSelection >>= addTo oldList n FVTS + GEDSpinner w n -> getP w pValue >>= addTo oldList n FVF + GEDSlider w n -> getP w pValue >>= addTo oldList n FVF + GEDEditText w n -> getP w pText >>= addTo oldList n FVS + GEDMultilineText w n -> getP w pText >>= addTo oldList n FVS + + let foldEitems oldList eitem = case eitem of + GEDSingleElement widget -> getItem oldList eitem + GEDCombinedElement _ widgetList -> foldM foldEitems oldList widgetList + + foldEitems [] elem + +--setFormValues :: GUIEngineData -> [(String, FormValue)] -> IO () +--setFormValues (GUIEngineData elem form) valueList = do + + + removeForm :: GUISystem -> GUIEngineData -> IO () removeForm guis form = do return () diff --git a/GUI/HGamer3D/GUI/Internal/Properties.hs b/GUI/HGamer3D/GUI/Internal/Properties.hs index 9ec346c..ecf30a3 100644 --- a/GUI/HGamer3D/GUI/Internal/Properties.hs +++ b/GUI/HGamer3D/GUI/Internal/Properties.hs @@ -33,14 +33,15 @@ import HGamer3D.Data import HGamer3D.Util import HGamer3D.GUI.Internal.Base ---import HGamer3D.GUI.Internal.Widgets +import HGamer3D.GUI.Internal.Widgets + import HGamer3D.Data.HG3DClass import qualified HGamer3D.Bindings.CEGUI.ClassHG3DWindowStaticFunctions as WinStat import qualified HGamer3D.Bindings.CEGUI.ClassWindow as Win import qualified HGamer3D.Bindings.CEGUI.ClassUDim as Ud import HGamer3D.GUI.Schema.GUIDim -type GUIElementProperty a b = (GUIElement a -> IO b, GUIElement a -> b -> IO ()) + type GUIButtonProperty b = GUIElementProperty GEButton b type GUIEditTextProperty b = GUIElementProperty GEEditText b @@ -52,14 +53,8 @@ type GUIHasValueProperty a b = GUIElementProperty a b type GUISliderProperty b = GUIHasValueProperty GESlider b type GUISpinnerProperty b = GUIHasValueProperty GESpinner b -(=:) :: (GUIElementProperty a b) -> b -> (GUIElement a -> IO ()) -(=:) prop val = (\val' guiel -> (snd prop) guiel val') val - -setP :: GUIElement a -> [GUIElement a -> IO ()] -> IO [()] -setP guiel ps = sequence $ fmap (\f -> f guiel) ps - -getP :: GUIElement a -> GUIElementProperty a b -> IO b -getP guiel p = (fst p) guiel +type GUIListBoxProperty b = GUIElementProperty GEListBox b +type GUIComboBoxProperty b = GUIElementProperty GEComboBox b _stringProp :: String -> GUIElementProperty a String _stringProp name = ( @@ -192,4 +187,15 @@ pSelected = _boolProp "Selected" pValue :: GUIHasValueProperty a Float pValue = _floatProp "CurrentValue" +pTextSelection :: GUIListBoxProperty [(String, Bool)] +pTextSelection = (listboxStatus, listboxInitialize) + +pTextChoice :: GUIComboBoxProperty [String] +pTextChoice = (getProp, setProp) where + setProp w strings = do + comboboxRemoveAllText w + mapM (comboboxAddText w) strings + return () + getProp w = do + comboboxStatus w diff --git a/GUI/HGamer3D/GUI/Internal/Widgets.hs b/GUI/HGamer3D/GUI/Internal/Widgets.hs index a213a88..7c275ea 100644 --- a/GUI/HGamer3D/GUI/Internal/Widgets.hs +++ b/GUI/HGamer3D/GUI/Internal/Widgets.hs @@ -79,7 +79,7 @@ import HGamer3D.Bindings.CEGUI.ClassHG3DEventStaticFunctions as EvtSF import HGamer3D.Bindings.CEGUI.EnumMouseButton as CEGUIButton import HGamer3D.GUI.Internal.Base -import HGamer3D.GUI.Internal.Properties +-- import HGamer3D.GUI.Internal.Properties import HGamer3D.Data.HG3DClass import qualified HGamer3D.GUI.Schema.Widget as ScW @@ -101,6 +101,9 @@ type GUIRadioButton = GUIHasSelection GERadioButton -- | GUI Element, Sybtype EditText type GUIEditText = GUIElement GEEditText +-- | GUI Element, Sybtype MultilineText +type GUIMultilineText = GUIElement GEMultilineText + -- | GUI Element, Sybtype Listbox type GUIListBox = GUIElement GEListBox @@ -183,6 +186,9 @@ checkBox = _createElement "Checkbox" toCheckBox editText :: GUISystem -> String -> [GUIEditText -> IO ()] -> IO GUIEditText editText = _createElement "Editbox" toEditText +multilineText :: GUISystem -> String -> [GUIMultilineText -> IO ()] -> IO GUIMultilineText +multilineText = _createElement "MultiLineEditbox" toMultilineText + comboBox :: GUISystem -> String -> [GUIComboBox -> IO ()] -> IO GUIComboBox comboBox = _createElement "Combobox" toComboBox @@ -211,7 +217,8 @@ toButton = toGuiType "Button" GEButton toRadioButton = toGuiType "RadioButton" GERadioButton toCheckBox = toGuiType "Checkbox" GECheckBox -toEditText = toGuiType "EditText" GEEditText +toEditText = toGuiType "Editbox" GEEditText +toMultilineText = toGuiType "MultiLineEditbox" GEMultilineText toComboBox = toGuiType "Combobox" GEComboBox toListBox = toGuiType "Listbox" GEListBox @@ -237,6 +244,7 @@ findButton = findElement toButton findRadioButton = findElement toRadioButton findCheckBox = findElement toCheckBox findEditText = findElement toEditText +findMultilineText = findElement toMultilineText findComboBox = findElement toComboBox findListBox = findElement toListBox findSpinner = findElement toSpinner @@ -257,6 +265,18 @@ comboboxRemoveAllText (GUIElement window GEComboBox) = do realcombo <- WindowSF.castWindowToCombobox window Combobox.resetList realcombo +comboboxStatus :: GUIComboBox -- ^ GUI element, needs to be a listbox + -> IO [String] -- ^ list of entry, selected pairs +comboboxStatus (GUIElement window GEComboBox) = do + realbox <- WindowSF.castWindowToCombobox window + count <- Combobox.getItemCount realbox + outlist <- mapM ( \ind -> do + item <- Combobox.getListboxItemFromIndex realbox ind + txt <- ListboxItem.getText item + return txt + ) [0..(count-1)] + return outlist + -- | add one line of text as a selectable entry to a listbox listboxAddText :: GUIListBox -- ^ GUI element, needs to be a listbox -> String -- ^ the entry string to add diff --git a/GUI/HGamer3D/GUI/Schema/Form.hs b/GUI/HGamer3D/GUI/Schema/Form.hs index 66bead2..a65a662 100644 --- a/GUI/HGamer3D/GUI/Schema/Form.hs +++ b/GUI/HGamer3D/GUI/Schema/Form.hs @@ -35,3 +35,9 @@ data FormContent = WidgetFC Widget | LayoutFC Layout [FormContent] deriving (Eq, Show, Typeable) +data FormValue = FVF Float + | FVS String + | FVTC [String] -- Text Choice + | FVTS [(String, Bool)] -- Text Selection + | FVB Bool + deriving (Eq, Show, Typeable) diff --git a/GUI/HGamer3D/GUI/Schema/Widget.hs b/GUI/HGamer3D/GUI/Schema/Widget.hs index a387ffd..b0bac32 100644 --- a/GUI/HGamer3D/GUI/Schema/Widget.hs +++ b/GUI/HGamer3D/GUI/Schema/Widget.hs @@ -34,6 +34,7 @@ data Widget = Button String [WidgetProperty] | ComboBox String [String] [WidgetProperty] | ListBox String [String] [WidgetProperty] | EditText String String [WidgetProperty] + | MultilineText String String [WidgetProperty] | Spinner String Float [WidgetProperty] | Slider String Float [WidgetProperty] deriving (Eq, Show, Typeable) diff --git a/Main/HGamer3D/Engine/Internal/Event.hs b/Main/HGamer3D/Engine/Internal/Event.hs index ae756e6..694f0fe 100644 --- a/Main/HGamer3D/Engine/Internal/Event.hs +++ b/Main/HGamer3D/Engine/Internal/Event.hs @@ -31,6 +31,7 @@ import Data.Dynamic data AudioEvent = PlaySound String | StopSound String + deriving (Show) {- data GUIElementEvent = GELSetValue W.WidgetValue @@ -43,6 +44,7 @@ data HG3DEvent = WindowEvt SDLEvent -- | GELEvt W.WidgetName GUIElementEvent -- ^ High level GUI evts | AudioEvt AudioEvent | UserEvt Dynamic + deriving (Show) From c6fa9e6c7517c2e78009e86c00757ad05512b1be Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Sat, 26 Jul 2014 15:40:24 +0200 Subject: [PATCH 16/28] GUI now with update of single properties --- GUI/HGamer3D/GUI/BaseAPI.hs | 4 + GUI/HGamer3D/GUI/Internal/Base.hs | 9 + GUI/HGamer3D/GUI/Internal/Form.hs | 209 +++++++++++++++--- GUI/HGamer3D/GUI/Schema/Widget.hs | 22 +- .../HGamer3D/Graphics3D/Internal/Shapes.hs | 201 ----------------- 5 files changed, 204 insertions(+), 241 deletions(-) diff --git a/GUI/HGamer3D/GUI/BaseAPI.hs b/GUI/HGamer3D/GUI/BaseAPI.hs index feba1f5..9440adb 100644 --- a/GUI/HGamer3D/GUI/BaseAPI.hs +++ b/GUI/HGamer3D/GUI/BaseAPI.hs @@ -71,6 +71,7 @@ module HGamer3D.GUI.BaseAPI disableGuiEl, activateGuiEl, deactivateGuiEl, + deleteGuiEl, showGuiEl, hideGuiEl, @@ -213,6 +214,9 @@ module HGamer3D.GUI.BaseAPI createForm, updateForm, removeForm, + + getFormValues, + setFormValues ) where diff --git a/GUI/HGamer3D/GUI/Internal/Base.hs b/GUI/HGamer3D/GUI/Internal/Base.hs index 89012d1..f82f11b 100644 --- a/GUI/HGamer3D/GUI/Internal/Base.hs +++ b/GUI/HGamer3D/GUI/Internal/Base.hs @@ -33,6 +33,7 @@ import HGamer3D.Bindings.CEGUI.ClassResourceProvider as CEGUIResourceProvider import HGamer3D.Bindings.CEGUI.ClassDefaultResourceProvider as CEGUIDefaultResourceProvider import HGamer3D.Bindings.CEGUI.ClassImageset as CEGUIImageset import HGamer3D.Bindings.CEGUI.ClassFont as CEGUIFont +import HGamer3D.Bindings.CEGUI.ClassEventSet as EventSet import HGamer3D.Bindings.CEGUI.ClassScheme as CEGUIScheme import HGamer3D.Bindings.CEGUI.ClassWidgetLookManager as CEGUIWidgetLookManager import HGamer3D.Bindings.CEGUI.ClassScriptModule as CEGUIScriptModule @@ -168,6 +169,14 @@ deactivateGuiEl :: GUIElement a -- ^ GUI element to deactivate deactivateGuiEl (GUIElement window _) = do Window.deactivate window +-- | delete a GUI element, do not process events send to it +deleteGuiEl :: GUISystem -> GUIElement a -- ^ GUI element to deactivate + -> IO () +deleteGuiEl guis (GUIElement window _) = do + let wmgr = guiWindowManager guis + EventSet.removeAllEvents window + CEGUIWindowManager.destroyWindow wmgr window + -- | show GUI element showGuiEl :: GUIElement a -- ^ GUI element to show -> IO () diff --git a/GUI/HGamer3D/GUI/Internal/Form.hs b/GUI/HGamer3D/GUI/Internal/Form.hs index dada6e2..5c946bf 100644 --- a/GUI/HGamer3D/GUI/Internal/Form.hs +++ b/GUI/HGamer3D/GUI/Internal/Form.hs @@ -89,8 +89,20 @@ _createLayout guis layout typename = do GridLayout x y props -> gridLayout guis (_createProps props) >>= return . GEDGridLayout Window name props -> window guis typename (_createProps props) >>= return . GEDWindow -_createProps :: [WidgetProperty] -> [GUIElement a -> IO ()] -_createProps props = +-- the following routine assume same typename for new layout, it only modify props +_updateLayoutProps :: GUIEngineDataLayout -> Layout -> IO () +_updateLayoutProps edata layout = do + -- check assumptions + case (edata, layout) of + (GEDHLayout hLayout, HorizontalLayout props) -> setP hLayout (_createProps props) + (GEDVLayout vLayout, VerticalLayout props) -> setP vLayout (_createProps props) + (GEDGridLayout gLayout, GridLayout x y props) -> setP gLayout (_createProps props) + (GEDWindow window, Window n props) -> setP window (_createProps props) + _ -> error "HGamer3D.GUI.Internal.Form._updateLayoutProps: update parameters not matching!" + return () + +_createProps' :: (WidgetProperty -> GUIElement a -> IO ()) -> [WidgetProperty] -> [GUIElement a -> IO ()] +_createProps' addOn props = let oneProp prop = case prop of XPos gd -> pX =: gd YPos gd -> pY =: gd @@ -101,10 +113,39 @@ _createProps props = Text t -> pText =: t Margin m -> pMargin =: m Tooltip t -> pTooltip =: t --- MaxSize w h -> pMaxSize =: (w, h) --- MinSize w h -> pMinSize =: (w, h) + _ -> addOn prop in map oneProp props +_createProps = _createProps' (\w -> (const (return ()))) + +_createPropsCB :: [WidgetProperty] -> [GUIComboBox -> IO ()] +_createPropsCB props = + let addOn prop = case prop of + TextChoice tc -> pTextChoice =: tc + _ -> const (return ()) + in _createProps' addOn props + +_createPropsLB :: [WidgetProperty] -> [GUIListBox -> IO ()] +_createPropsLB props = + let addOn prop = case prop of + TextSelection ts -> pTextSelection =: ts + _ -> const (return ()) + in _createProps' addOn props + +_createPropsHV :: [WidgetProperty] -> [GUIHasValue a -> IO ()] +_createPropsHV props = + let addOn prop = case prop of + Value v -> pValue =: v + _ -> const (return ()) + in _createProps' addOn props + +_createPropsHS :: [WidgetProperty] -> [GUIHasSelection a -> IO ()] +_createPropsHS props = + let addOn prop = case prop of + Selected s -> pSelected =: s + _ -> const (return ()) + in _createProps' addOn props + _createWidget :: GUISystem -> Widget -> String -> IO GUIEngineDataElement _createWidget guis widget typename = do case widget of @@ -112,49 +153,56 @@ _createWidget guis widget typename = do w <- button guis typename (_createProps props) registerGUIEvent guis w "Clicked" name return (GEDSingleElement (GEDButton w name)) - RadioButton name val props -> do - w <- radioButton guis typename (_createProps props) - setP w [pSelected =: val] + RadioButton name props -> do + w <- radioButton guis typename (_createPropsHS props) registerGUIEvent guis w "SelectStateChanged" name return (GEDSingleElement (GEDRadioButton w name)) - CheckBox name val props -> do - w <- checkBox guis typename (_createProps props) - setP w [pSelected =: val] + CheckBox name props -> do + w <- checkBox guis typename (_createPropsHS props) registerGUIEvent guis w "CheckStateChanged" name return (GEDSingleElement (GEDCheckBox w name)) - ComboBox name val props -> do - w <- comboBox guis typename (_createProps props) - mapM (comboboxAddText w) val + ComboBox name props -> do + w <- comboBox guis typename (_createPropsCB props) registerGUIEvent guis w "ListSelectionAccepted" name return (GEDSingleElement (GEDComboBox w name)) - ListBox name val props -> do - w <- listBox guis typename (_createProps props) - mapM (listboxAddText w) val + ListBox name props -> do + w <- listBox guis typename (_createPropsLB props) registerGUIEvent guis w "ItemSelectionChanged" name return (GEDSingleElement (GEDListBox w name)) - Spinner name val props -> do - w <- spinner guis typename (_createProps props) - setP w [pValue =: val] + Spinner name props -> do + w <- spinner guis typename (_createPropsHV props) registerGUIEvent guis w "ValueChanged" name return (GEDSingleElement (GEDSpinner w name)) - Slider name val props -> do - w <- slider guis typename (_createProps props) - setP w [pValue =: val] + Slider name props -> do + w <- slider guis typename (_createPropsHV props) registerGUIEvent guis w "ValueChanged" name return (GEDSingleElement (GEDSlider w name)) - EditText name val props -> do + EditText name props -> do w <- editText guis typename (_createProps props) - setP w [pText =: val] registerGUIEvent guis w "TextAccepted" name registerGUIEvent guis w "TextChanged" name return (GEDSingleElement (GEDEditText w name)) - MultilineText name val props -> do + MultilineText name props -> do w <- multilineText guis typename (_createProps props) - setP w [pText =: val] registerGUIEvent guis w "TextAccepted" name registerGUIEvent guis w "TextChanged" name return (GEDSingleElement (GEDMultilineText w name)) +_updateWidgetProps :: GUIEngineDataElement -> Widget -> IO () +_updateWidgetProps edata widget = do + case (edata, widget) of + (GEDSingleElement (GEDButton w _), Button name props) -> setP w (_createProps props) + (GEDSingleElement (GEDRadioButton w _), RadioButton name props) -> setP w (_createPropsHS props) + (GEDSingleElement (GEDCheckBox w _), CheckBox name props) -> setP w (_createPropsHS props) + (GEDSingleElement (GEDComboBox w _), ComboBox name props) -> setP w (_createPropsCB props) + (GEDSingleElement (GEDListBox w _), ListBox name props) -> setP w (_createPropsLB props) + (GEDSingleElement (GEDSpinner w _), Spinner name props) -> setP w (_createPropsHV props) + (GEDSingleElement (GEDSlider w _), Slider name props) -> setP w (_createPropsHV props) + (GEDSingleElement (GEDEditText w _), EditText name props) -> setP w (_createProps props) + (GEDSingleElement (GEDMultilineText w _), MultilineText name props) -> setP w (_createProps props) + _ -> error "HGamer3D.GUI.Internal.Form._updateWidgetProps: update parameters not matching!" + return () + createForm :: GUISystem -> Form -> IO GUIEngineData createForm guis form = do let (Form typename formcontent) = form @@ -196,16 +244,117 @@ getFormValues (GUIEngineData elem form) = do foldEitems [] elem ---setFormValues :: GUIEngineData -> [(String, FormValue)] -> IO () ---setFormValues (GUIEngineData elem form) valueList = do - +_getFormStructure :: Form -> [String] +_getFormStructure (Form typename content) = + let getItem oldList eitem = case eitem of + WidgetFC widget -> case widget of + Button n _ -> ("Button/" ++ n) : oldList + RadioButton n _ -> ("RadioButton/" ++ n) : oldList + CheckBox n _ -> ("CheckBox/" ++ n) : oldList + ComboBox n _ -> ("ComboBox/" ++ n) : oldList + ListBox n _ -> ("ListBox/" ++ n) : oldList + Spinner n _ -> ("Spinner/" ++ n) : oldList + Slider n _ -> ("Slider/" ++ n) : oldList + EditText n _ -> ("EditText/" ++ n) : oldList + MultilineText n _ -> ("MultilineText/" ++ n) : oldList + LayoutFC layout itemList -> let + subList = foldl getItem [] itemList + in case layout of + VerticalLayout props -> ["VLStart"] ++ subList ++ ["VLEnd"] ++ oldList + HorizontalLayout props -> ["HLStart"] ++ subList ++ ["HLEnd"] ++ oldList + GridLayout _ _ props -> ["GridStart"] ++ subList ++ ["GridEnd"] ++ oldList + Window n props -> ["WStart"] ++ subList ++ ["WEnd"] ++ oldList + + in getItem [typename] content + + +setFormValues :: GUIEngineData -> [(String, FormValue)] -> IO () +setFormValues (GUIEngineData elem form) valueList = do + + let filterItemSet w n prop valueList = do + case filter (\(name, value) -> name == n) valueList of + [] -> return () + ((n', v') : _) -> do + setP w [prop v'] + return () + + let setItem valueList eitem = case eitem of + GEDSingleElement widget -> case widget of + GEDButton w n -> return () + GEDRadioButton w n -> filterItemSet w n (\v -> let (FVB v') = v in pSelected =: v') valueList + GEDCheckBox w n -> filterItemSet w n (\v -> let (FVB v') = v in pSelected =: v') valueList + GEDComboBox w n -> filterItemSet w n (\v -> let (FVS v') = v in pText =: v') valueList + GEDListBox w n -> filterItemSet w n (\v -> let (FVTS v') = v in pTextSelection =: v') valueList + GEDSpinner w n -> filterItemSet w n (\v -> let (FVF v') = v in pValue =: v') valueList + GEDSlider w n -> filterItemSet w n (\v -> let (FVF v') = v in pValue =: v') valueList + GEDEditText w n -> filterItemSet w n (\v -> let (FVS v') = v in pText =: v') valueList + GEDMultilineText w n -> filterItemSet w n (\v -> let (FVS v') = v in pText =: v') valueList + GEDCombinedElement _ widgetList -> mapM (setItem valueList) widgetList >> return () + + setItem valueList elem + return () removeForm :: GUISystem -> GUIEngineData -> IO () removeForm guis form = do + let (GUIEngineData elem schema) = form + + -- first detach from screen + removeGuiElFromDisplay guis (_getWidget elem) + + -- then delete the elements in order + let deleteSingleItem elem = case elem of + GEDSingleElement w -> deleteGuiEl guis (_getWidget elem) + GEDCombinedElement layout widgetList -> do + -- remove childs from parent, then delete + mapM (\el -> removeChildGuiEl (_getWidget elem) (_getWidget el)) widgetList + mapM deleteSingleItem widgetList + deleteGuiEl guis (_getWidget elem) + + deleteSingleItem elem return () + +-- update form with same structure, apply properties again for all elements, which are different +_updateFormElement :: GUISystem -> GUIEngineDataElement -> FormContent -> FormContent -> IO () +_updateFormElement guis elem oldFC newFC = do + case (elem, oldFC, newFC) of + (GEDSingleElement w, WidgetFC (Button _ oldProps), WidgetFC wid@(Button _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDSingleElement w, WidgetFC (RadioButton _ oldProps), WidgetFC wid@(RadioButton _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDSingleElement w, WidgetFC (CheckBox _ oldProps), WidgetFC wid@(CheckBox _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDSingleElement w, WidgetFC (ComboBox _ oldProps), WidgetFC wid@(ComboBox _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDSingleElement w, WidgetFC (ListBox _ oldProps), WidgetFC wid@(ListBox _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDSingleElement w, WidgetFC (Spinner _ oldProps), WidgetFC wid@(Spinner _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDSingleElement w, WidgetFC (Slider _ oldProps), WidgetFC wid@(Slider _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDSingleElement w, WidgetFC (EditText _ oldProps), WidgetFC wid@(EditText _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDSingleElement w, WidgetFC (MultilineText _ oldProps), WidgetFC wid@(MultilineText _ newProps)) -> do + if oldProps /= newProps then _updateWidgetProps elem wid else return () + (GEDCombinedElement layout elems, LayoutFC oldLayout oldContentList, LayoutFC newLayout newContentList) -> do + if oldLayout /= newLayout then _updateLayoutProps layout newLayout else return () + mapM (\(elem, oldContent, newContent) -> _updateFormElement guis elem oldContent newContent) (zip3 elems oldContentList newContentList) + return () + + + updateForm :: GUISystem -> GUIEngineData -> Form -> IO GUIEngineData updateForm guis edata form = do - return edata + -- check if different structure, then redo + let ed@(GUIEngineData elem oldForm) = edata + if (_getFormStructure oldForm) /= (_getFormStructure form) then do + removeForm guis ed + createForm guis form + -- if structure is the same, only update properties + else do + let (Form typename content) = form + let (Form typename oldContent) = oldForm + _updateFormElement guis elem oldContent content + return edata diff --git a/GUI/HGamer3D/GUI/Schema/Widget.hs b/GUI/HGamer3D/GUI/Schema/Widget.hs index b0bac32..d08dbe7 100644 --- a/GUI/HGamer3D/GUI/Schema/Widget.hs +++ b/GUI/HGamer3D/GUI/Schema/Widget.hs @@ -29,14 +29,14 @@ import HGamer3D.GUI.Schema.GUIDim -- | The data to specify a widget data Widget = Button String [WidgetProperty] - | RadioButton String Bool [WidgetProperty] - | CheckBox String Bool [WidgetProperty] - | ComboBox String [String] [WidgetProperty] - | ListBox String [String] [WidgetProperty] - | EditText String String [WidgetProperty] - | MultilineText String String [WidgetProperty] - | Spinner String Float [WidgetProperty] - | Slider String Float [WidgetProperty] + | RadioButton String [WidgetProperty] + | CheckBox String [WidgetProperty] + | ComboBox String [WidgetProperty] + | ListBox String [WidgetProperty] + | EditText String [WidgetProperty] + | MultilineText String [WidgetProperty] + | Spinner String [WidgetProperty] + | Slider String [WidgetProperty] deriving (Eq, Show, Typeable) -- | Widget Properties @@ -49,8 +49,10 @@ data WidgetProperty = XPos GUIDim | Text String | Margin GUIDim | Tooltip String --- | MaxSize GUIDim GUIDim --- | MinSize GUIDim GUIDim + | TextChoice [String] -- only ComboBox + | TextSelection [(String, Bool)] -- only ListBox + | Value Float -- only Spinner, Slider + | Selected Bool -- only CheckBox, RadioButton deriving (Eq, Show, Typeable) diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs index 51e689a..887959d 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs @@ -310,204 +310,3 @@ instance HasOrientation (Object3D Figure) where Node.setOrientation (getNode' obj) (fromNormal uq) return () -{- - --- | creates a Sphere Mesh, from which Spheres can be cloned -sphereMesh :: Mesh -- ^ the mesh created -sphereMesh = SphereMesh - --- | creates a Cube Mesh, from which Cubes can be cloned -cubeMesh :: Mesh -- ^ the mesh created -cubeMesh = CubeMesh - --- | creates a Plane Mesh, from which Planes can be cloned -planeMesh :: Mesh -- ^ the mesh created -planeMesh = PlaneMesh - --- | creates a Plane Mesh, from which Planes can be cloned -resourceMesh :: String -- ^ the name of the resource - -> Mesh -- ^ the mesh created -resourceMesh resourceName = ResourceMesh resourceName - --- | clones a 3D object from a mesh -object3DFromMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Mesh -- ^ mesh used for creation - -> Maybe Material -- ^ a material to be applied, if needed - -> Bool -- ^ flag, build tangent vectors, if set - -> IO Object3D -- ^ created 3d object -object3DFromMesh g3ds mesh mbMaterial buildTV = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - -- create the entity from the mesh - entity <- case mesh of - CubeMesh -> SceneManager.createEntity6 scm PT_CUBE - SphereMesh -> SceneManager.createEntity6 scm PT_SPHERE - PlaneMesh -> SceneManager.createEntity6 scm PT_PLANE - ResourceMesh resourceName -> SceneManager.createEntity3 scm resourceName - ManualMesh meshName -> SceneManager.createEntity3 scm meshName - -- create tangent vectors - if buildTV then - HG3DUtils.buildTangentVectors entity - else - return () - -- apply material, if needed, wanted - case mbMaterial of - Just material -> _setMaterial entity material - Nothing -> return () - -- now create node and attach entity to it - rootNode <- SceneManager.getRootSceneNode scm - let vzero = Vec3 0.0 0.0 0.0 - let qident = Q (Vec4 1.0 0.0 0.0 0.0) - node <- SceneNode.createChildSceneNode rootNode vzero qident - SceneNode.attachObject node entity - -- return object - return (SingleObject3D mesh node) - --- | combine 3D objects to a new object -object3DFromObjects :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - ->[Object3D] -- ^ A list of objects, to be grouped - -> IO Object3D -- ^ The return value is a new 3d object. -object3DFromObjects g3ds listObjects = do - let (SceneManager scm) = (g3dsSceneManager g3ds) - rootNode <- SceneManager.getRootSceneNode scm - let vzero = Vec3 0.0 0.0 0.0 - let qident = Q (Vec4 1.0 0.0 0.0 0.0) - node <- SceneNode.createChildSceneNode rootNode vzero qident - sequence_ (map ( \object -> do - let objectnode = _getNode object - parent <- Node.getParent objectnode - Node.removeChild2 parent objectnode - Node.addChild node objectnode - return () ) listObjects) - return ( CombinedObject3D listObjects node) - --- | Creates a line with a colour from start and end point (mesh as object template) -colouredLineMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Vec3 -- ^ start point - -> Vec3 -- ^ end point - -> Colour -- ^ colour - -> IO Mesh -- ^ line mesh -colouredLineMesh g3ds vStart vEnd colour = do - uid <- nextUniqueName (g3dsUniqueName g3ds) - let (SceneManager scm) = (g3dsSceneManager g3ds) - let lineName = "L" ++ uid - let meshName = "M" ++ uid - - mo <- SceneManager.createManualObject scm lineName - ManualObject.begin mo "BaseWhiteNoLighting" OT_LINE_LIST "General" - ManualObject.position mo vStart - ManualObject.colour mo colour - ManualObject.position mo vEnd - ManualObject.colour mo colour - ManualObject.end mo - ManualObject.convertToMesh mo meshName "General" - return $ ManualMesh meshName - --- |Creates a coloured cube mesh -colouredCubeMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> Colour -- ^ colour - -> IO Mesh -- ^ cube mesh -colouredCubeMesh g3ds colour = do - uid <- nextUniqueName (g3dsUniqueName g3ds) - let (SceneManager scm) = (g3dsSceneManager g3ds) - let cubeName = "C" ++ uid - let meshName = "M" ++ uid - - mo <- SceneManager.createManualObject scm cubeName - - -- basic parameters - let lsize = 1.0 - let cp = 1.0 * lsize - let cm = -1.0 * lsize - - ManualObject.begin mo "BaseWhiteNoLighting" OT_TRIANGLE_LIST "General" - - ManualObject.position2 mo cm cp cm -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cp cp cm -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cp cm cm -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cm cm cm -- a vertex - ManualObject.colour mo colour - - ManualObject.position2 mo cm cp cp -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cp cp cp -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cp cm cp -- a vertex - ManualObject.colour mo colour - ManualObject.position2 mo cm cm cp -- a vertex - ManualObject.colour mo colour - - ManualObject.triangle mo 0 1 2 - ManualObject.triangle mo 2 3 0 - ManualObject.triangle mo 4 6 5 - ManualObject.triangle mo 6 4 7 - - ManualObject.triangle mo 0 4 5 - ManualObject.triangle mo 5 1 0 - ManualObject.triangle mo 2 6 7 - ManualObject.triangle mo 7 3 2 - - ManualObject.triangle mo 0 7 4 - ManualObject.triangle mo 7 0 3 - ManualObject.triangle mo 1 5 6 - ManualObject.triangle mo 6 2 1 - - ManualObject.end mo - - ManualObject.convertToMesh mo meshName "General" - return $ ManualMesh meshName - - --- | Creates a rainbow coloured cube mesh -rainbowCubeMesh :: Graphics3DSystem -- ^ the Graphics3D system object, returned by initGraphics3D - -> IO Mesh -rainbowCubeMesh g3ds = do - uid <- nextUniqueName (g3dsUniqueName g3ds) - let (SceneManager scm) = (g3dsSceneManager g3ds) - let cubeName = "C" ++ uid - let meshName = "M" ++ uid - let materialName = "BaseWhiteNoLighting" - - mo <- SceneManager.createManualObject scm cubeName - - -- basic parameters - let lsize = 1.0 - let cp = 1.0 * lsize - let cm = -1.0 * lsize - - ManualObject.begin mo "BaseWhiteNoLighting" OT_TRIANGLE_LIST "General" - - sequence $ map (\(x, y, z, c) -> liftIO (ManualObject.position2 mo x y z) >> liftIO (ManualObject.colour mo c) ) [ - (cm, cp, cm, (Colour 0.0 1.0 0.0 1.0) ), - (cp, cp, cm, (Colour 1.0 1.0 0.0 1.0) ), - (cp, cm, cm, (Colour 1.0 0.0 0.0 1.0) ), - (cm, cm, cm, (Colour 0.0 0.0 0.0 1.0) ), - - (cm, cp, cp, (Colour 0.0 1.0 1.0 1.0) ), - (cp, cp, cp, (Colour 1.0 1.0 1.0 1.0) ), - (cp, cm, cp, (Colour 1.0 0.0 1.0 1.0) ), - (cm, cm, cp, (Colour 0.0 0.0 1.0 1.0) ) ] - - sequence $ map (\(x,y,z) -> ManualObject.triangle mo x y z) [ - (0, 1, 2), - (2, 3, 0), - (4, 6, 5), - (6, 4, 7), - - (0, 4, 5), - (5, 1, 0), - (2, 6, 7), - (7, 3, 2), - - (0, 7, 4), - (7, 0, 3), - (1, 5, 6), - (6, 2, 1) ] - - ManualObject.end mo - ManualObject.convertToMesh mo meshName "General" - return $ ManualMesh meshName - --} From e5e351395ad6dbe8388aac3981ca41aef5c048b8 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Sun, 27 Jul 2014 19:33:36 +0200 Subject: [PATCH 17/28] GUI Events and Events in general now working properly --- GUI/HGamer3D/GUI/BaseAPI.hs | 1 + GUI/HGamer3D/GUI/Internal/Form.hs | 2 +- GUI/HGamer3D/GUI/Schema/Form.hs | 1 + Main/HGamer3D.cabal | 4 +- Main/HGamer3D/Engine/BaseAPI.hs | 4 +- .../HGamer3D/Engine/Internal/ComponentType.hs | 4 +- Main/HGamer3D/Engine/Internal/Entity.hs | 3 + Main/HGamer3D/Engine/Internal/Event.hs | 16 +- Main/HGamer3D/Engine/Internal/System.hs | 32 +++- Main/HGamer3D/Engine/Internal/SystemEvent.hs | 138 +++++++++--------- .../Engine/Internal/SystemGraphics3D.hs | 34 ++++- .../{EventSender.hs => EventChannel.hs} | 4 +- Main/HGamer3D/Engine/Schema/EventReceiver.hs | 18 ++- 13 files changed, 160 insertions(+), 101 deletions(-) rename Main/HGamer3D/Engine/Schema/{EventSender.hs => EventChannel.hs} (92%) diff --git a/GUI/HGamer3D/GUI/BaseAPI.hs b/GUI/HGamer3D/GUI/BaseAPI.hs index 9440adb..c9e5dbd 100644 --- a/GUI/HGamer3D/GUI/BaseAPI.hs +++ b/GUI/HGamer3D/GUI/BaseAPI.hs @@ -74,6 +74,7 @@ module HGamer3D.GUI.BaseAPI deleteGuiEl, showGuiEl, hideGuiEl, + typeOfGuiEl, -- ** Work with File Layouts diff --git a/GUI/HGamer3D/GUI/Internal/Form.hs b/GUI/HGamer3D/GUI/Internal/Form.hs index 5c946bf..0ceb414 100644 --- a/GUI/HGamer3D/GUI/Internal/Form.hs +++ b/GUI/HGamer3D/GUI/Internal/Form.hs @@ -228,7 +228,7 @@ getFormValues (GUIEngineData elem form) = do let getItem oldList eitem = case eitem of GEDSingleElement widget -> case widget of - GEDButton w n -> return oldList + GEDButton w n -> return ( (n, FVE) : oldList) GEDRadioButton w n -> getP w pSelected >>= addTo oldList n FVB GEDCheckBox w n -> getP w pSelected >>= addTo oldList n FVB GEDComboBox w n -> getP w pText >>= addTo oldList n FVS diff --git a/GUI/HGamer3D/GUI/Schema/Form.hs b/GUI/HGamer3D/GUI/Schema/Form.hs index a65a662..2fd3678 100644 --- a/GUI/HGamer3D/GUI/Schema/Form.hs +++ b/GUI/HGamer3D/GUI/Schema/Form.hs @@ -40,4 +40,5 @@ data FormValue = FVF Float | FVTC [String] -- Text Choice | FVTS [(String, Bool)] -- Text Selection | FVB Bool + | FVE -- Empty deriving (Eq, Show, Typeable) diff --git a/Main/HGamer3D.cabal b/Main/HGamer3D.cabal index aed4805..28e1489 100644 --- a/Main/HGamer3D.cabal +++ b/Main/HGamer3D.cabal @@ -31,9 +31,9 @@ Flag InputSystem Default: True Library - Build-Depends: base >= 3 && < 5, clock, containers, hashtables, hashable, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 + Build-Depends: base >= 3 && < 5, split, clock, containers, hashtables, hashable, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Engine.Internal.Component, HGamer3D.Engine.Internal.ComponentType, HGamer3D.Engine.Internal.Entity, HGamer3D.Engine.Internal.System, HGamer3D.Engine.Internal.SystemGraphics3D, HGamer3D.Engine.Internal.SystemEvent, HGamer3D.Engine.Internal.GameLoop, HGamer3D.Engine.Internal.Event, HGamer3D.Engine.Schema.EventReceiver, HGamer3D.Engine.Schema.EventSender, HGamer3D.Engine.EcsAPI, HGamer3D.Engine.BaseAPI, HGamer3D.Internal.Engine + Exposed-modules: HGamer3D.Engine.Internal.Component, HGamer3D.Engine.Internal.ComponentType, HGamer3D.Engine.Internal.Entity, HGamer3D.Engine.Internal.System, HGamer3D.Engine.Internal.SystemGraphics3D, HGamer3D.Engine.Internal.SystemEvent, HGamer3D.Engine.Internal.GameLoop, HGamer3D.Engine.Internal.Event, HGamer3D.Engine.Schema.EventReceiver, HGamer3D.Engine.Schema.EventChannel, HGamer3D.Engine.EcsAPI, HGamer3D.Engine.BaseAPI, HGamer3D.Internal.Engine Other-modules: c-sources: diff --git a/Main/HGamer3D/Engine/BaseAPI.hs b/Main/HGamer3D/Engine/BaseAPI.hs index 05a654f..f742822 100644 --- a/Main/HGamer3D/Engine/BaseAPI.hs +++ b/Main/HGamer3D/Engine/BaseAPI.hs @@ -24,7 +24,9 @@ module HGamer3D.Engine.BaseAPI ( HG3DEvent (..), - + AudioEvent (..), + GUIFormEvent (..), + initHGamer3D, freeHGamer3D, stepHGamer3D, diff --git a/Main/HGamer3D/Engine/Internal/ComponentType.hs b/Main/HGamer3D/Engine/Internal/ComponentType.hs index 948b46f..15aaba9 100644 --- a/Main/HGamer3D/Engine/Internal/ComponentType.hs +++ b/Main/HGamer3D/Engine/Internal/ComponentType.hs @@ -36,8 +36,8 @@ data ComponentType = CTPos -- ^ Position | CTCam -- ^ Cameras | CTLig -- ^ Light | CTScP -- ^ Scene Parameter - | CTEvR -- ^ Event Receiver (GUI, Window, Joystick, Channel, ...) - | CTEvS -- ^ Event Sender (Channel, ...) + | CTEvR -- ^ Event Receiver + | CTEvC -- ^ Event Channel | CTGFo -- ^ GUI Forms deriving (Eq, Ord, Show) diff --git a/Main/HGamer3D/Engine/Internal/Entity.hs b/Main/HGamer3D/Engine/Internal/Entity.hs index 808d4b7..a059e05 100644 --- a/Main/HGamer3D/Engine/Internal/Entity.hs +++ b/Main/HGamer3D/Engine/Internal/Entity.hs @@ -59,6 +59,9 @@ entity inList = do evtsC2U <- newMVar [] return $ Entity cMap eId evtsU2C evtsC2U +instance Eq Entity where + e1 == e2 = (entityId e1) == (entityId e2) + idE :: Entity -> EntityId idE (Entity _ eId _ _) = eId diff --git a/Main/HGamer3D/Engine/Internal/Event.hs b/Main/HGamer3D/Engine/Internal/Event.hs index 694f0fe..4c9640a 100644 --- a/Main/HGamer3D/Engine/Internal/Event.hs +++ b/Main/HGamer3D/Engine/Internal/Event.hs @@ -27,21 +27,21 @@ where import HGamer3D.WinEvent.BaseAPI import HGamer3D.GUI.BaseAPI import qualified HGamer3D.GUI.Schema.Widget as W +import qualified HGamer3D.GUI.Schema.Form as F import Data.Dynamic data AudioEvent = PlaySound String | StopSound String deriving (Show) -{- -data GUIElementEvent = GELSetValue W.WidgetValue - | GELSetProperty W.WidgetProperty - | GELValueChange W.WidgetValue - | GELButtonClick --} +data GUIFormEvent = FormSetValue [(String, F.FormValue)] + | FormValueChange String [(String, F.FormValue)] + | FormButtonClick String + deriving (Show) + data HG3DEvent = WindowEvt SDLEvent - | GUIEvt GUIEvent -- ^ Low level GUI evts --- | GELEvt W.WidgetName GUIElementEvent -- ^ High level GUI evts + | GUIEvt GUIEvent -- ^ Low level GUI evts + | FormEvt GUIFormEvent -- ^ High level GUI evts, directly form related | AudioEvt AudioEvent | UserEvt Dynamic deriving (Show) diff --git a/Main/HGamer3D/Engine/Internal/System.hs b/Main/HGamer3D/Engine/Internal/System.hs index aa7c3eb..78aff4e 100644 --- a/Main/HGamer3D/Engine/Internal/System.hs +++ b/Main/HGamer3D/Engine/Internal/System.hs @@ -40,6 +40,8 @@ import HGamer3D.Engine.Internal.ComponentType import HGamer3D.Engine.Internal.Entity import HGamer3D.Engine.Internal.Event +import HGamer3D.Engine.Schema.EventReceiver + import System.Mem.StableName import Data.Hashable import qualified Data.HashTable.IO as HT @@ -81,12 +83,15 @@ entRemove esys entity = do stepEntityList :: EntityList -> IO EntityList stepEntityList esys = do - -- add/remove entities from other thread + -- add entities from other thread al <- takeMVar (entAddList esys) putMVar (entAddList esys) [] modifyIORef (entities esys) (\oldList -> oldList ++ al) - -- remove, to be done + -- remove entities from other thread + rl <- takeMVar (entRemoveList esys) + putMVar (entRemoveList esys) [] + modifyIORef (entities esys) (filter (\el -> not (el `elem` rl))) return esys @@ -307,3 +312,26 @@ removeFromWorld :: [SomeSystem] -> Entity -> IO () removeFromWorld systems e = mapM (f e) systems >> return () where f e (SomeSystem s) = removeEntity s e >> return () +filterEventType :: [EventType] -> [HG3DEvent] -> [HG3DEvent] +filterEventType types events = let + filterOneType evt evttype = case evttype of + AudioEvents -> case evt of + (AudioEvt _) -> True + _ -> False + WinEvents -> case evt of + (WindowEvt _) -> True + _ -> False + GUIEvents -> case evt of + (GUIEvt _) -> True + _ -> False + FormEvents -> case evt of + (FormEvt _) -> True + _ -> False + UserEvents -> case evt of + (UserEvt _ ) -> True + _ -> False + AllEvents -> True + _ -> False + filterAllTypes evttypes evt = length (filter id (map (filterOneType evt) evttypes)) > 0 + in filter (filterAllTypes types) events + diff --git a/Main/HGamer3D/Engine/Internal/SystemEvent.hs b/Main/HGamer3D/Engine/Internal/SystemEvent.hs index 4906aef..30fd08a 100644 --- a/Main/HGamer3D/Engine/Internal/SystemEvent.hs +++ b/Main/HGamer3D/Engine/Internal/SystemEvent.hs @@ -21,20 +21,26 @@ -- HGamer3D/Internal/ECS/SystemEvent.hs --- | the Event System of the Entity-Component-System World --- The event system is handling the event distribution and is responsible to send incoming events and distribute them to the receivers. The following scenarios explain the event distribution in detail: --- ** From user to component --- The event is placed in the incoming event queue of the entity by the sendEvent function. The event systems distributes them towards the target component of the same entity. Example: play audio sound, receiving component is the audio component. --- ** From component to user --- The component places incoming events into the component event queue, from there the event system puts them into the entity event queue, from where they can be received by the user. Example: joystick component, window event component. --- ** Signal/Slot/Channels to facilitate entity - entity communication --- A channel component is a simple name, the event system holds for each channel an event list and all events, which are received by the entity are distributed to all other entities, which subscribe to the same channel. The mechanism works for incoming events from users and for incoming events from components alike. --- ** GUI events --- GUI elements needs events in two directions, one direction, to set element value and another one, to receive changes in the element value. Therefore also the components need two different event queues, each. --- ** Naming conventions --- All queues holding events in the chain user to component communication are named with U2C the queues in the direction component to user have the names C2U, this holds for the queues in the components and in the entities as well as in the event system. +{- | the Event System of the Entity-Component-System World +The event system is handling the event distribution and is responsible to send incoming events and distribute them to the receivers. The guidelines how this works are along the main ideas of an ECS in general, each component should be separated from each other. The event system is the only one, which knows about more than one component with regards to events. Also the user interface in the end should be simple. +* User Interface Functionality +Users receive and send events over the entity interface with the functions receiveEvents and sendEvent. Sent events are distributed to the components in the entity as needed. Events coming from components are only processed if a ReceiveEvent component is added to the entity with the filter criteria, which events should be received. An additional channel component is existing, which allows sending events to a channel and receiving events from a channel. + +* Scenarios, how the Event System works in detail + +In general users are only interacting with the entity functions, which fill and empty the U2C and C2U queues of the entity. Component systems (with the exception of the EventSystem itself) are only receiving and sending into the component queues. The distribution of events between entities and components are done by the EventSystem, based on two principle mechanisms: + +** From user to component (U2C) +U2C events are placed into the appropriate components directly. The event is placed in the incoming event queue of the entity by the sendEvent function. The event systems distributes them towards the target component of the same entity. into the U2C queue. The target component picks it up from the U2C queue and handles it. Examples: play audio sound, receiving component is the audio component. GUI Form set values, receiving component is the GUI component (within Graphics3D), which handles it. + +** From component to user (C2U) +C2U events are not automatically placed into the entity for receipt by the user. Instead all C2U events are placed into an exising receiving component. From this component only the events of the current filter criteria are put into the entity C2U event queue. Besides of that processing is similar as in the U2C case. The component places incoming events into the component event queue, the C2U queue, from there the event system puts them into the receiving component queue. + +** Channels +Channels are just separate components, which work the following: user events are put in the component channel U2C queue. From there they are stored into a cross entity channel storage structure. All the events in the channel structure are distributed to the channel components in the C2U queue. From there they might be picked up by receiving components, as done in the case of other components also. +-} module HGamer3D.Engine.Internal.SystemEvent @@ -69,7 +75,7 @@ import HGamer3D.Graphics3D.Schema.Camera import HGamer3D.Graphics3D.Schema.Light import HGamer3D.Graphics3D.Schema.Scene import HGamer3D.Engine.Schema.EventReceiver -import HGamer3D.Engine.Schema.EventSender +import HGamer3D.Engine.Schema.EventChannel data ECSEventQueues = ECSEventQueues { entList :: EntityList, @@ -96,88 +102,76 @@ instance System ECSEventQueues where -- add/remove entities from other thread stepEntityList (entList esys) - -- remove, to be done - es <- readIORef (entities (entList esys)) - -- map over all events and handle single events coming from - -- user and from receiver components, send them to targets + + -- map over all entities and handle the events mapM (\entity -> do - -- User Events to specific components, which want them + + -- U2C mechanism, distribute incoming user events to components which wants them + u2cEvts <- _popEntityU2CEvents entity -- audio evts - let audioEvts = filter (\evt -> case evt of - (AudioEvt _) -> True - _ -> False) u2cEvts + let audioEvts = filterEventType [AudioEvents] u2cEvts case (entity #? CTASl) of Nothing -> return () Just com -> _pushU2CEvents com audioEvts - -- sender channels - case (entity #? CTEvS) of + -- channels + case (entity #? CTEvC) of Nothing -> return () Just com -> _pushU2CEvents com u2cEvts + -- GUI Forms + let guiEvts = filterEventType [FormEvents] u2cEvts + case (entity #? CTGFo) of + Nothing -> return () + Just com -> _pushU2CEvents com guiEvts - -- C2U events from receiver components + -- Channel handling, send U2C events to channel + + case (entity #? CTEvC) of + Nothing -> return () + Just com -> do + EventChannel channel <- readC com >>= return . fromStamped . fromJust + evts <- _popU2CEvents com + mOldEvents <- HT.lookup (namedQueues esys) channel + case mOldEvents of + Just oldEvents -> HT.insert (namedQueues esys) channel (oldEvents ++ evts) + Nothing -> HT.insert (namedQueues esys) channel evts + _ -> return () + + -- C2U mechanism, distribute incoming component events to entity + case (entity #? CTEvR) of Nothing -> return () Just com -> do - recVal <- readC com >>= return . fromStamped . fromJust + (EventReceiver eventtypes) <- readC com >>= return . fromStamped . fromJust c2uEvts <- _popC2UEvents com - let filterF = case recVal of - WinEventReceiver -> (\evt -> case evt of - (WindowEvt _) -> True - _ -> False) - GUIEventReceiver -> (\evt -> case evt of - (GUIEvt _) -> True - _ -> False) - UserEventReceiver -> (\evt -> case evt of - (UserEvt _) -> True - _ -> False) - AllEventsReceiver -> (\evt -> True) - _ -> (\evt -> False) - let evts = filter filterF c2uEvts + let evts = filterEventType eventtypes c2uEvts _pushEntityC2UEvents entity evts - -- copy to sender, in case existing - case (entity #? CTEvS) of - Nothing -> return () - Just com -> _pushU2CEvents com evts - -- Channel handling, sender to named channel - case (entity #? CTEvS) of - Nothing -> return () - Just com -> do - recVal <- readC com >>= return . fromStamped . fromJust - case recVal of - ChannelEventReceiver channel -> do - evts <- _popU2CEvents com - mOldEvents <- HT.lookup (namedQueues esys) channel - case mOldEvents of - Just oldEvents -> HT.insert (namedQueues esys) channel (oldEvents ++ evts) - - Nothing -> HT.insert (namedQueues esys) channel evts - _ -> return () ) es + -- remark channel handling: the correct sequence is as follows, first + -- handle all entities and put user events into channel storage (above). + -- Then (second) send all channels to receivers (C2U), which is below. + -- Third, delete queues. - -- map over all events and handle channel events towards channel - -- receiver - mapM (\entity -> do - case (entity #? CTEvR) of - Nothing -> return () - Just com -> do - recVal <- readC com >>= return . fromStamped . fromJust - case recVal of - ChannelEventReceiver channel -> do - mEvents <- HT.lookup (namedQueues esys) channel - case mEvents of - Just events -> _pushC2UEvents com events - Nothing -> return () - _ -> return () - ) es - + -- Channel handling, send all queue content to all receivers -- clear all channels, after sending/receiving namedQueueList <- HT.toList (namedQueues esys) mapM (\(channel, events) -> do + events <- HT.lookup (namedQueues esys) channel >>= return . fromJust HT.insert (namedQueues esys) channel [] + mapM (\entity -> do + case (entity #? CTEvC) of + Nothing -> return () + Just comChannel -> do + EventChannel channel' <- readC comChannel >>= return . fromStamped . fromJust + if channel == channel' then do + case (entity #? CTEvR) of + Nothing -> return () + Just comReceiver -> _pushC2UEvents comReceiver events + else return () + ) es ) namedQueueList return (esys, False) diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index 81104f0..c323f68 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -41,6 +41,7 @@ import HGamer3D.Engine.Internal.System import Data.IORef import Data.Hashable import qualified Data.HashTable.IO as HT +import Data.List.Split import qualified HGamer3D.Data as D @@ -194,7 +195,26 @@ instance System ECSGraphics3D where lacApplyOtherChanges (orilig ecsg3d) (lights ecsg3d) update'' -- gui forms - lacApplyChanges (guiforms ecsg3d) (GU.createForm guis) (GU.updateForm guis) (GU.removeForm guis) lacHandleU2CEvents lacHandleC2UEvents + newFormEvents <- newIORef [] + let handleU2CEvents evts form = do + mapM (\evt -> case evt of + (E.FormEvt (E.FormSetValue values)) -> GU.setFormValues form values + (E.GUIEvt (GU.GUIEvent tag sender window)) -> do + values <- GU.getFormValues form + strType <- GU.typeOfGuiEl window >>= return . last . (splitOn "/") + if tag `elem` (map fst values) then do + -- check if button + let newEvt = if strType == "Button" + then E.FormEvt (E.FormButtonClick tag) + else E.FormEvt (E.FormValueChange tag values) + -- show for testing + modifyIORef newFormEvents (\oldList -> (newEvt : oldList)) + return () + else return () + _ -> return () + ) evts + return () + lacApplyChanges (guiforms ecsg3d) (GU.createForm guis) (GU.updateForm guis) (GU.removeForm guis) handleU2CEvents lacHandleC2UEvents -- scene parameters let updateScene eng new = Gr.setSceneParameter g3ds new @@ -208,11 +228,13 @@ instance System ECSGraphics3D where -- handover evts towards the event system inList <- readIORef (lacList (receivers ecsg3d)) + evts' <- readIORef newFormEvents mapM (\(eid, com) -> do _pushC2UEvents com evts + _pushC2UEvents com evts' ) inList - + -- send camera resize events, set gui size let camEvts = filter (\evt -> case evt of (E.WindowEvt (WinEvt.EvtWindow _ _ WinEvt.SDL_WINDOWEVENT_SIZE_CHANGED x y)) -> True @@ -222,7 +244,13 @@ instance System ECSGraphics3D where mapM (\cam -> _pushU2CEvents (snd cam) camEvts) camList mapM (\(E.WindowEvt (WinEvt.EvtWindow _ _ WinEvt.SDL_WINDOWEVENT_SIZE_CHANGED x y)) -> GU.notifyDisplaySizeChanged guis (fromIntegral x) (fromIntegral y)) camEvts else return [()] - + + -- handle GUI events, create high level gui events, push GUI events to gfos + let guiEvts = filterEventType [GUIEvents] evts + gfoList <- readIORef (lacList (guiforms ecsg3d)) + mapM (\gfo -> _pushU2CEvents (snd gfo) guiEvts) gfoList + + return (ecsg3d, qFlag) diff --git a/Main/HGamer3D/Engine/Schema/EventSender.hs b/Main/HGamer3D/Engine/Schema/EventChannel.hs similarity index 92% rename from Main/HGamer3D/Engine/Schema/EventSender.hs rename to Main/HGamer3D/Engine/Schema/EventChannel.hs index 1cc9cf5..fd9092a 100644 --- a/Main/HGamer3D/Engine/Schema/EventSender.hs +++ b/Main/HGamer3D/Engine/Schema/EventChannel.hs @@ -21,13 +21,13 @@ -- -- | Schema for EventSender -module HGamer3D.Engine.Schema.EventSender +module HGamer3D.Engine.Schema.EventChannel where import Data.Typeable import qualified HGamer3D.Data as D -data EventSender = ChannelEventSender String +data EventChannel = EventChannel String deriving (Eq, Show, Typeable) diff --git a/Main/HGamer3D/Engine/Schema/EventReceiver.hs b/Main/HGamer3D/Engine/Schema/EventReceiver.hs index 7e0db9f..372a9b9 100644 --- a/Main/HGamer3D/Engine/Schema/EventReceiver.hs +++ b/Main/HGamer3D/Engine/Schema/EventReceiver.hs @@ -28,12 +28,14 @@ where import Data.Typeable import qualified HGamer3D.Data as D -data EventReceiver = ChannelEventReceiver String - | WinEventReceiver - | GUIEventReceiver - | JoystickEventReceiver - | UserEventReceiver - | AllEventsReceiver - - deriving (Eq, Show, Typeable) +data EventReceiver = EventReceiver [EventType] deriving (Eq, Show, Typeable) +data EventType = ChannelEvents + | AudioEvents + | WinEvents + | GUIEvents + | FormEvents + | JoystickEvents + | UserEvents + | AllEvents + deriving (Eq, Show, Typeable) From abdacee2a915bd6908bc00aaefec8f536eb10393 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Sun, 27 Jul 2014 20:22:51 +0200 Subject: [PATCH 18/28] Examples now run again in version 0.4 --- Examples/BaseAPI/BlueCube.hs | 16 +- Examples/BaseAPI/BumpMappingCube.hs | 35 +- Examples/BaseAPI/GUI-Widgets.hs | 34 +- Examples/{InputSystem => BaseAPI}/Joystick.hs | 2 +- Examples/{InputSystem => BaseAPI}/Keyboard.hs | 2 +- Examples/{InputSystem => BaseAPI}/Mouse.hs | 2 +- Examples/{Network => BaseAPI}/Network-Chat.hs | 6 +- Examples/{WinEvent => BaseAPI}/WinEvent.hs | 5 +- Examples/GUI/GUI-Wire.hs | 325 -------------- Examples/Games/Cuboid2.hs | 322 -------------- Examples/Games/EntityComponentSystem.hs | 284 ------------- Examples/Games/GameWire.hs | 113 ----- Examples/Games/YWing-Flight-Readme.txt | 69 --- Examples/Games/YWing-Flight.hs | 396 ------------------ Examples/SConstruct | 16 +- 15 files changed, 56 insertions(+), 1571 deletions(-) rename Examples/{InputSystem => BaseAPI}/Joystick.hs (94%) rename Examples/{InputSystem => BaseAPI}/Keyboard.hs (93%) rename Examples/{InputSystem => BaseAPI}/Mouse.hs (93%) rename Examples/{Network => BaseAPI}/Network-Chat.hs (85%) rename Examples/{WinEvent => BaseAPI}/WinEvent.hs (68%) delete mode 100644 Examples/GUI/GUI-Wire.hs delete mode 100644 Examples/Games/Cuboid2.hs delete mode 100644 Examples/Games/EntityComponentSystem.hs delete mode 100644 Examples/Games/GameWire.hs delete mode 100644 Examples/Games/YWing-Flight-Readme.txt delete mode 100644 Examples/Games/YWing-Flight.hs diff --git a/Examples/BaseAPI/BlueCube.hs b/Examples/BaseAPI/BlueCube.hs index 8a01fec..7057b3b 100644 --- a/Examples/BaseAPI/BlueCube.hs +++ b/Examples/BaseAPI/BlueCube.hs @@ -19,37 +19,37 @@ import HGamer3D.Data import HGamer3D.Engine.BaseAPI import HGamer3D.Graphics3D.BaseAPI +import HGamer3D.Graphics3D.Schema.Camera -renderLoop cubeF g3ds guis = do +renderLoop cubeF g3ds guis last = do -- rotate orientation cubeF >>= \o -> return (yaw o (Rad 0.005)) >>= orientationTo cubeF orientation cubeF >>= \o -> return (roll o (Rad 0.002)) >>= orientationTo cubeF - (ev, quit) <- stepHGamer3D g3ds guis - if quit then return () else renderLoop cubeF g3ds guis + (ev, last', quit) <- stepHGamer3D g3ds guis last + if quit then return () else renderLoop cubeF g3ds guis last' main :: IO () main = do - (g3ds, guis, camera, viewport) <- initHGamer3D "HGamer3D - BlueCube Example" True True True + (g3ds, guis, last) <- initHGamer3D "HGamer3D - BlueCube Example" True True True -- camera position + camera <- addCamera g3ds (Camera (Frustum 5.0 5000.0 (Deg 60)) (Viewport 0 (Rectangle 0.0 0.0 1.0 1.0) black)) let pos = Vec3 5.0 5.0 80.0 positionTo camera pos let at = Vec3 0.0 0.0 (-300.0) cameraLookAt camera at -- define light - setAmbientLight g3ds white - pointLight g3ds white (Vec3 10.0 10.0 20.0) + pointLight g3ds white white (Vec3 10.0 10.0 20.0) -- create a shiny blue cube cubeFigure <- cube g3ds 0.2 (ResourceMaterial "Colours/Blue") positionTo cubeFigure (Vec3 0.0 0.0 0.0) - sizeTo cubeFigure (Vec3 0.5 0.5 0.5) -- start render loop - renderLoop cubeFigure g3ds guis + renderLoop cubeFigure g3ds guis last freeHGamer3D g3ds guis return () diff --git a/Examples/BaseAPI/BumpMappingCube.hs b/Examples/BaseAPI/BumpMappingCube.hs index 94c598a..cdacb0a 100644 --- a/Examples/BaseAPI/BumpMappingCube.hs +++ b/Examples/BaseAPI/BumpMappingCube.hs @@ -17,24 +17,27 @@ -- limitations under the License. import HGamer3D.Data -import HGamer3D.Graphics3D +import HGamer3D.Engine.BaseAPI +import HGamer3D.Graphics3D.BaseAPI +import HGamer3D.Graphics3D.Schema.Camera +import HGamer3D.Graphics3D.Schema.Figure +import HGamer3D.Graphics3D.Schema.Geometry -white :: Colour -white = (Colour 1.0 1.0 1.0 1.0) -renderLoop cube g3ds = do +renderLoop cubeF g3ds guis last = do -- rotate - yaw cube (Rad 0.005) - roll cube (Rad 0.002) - quit <- loopHGamer3D g3ds - if quit then return () else renderLoop cube g3ds + orientation cubeF >>= \o -> return (yaw o (Rad 0.005)) >>= orientationTo cubeF + orientation cubeF >>= \o -> return (roll o (Rad 0.002)) >>= orientationTo cubeF + (ev, last', quit) <- stepHGamer3D g3ds guis last + if quit then return () else renderLoop cubeF g3ds guis last' main :: IO () main = do - (g3ds, camera, viewport) <- initHGamer3D "HGamer3D - BumpMapping Example" "DefaultSceneManager" True True + (g3ds, guis, last) <- initHGamer3D "HGamer3D - BumpMapping Example" True True True -- camera position + camera <- addCamera g3ds (Camera (Frustum 5.0 5000.0 (Deg 60)) (Viewport 0 (Rectangle 0.0 0.0 1.0 1.0) black)) let pos = Vec3 5.0 5.0 400.0 positionTo camera pos let at = Vec3 0.0 0.0 (-300.0) @@ -43,16 +46,16 @@ main = do -- define light setAmbientLight g3ds (Colour 1.0 1.0 1.0 1.0) - pointLight g3ds (Colour 0.3 0.3 1.0 1.0) (Vec3 (-100.0) 10.0 0.0) - pointLight g3ds (Colour 1.0 0.3 0.3 1.0) (Vec3 100.0 10.0 0.0) - let cube = resourceMesh "knot.mesh" - let bumpMaterial = resourceMaterial "OffsetMapping/IntegratedShadows" - cube <- object3DFromMesh g3ds cube (Just bumpMaterial ) True + pointLight g3ds white (Colour 0.3 0.3 1.0 1.0) (Vec3 (-100.0) 10.0 0.0) + pointLight g3ds white (Colour 1.0 0.3 0.3 1.0) (Vec3 100.0 10.0 0.0) + + + cube <- object3D g3ds (SimpleFigure (ResourceGeometry "knot.mesh") (ResourceMaterial "OffsetMapping/IntegratedShadows")) positionTo cube (Vec3 0.0 0.0 0.0) -- start render loop - renderLoop cube g3ds - exitHGamer3D g3ds + renderLoop cube g3ds guis last + freeHGamer3D g3ds guis return () diff --git a/Examples/BaseAPI/GUI-Widgets.hs b/Examples/BaseAPI/GUI-Widgets.hs index ec8e5e2..01c4a31 100644 --- a/Examples/BaseAPI/GUI-Widgets.hs +++ b/Examples/BaseAPI/GUI-Widgets.hs @@ -26,6 +26,7 @@ import HGamer3D.Engine.BaseAPI import HGamer3D.Graphics3D.BaseAPI import HGamer3D.WinEvent.BaseAPI import HGamer3D.GUI.BaseAPI +import HGamer3D.Graphics3D.Schema.Camera import Control.Monad.Trans import Data.Maybe @@ -86,10 +87,10 @@ printEvent outbox event = do return () -checkEvents outtext g3ds guis = do - (evts, qFlag) <- stepHGamer3D g3ds guis +checkEvents outtext g3ds guis last = do + (evts, last', qFlag) <- stepHGamer3D g3ds guis last if qFlag then - return False + return (False, last') else do qList <- mapM (\evt -> do case evt of @@ -99,20 +100,21 @@ checkEvents outtext g3ds guis = do (WindowEvt (EvtQuit ts)) -> return True _ -> return False ) evts - return $ length (filter id qList) == 0 + return (length (filter id qList) == 0, last') -renderLoop cubeF outtext g3ds guis = do +renderLoop cubeF outtext g3ds guis last = do -- rotate orientation cubeF >>= \o -> return (yaw o (Rad 0.005)) >>= orientationTo cubeF orientation cubeF >>= \o -> return (roll o (Rad 0.002)) >>= orientationTo cubeF - proceed <- checkEvents outtext g3ds guis - if proceed then renderLoop cubeF outtext g3ds guis else return () + (proceed, last') <- checkEvents outtext g3ds guis last + if proceed then renderLoop cubeF outtext g3ds guis last' else return () main = do - (g3ds, guis, camera, viewport) <- initHGamer3D "HGamer3D - GUI Widgets Example" True True True + (g3ds, guis, last) <- initHGamer3D "HGamer3D - GUI Widgets Example" True True True -- camera position + camera <- addCamera g3ds (Camera (Frustum 5.0 5000.0 (Deg 60)) (Viewport 0 (Rectangle 0.0 0.0 1.0 1.0) black)) let pos = Vec3 5.0 5.0 80.0 positionTo camera pos let at = Vec3 0.0 0.0 (-300.0) @@ -121,7 +123,7 @@ main = do -- define light setAmbientLight g3ds white - pointLight g3ds white (Vec3 10.0 10.0 20.0) + pointLight g3ds white white (Vec3 10.0 10.0 20.0) -- create a shiny blue cube cubeFigure <- cube g3ds 0.2 (ResourceMaterial "Colours/Blue") @@ -139,18 +141,6 @@ main = do sttext <- loadGuiLayoutFromFile guis "statictext.layout" "" addGuiElToDisplay guis guiwidgets -{- - -- test element creation - b1 <- button guis "TaharezLook" [pX =: (GUIDim 0.0 100.0), - pY =: (GUIDim 0.0 100.0), - pWidth =: (GUIDim 0.0 100.0), - pHeight =: (GUIDim 0.0 20.0), - pText =: "Cooler Button", - pVisible =: True, - pAlpha =: 1.0] - addGuiElToDisplay guis b1 - registerGUIEvent guis b1 "Clicked" "coolclick" --} -- handling of single GUI elements ---------------------------------- @@ -198,6 +188,6 @@ main = do registerGUIEvent guis combobox "ListSelectionAccepted" "combo-done" -- start render loop - renderLoop cubeFigure outtext g3ds guis + renderLoop cubeFigure outtext g3ds guis last freeHGamer3D g3ds guis return () diff --git a/Examples/InputSystem/Joystick.hs b/Examples/BaseAPI/Joystick.hs similarity index 94% rename from Examples/InputSystem/Joystick.hs rename to Examples/BaseAPI/Joystick.hs index 8ac6eaf..d53683b 100644 --- a/Examples/InputSystem/Joystick.hs +++ b/Examples/BaseAPI/Joystick.hs @@ -21,7 +21,7 @@ module Main where -import HGamer3D.InputSystem +import HGamer3D.InputSystem.BaseAPI import Control.Monad diff --git a/Examples/InputSystem/Keyboard.hs b/Examples/BaseAPI/Keyboard.hs similarity index 93% rename from Examples/InputSystem/Keyboard.hs rename to Examples/BaseAPI/Keyboard.hs index ce12262..0bfbc8e 100644 --- a/Examples/InputSystem/Keyboard.hs +++ b/Examples/BaseAPI/Keyboard.hs @@ -21,7 +21,7 @@ module Main where -import HGamer3D.InputSystem +import HGamer3D.InputSystem.BaseAPI import Control.Monad diff --git a/Examples/InputSystem/Mouse.hs b/Examples/BaseAPI/Mouse.hs similarity index 93% rename from Examples/InputSystem/Mouse.hs rename to Examples/BaseAPI/Mouse.hs index f9c2636..3fd21e9 100644 --- a/Examples/InputSystem/Mouse.hs +++ b/Examples/BaseAPI/Mouse.hs @@ -21,7 +21,7 @@ module Main where -import HGamer3D.InputSystem +import HGamer3D.InputSystem.BaseAPI import Control.Monad loop = do diff --git a/Examples/Network/Network-Chat.hs b/Examples/BaseAPI/Network-Chat.hs similarity index 85% rename from Examples/Network/Network-Chat.hs rename to Examples/BaseAPI/Network-Chat.hs index e645256..65166e4 100644 --- a/Examples/Network/Network-Chat.hs +++ b/Examples/BaseAPI/Network-Chat.hs @@ -1,7 +1,7 @@ module Main where -import HGamer3D.Data.TimeMS -import HGamer3D.Network +import HGamer3D.Data.GameTime +import HGamer3D.Network.BaseAPI --import Control.Monad.Trans @@ -12,7 +12,7 @@ doClientWork client = do serverLoop server clients = do - pkgs <- receiveNetworkMessages server (TimeMS 100) + pkgs <- receiveNetworkMessages server (msecT 100) mapM (print . message) pkgs serverLoop server clients diff --git a/Examples/WinEvent/WinEvent.hs b/Examples/BaseAPI/WinEvent.hs similarity index 68% rename from Examples/WinEvent/WinEvent.hs rename to Examples/BaseAPI/WinEvent.hs index 496a989..12654e6 100644 --- a/Examples/WinEvent/WinEvent.hs +++ b/Examples/BaseAPI/WinEvent.hs @@ -1,6 +1,9 @@ module Main where -import HGamer3D.WinEvent +-- remark this example shows WinEvent in isolation, which is not very useful +-- see BlueCube example for basic HGamer3D window creation + +import HGamer3D.WinEvent.BaseAPI loopEvents = do evt <- pollWinEvent diff --git a/Examples/GUI/GUI-Wire.hs b/Examples/GUI/GUI-Wire.hs deleted file mode 100644 index afa6a09..0000000 --- a/Examples/GUI/GUI-Wire.hs +++ /dev/null @@ -1,325 +0,0 @@ -{-# LANGUAGE Arrows #-} - - --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.althainz.de/HGamer3D.html --- --- (c) 2014 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - - --- GUI-Wire.hs --- example, to create and use GUI elements efficiently with netwire --- build on top of netwire: http://hackage.haskell.org/package/netwire - -module Main where - -import HGamer3D -import HGamer3D.Wire - -import Control.Monad.Trans -import Control.Monad.Reader -import Control.Monad.State - -import Control.Monad.Identity (Identity) -import Control.Wire -import Control.Wire.Unsafe.Event -import Prelude hiding ((.), id) -import Text.Printf -import System.Random - -import qualified Data.Map as Map -import Data.Time.Clock - -import Control.Concurrent -import Data.List --- import Data.List.Split -import Data.Maybe -import GHC.Float --- import Data.Tuple.Select - -import Control.Exception - -getWidget widget name = do - subwidget <- findChildGuiElRecursive widget name - case subwidget of - Just widgetOk -> do - return widgetOk - Nothing -> do - return widget - -initialize3DComponents ws cam = do - let g3ds = wsG3d ws - let guis = wsGui ws - - let pos = Vec3 5.0 5.0 80.0 - positionTo3D cam pos - let at = Vec3 0.0 0.0 (-300.0) - cameraLookAt cam at - let white = Colour 1.0 1.0 1.0 1.0 - setAmbientLight g3ds white - light <- pointLight g3ds white (Vec3 10.0 10.0 20.0) - - -- GUI Code starts here, display hg3d logo - loadGuiScheme guis "hg3d.scheme" - loadGuiLayout ws "hgamer3d.layout" - loadGuiLayout ws "wiregui.layout" - - -- create a shiny blue cube - let cube = cubeMesh - cube <- object3DFromMesh g3ds cube (Just (ResourceMaterial "Colours/Blue") ) False - positionTo3D cube (Vec3 5.0 5.0 0.0) - scaleTo3D cube (Vec3 0.2 0.2 0.2) - rE <- rotEntity "cubeE" cube unitU - let rw = rotate rE (Vec3 1.0 1.0 0.0) 1.0 - - return (rw, rE) - --- define some operators for events and values -_nE evt = fmap (const ()) evt - -(|#) :: Event a -> Event a -> Event a -evt1 |# evt2 = evt1 `mergeL` evt2 - -(|!) :: Event a -> Event b -> Event () -evt1 |! evt2 = _nE evt1 `mergeL` _nE evt2 - -(<#) :: Event a -> b -> Event b -evt <# val = fmap (const val) evt - - --- book: arithmetic window -getAddWindow ws = do - - leftEB <- doubleBoxW ws "WindowAdd/LeftEB" 0.0 - rightEB <- doubleBoxW ws "WindowAdd/RightEB" 0.0 - sumS <- staticTextW ws "WindowAdd/Sum" - - let wire = proc _ -> do - (leftE, leftV) <- leftEB . never -< () - (rightE, rightV) <- rightEB . never -< () - sumS -< (leftE |# rightE) <# (show (leftV + rightV)) - returnA -< () - - return wire - - -getCntWindow ws = do - - -- Counter Window - buttonUp <- buttonW ws "WindowCounter/ButtonUp" - buttonDown <- buttonW ws "WindowCounter/ButtonDown" - cnts <- staticTextW ws "WindowCounter/Counter" - - let wire = proc _ -> do - addE <- buttonUp -< 1 - subE <- buttonDown -< (-1) - sumE <- accumE (+) 0 -< mergeL addE subE - cnts -< show `fmap` sumE - returnA -< () - - return wire - -getCurrWindow ws rate = do - - -- Currentcy Window - eurs <- doubleBoxW ws "WindowCurrency/EuroEB" 0.0 - dols <- doubleBoxW ws "WindowCurrency/DollarEB" 0.0 - - let wire = proc _ -> do - rec - (outEur, _) <- eurs . delay NoEvent -< inEur - (outDol, _) <- dols . delay NoEvent -< inDol - let inDol = (* rate) `fmap` outEur - let inEur = (/ rate) `fmap` outDol - returnA -< () - - return wire - -getCrudWindow ws = do - - -- stateV is a list of: ((prename, surname), idn) - -- selV has the same format but only contains the selected items - - let idTp = snd - let pnTp = fst . fst - let snTp = snd . fst - let nameTp tp = (pnTp tp) ++ " " ++ (snTp tp) - - -- get GUI elements - namesLB <- listBoxW ws "WindowCrud/Names" nameTp [] - prenameEB <- editBoxW ws "WindowCrud/Name" "" - surnameEB <- editBoxW ws "WindowCrud/Surname" "" - createB <- buttonW ws "WindowCrud/ButtonCreate" - createBTxt <- guiSetPropertyW ws "WindowCrud/ButtonCreate" "Text" - deleteB <- buttonW ws "WindowCrud/ButtonDelete" - filterEB <- editBoxW ws "WindowCrud/Filter" "" - - - - -- the main wire - ---------------- - - let wire = proc _ -> do - rec - - -- setup main events, those events drive all computations - --------------------------------------------------------- - - -- need delay in recursive definition - (stateInE, selInE) <- delay (Event [], Event []) -< (stateInE', selInE') - - -- all elements, wired with in and out and value - (preOutE, preV) <- prenameEB . delay (Event "") -< preInE - (surOutE, surV) <- surnameEB . delay (Event "") -< surInE - (filOutE, filV) <- filterEB . now -< "" - (selNamesOutE, selNamesV) <- namesLB . delay (Event []) -< namesInE - createBTxt . delay (Event "Create") -< creBInE - - -- additional elements, which only create events - creBE <- createB -< () - delBE <- deleteB -< () - - -- values, computed from events, main state info of program - stateV <- hold -< stateInE - selV <- hold -< selInE - - -- specific computed events - selectedE <- filterE (not . null) -< selInE <# selV -- selection appeared - deselectedE <- filterE null -< selInE <# selV -- deselection appeard - (crE, desE) <- (filterE null &&& filterE (not . null)) -< creBE <# selV -- create button is either create or deselect evt - preOutSelE <- filterE (not . null) -< preOutE <# selV -- only set pre field, when selection - surOutSelE <- filterE (not . null) -< surOutE <# selV -- only set sur field, when selection - - -- value, computed from events - idV <- (hold . accum1E (+)) <|> pure 0 -< fmap (const (1::Int)) crE -- counts ids upon creation - - - -- now the logic, for each event - -------------------------------- - - -- prename surname fields get set upon new selection - let preInE = fmap (\[tp] -> pnTp tp) selectedE - let surInE = fmap (\[tp] -> snTp tp) selectedE - - -- main state value, change the list of items - let stateInE' = (crE <# (((preV, surV), idV) : stateV) ) -- creation of element - |# (delBE <# if null selV then stateV else filter (\el -> idTp el /= idTp (selV !! 0) ) stateV) -- deletion of element - |# (preOutSelE <# ( - let updatePre idx tp = if idTp tp == idTp idx then ((preV, snTp tp), idTp tp) else tp - in (fmap (updatePre (selV !! 0)) stateV ) )) -- pre changed - |# (surOutSelE <# ( - let updateSur idx tp = if idTp tp == idTp (selV !! 0) then ((pnTp tp, surV), idTp tp) else tp - in (fmap (updateSur (selV !! 0)) stateV ) )) -- sur changed - - -- selection state value, change list of selected items - let selInE' = (desE <# []) - |# (delBE <# []) - |# (selNamesOutE <# selNamesV) - |# (filOutE <# (filter (isInfixOf filV . nameTp) selNamesV) ) - - -- names dialog box, filter by search string and re-apply selection - let namesInE = (stateInE |! selInE |! filOutE) <# ( - let reSelect el = (el, if null selV then False else (idTp el) == idTp (selV !! 0)) - filterF = filter ( (isInfixOf filV) . nameTp ) - in fmap reSelect (filterF stateV) ) - - -- create button text, in value - let creBInE = (selectedE <# "Deselect") - |# (deselectedE <# "Create") - - returnA -< () - - return wire - -getMenueWindow ws = do - - -- create the FRP wires for "changed value" and "set" functionality for each radio button - bAdd <- radioButtonW ws "Menue/AddWindow" True - bCnt <- radioButtonW ws "Menue/CntWindow" False - bCurr <- radioButtonW ws "Menue/CurrWindow" False - bCrud <- radioButtonW ws "Menue/CrudWindow" False - - -- create the FRP wires, which set visibility of the windows, depending on radio button state - vAdd <- guiSetPropertyW ws "WindowAdd" "Visible" - vCnt <- guiSetPropertyW ws "WindowCounter" "Visible" - vCurr <- guiSetPropertyW ws "WindowCurrency" "Visible" - vCrud <- guiSetPropertyW ws "WindowCrud" "Visible" - - let b2st = \b ->if b then "True" else "False" - - -- create the menu wire - let menueWindowW = proc _ -> do - (addE, _) <- bAdd . never -< () - (cntE, _) <- bCnt . never -< () - (currE, _) <- bCurr . never -< () - (crudE, _) <- bCrud . never -< () - - vAdd . (id &> now . pure "True" ) -< b2st `fmap` addE - vCnt . (id &> now . pure "Fals" ) -< b2st `fmap` cntE - vCurr . (id &> now . pure "Fals" ) -< b2st `fmap` currE - vCrud . (id &> now . pure "Fals" ) -< b2st `fmap` crudE - returnA -< () - - return menueWindowW - -initAllWindows ws rw = do - fw1 <- getAddWindow ws - fw2 <- getMenueWindow ws - fw3 <- getCntWindow ws - fw4 <- getCurrWindow ws 1.3738 - fw5 <- getCrudWindow ws - let fw = proc _ -> do - fw1 -< () - fw2 -< () - fw3 -< () - fw4 -< () - fw5 -< () - rw -< Event () - returnA -< () - return fw - - - -renderLoop ws s w cmd = do - (ds, s') <- stepSession s - (cmd', w') <- stepWire w ds cmd - qFlag <- HGamer3D.Wire.loopHGamer3D ws - if qFlag then return () else renderLoop ws s' w' cmd' - -main = do - (ws, camera, viewport) <- HGamer3D.Wire.initHGamer3D "HGamer3D - GUI Wire Example" True False True - (rw, rE) <- initialize3DComponents ws camera - fw <- initAllWindows ws rw - - let startCmd = (CmdAddEntity rE) - - let locSysW = createSystem locationSystem - let oriSysW = createSystem orientationSystem - let velSysW = createSystem velocitySystem - let fw' = (proc cmd -> do - fw -< () - cmd' <- cmdFifo . locSysW . velSysW . oriSysW -< cmd - returnA -< cmd') :: GameWire (Event Command) (Event Command) - - renderLoop ws clockSession_ fw' (Right (Event startCmd)) - return () - - - - - - - diff --git a/Examples/Games/Cuboid2.hs b/Examples/Games/Cuboid2.hs deleted file mode 100644 index 1af28d9..0000000 --- a/Examples/Games/Cuboid2.hs +++ /dev/null @@ -1,322 +0,0 @@ -{-# LANGUAGE Arrows, DeriveDataTypeable, ExistentialQuantification #-} - --- Cuboid2, a 3D puzzle game, thanks to Pedro Martins for game idea (https://github.com/pedromartins/cuboid) --- --- (c) 2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - -module Main where - -import Control.Wire -import Control.Wire.Unsafe.Event -import Prelude hiding ((.), id) -import Data.Maybe -import Data.Dynamic - -import HGamer3D -import HGamer3D.Audio -import HGamer3D.InputSystem - -import GameWire -import EntityComponentSystem - - --- GEOMETRY DATA AND 3D SETUP -type FieldVec = (Int, Int, Int) - -data Cuboid = Cuboid { cbDim :: Int, - cbField :: [FieldVec], - cbStart :: FieldVec, - cbGoal :: FieldVec } deriving (Show, Eq, Typeable) - -type Level = [Cuboid] - -oneAndOnlyLevel :: Level -- the only level, we currently have -oneAndOnlyLevel = [ - Cuboid 5 [(2,2,2),(1,1,1),(3,3,3)] (0, 3, 4) (4, 3, 4) , - Cuboid 5 [(0,4,4),(0,0,3),(4,1,3)] (0,4,3) (3,1,0), - Cuboid 5 [(1,3,0),(3,3,0),(1,1,1),(3,1,1),(3,4,2),(0,3,3),(1,2,4),(2,1,4),(3,0,4),(3,3,4),(4,2,4)] (0,3,4) (4,2,3) ] - --- moving the cursor within the cube -data CursorResult = CursorStepped | - CursorOutOfBounds | - CursorSuccess deriving (Show, Eq, Typeable) - -stepCursor :: FieldVec -> FieldVec -> Cuboid -> (FieldVec, CursorResult) -stepCursor start (x, y, z) cubo = let - dim = cbDim cubo - (x', y', z') = start - pos = (x'+x, y'+y, z'+z) - (a, b, c) = pos - (a', b', c') = cbGoal cubo - (fv, rval) - | (a == a' && b == b' && c == c') = (pos, CursorSuccess) - | elem pos (cbField cubo) = (start, CursorStepped) - | a < 0 || a >= dim || b < 0 || b >= dim || c < 0 || c >= dim = (pos, CursorOutOfBounds) - | otherwise = stepCursor pos (x, y, z) cubo - in (fv, rval) - - --- cuboid position into vec3 positions, depending on cuboid dimension -cuboFieldToPos :: Cuboid -> FieldVec -> Vec3 -cuboFieldToPos cubo (x, y, z) = (Vec3 (posFromI x) (posFromI y) (posFromI z)) where - dim = fromIntegral (cbDim cubo) - step = scaleC / dim - start = step * (1- dim) / 2.0 - posFromI i = start + ((fromIntegral i) * step) - --- scaling1 constants, geometry constants -scaleC = 30.0 -sizeC = scaleC * 0.9 / 100.0 -- standard creation routines of cube and sphere create 100.0 large elements (diameter) -timeMoveC = 1.0 -nCubes = 12 -cameraPosC = Vec3 5.0 5.0 80.0 -cameraLookAtC = Vec3 0.0 (5.0) 0.0 -vcreate = Vec3 100.0 0.0 0.0 - -materialBlue = ResourceMaterial "Colours/Blue" -materialRed = ResourceMaterial "Colours/Red" -materialGreen = ResourceMaterial "Colours/Green" - -createMeshes = let - redMesh = sphereMesh - greenMesh = sphereMesh - blueMesh = cubeMesh - in (redMesh, greenMesh, blueMesh) - -createElement g3ds mesh material pos size = do - elem3d <- object3DFromMesh g3ds mesh (Just material) False - positionTo3D elem3d pos - scaleTo3D elem3d (Vec3 size size size) - return elem3d - -_createLine g3ds a b colour = do - m <- colouredLineMesh g3ds a b colour - elem3d <- object3DFromMesh g3ds m Nothing False - return elem3d - -create3dLines g3ds cubo = do - let lineColour = Colour 1.0 1.0 1.0 1.0 - let dim = 5 - let linePairs = let - m = (cbDim cubo)-1 - (a, b, c, d) = ( (0,0,0),(m, 0, 0),(m, m, 0),(0, m, 0) ) - (a', b', c', d') = ( (0, 0, m), (m, 0, m), (m, m, m), (0, m, m) ) - in [ (a, b), (b, c), (c, d), (d, a), (a', b'), (b', c'), (c', d'), (d', a'), (a, a'), (b, b'), (c, c'), (d, d')] - lines <- mapM (\(a, b) -> do - line <- _createLine g3ds a b lineColour - return line - ) (fmap ( \(a, b) -> ((cuboFieldToPos cubo a), (cuboFieldToPos cubo b) )) linePairs) - let fc = 1.0 + (1.0 / ( (fromIntegral (cbDim cubo)) - 1 ) ) - mapM (\l -> scaleTo3D l (Vec3 fc fc fc)) lines - return lines - -createSpheres g3ds redMesh greenMesh = do - let size = sizeC / 5.0 - sphereRed <- createElement g3ds redMesh materialRed vcreate size - sphereGreen <- createElement g3ds greenMesh materialGreen vcreate size - return (sphereRed, sphereGreen) - -createCubes g3ds blueMesh = do - let size = sizeC / (fromIntegral 5) - cubes <- mapM (\v -> createElement g3ds blueMesh materialBlue vcreate size) [0..nCubes-1] - return cubes - -cubeStartPos :: Int -> Vec3 -cubeStartPos = (\x -> if even x then Vec3 (-60.0) 0.0 0.0 else Vec3 60.0 0.0 0.0) - -createSounds :: IO [AudioSource] -createSounds = do - setAudioMainVolume 100.0 - msounds <- mapM createSound ["pling.wav", "atone.wav", "dundundun.wav", "magicwand.wav"] - return $ map fromJust msounds - - --- GAME COMMANDS AND LOGIC - --- most game command wires are made up of a switch, which generates a new wire, once a command of specific type is received --- most of the logic is sending and receiving events of specific types - --- runLevelW - receives two event, one left, one right --- left event switches into new cycle of cuboids (this is one level) --- right event simply gets the next cuboid from the current level -runLevelW :: GameWire (Event Level, Event a) (Event Cuboid) -runLevelW = switchIntoAndRunW (\level -> cycleW level) - --- this wire receives a new cube and then removes all the participants into the right places --- after all is finalized, it sends the new cube to the instance handling the keypresses --- -buildCuboidW :: Entity -> Entity -> [Entity] -> GameWire (Event Cuboid) (Event Cuboid) -buildCuboidW redSphere greenSphere blueCubes = switchIntoAndRunW' (\cubo -> wireMove cubo redSphere greenSphere blueCubes) where - - wireMove cubo redSphere greenSphere blueCubes = let - - posOutArr = map (\i -> ( blueCubes !! i, cubeStartPos i) ) [(length (cbField cubo)) .. (nCubes-1)] - moveCubesOut = foldl1 (-->) (fmap (\(e, pos) -> moveTo e pos 0.1) posOutArr) - moveCubesIn = foldl1 (-->) (fmap (\(e, pos) -> moveTo e pos 0.5) - (zip blueCubes (fmap (cuboFieldToPos cubo) (cbField cubo)))) - moveSpheres = moveTo redSphere (cuboFieldToPos cubo (cbStart cubo)) 0.5 --> - moveTo greenSphere (cuboFieldToPos cubo (cbGoal cubo)) 0.5 - in pure (NoEvent) . moveCubesOut --> pure (NoEvent) . moveSpheres --> pure (NoEvent) . moveCubesIn - --> sendOnce . now . pure cubo - -getStepsFromKeyW :: Entity -> GameWire () (Event FieldVec) -getStepsFromKeyW combobj = (proc _ -> do - q <- mkGen_ (\e -> do u <- getOrientation e; return $ Right (fromJust u)) -< combobj - let v = q `actU` (Vec3 0.0 0.0 1.0) - let (y, z) = (_2 v, _3 v) - let (upFv, downFv, qFv, aFv) = ((0, 1, 0), (0, -1, 0), (0, 0, -1), (0, 0, 1)) - let (upFv', downFv', qFv', aFv') - | z > 0.5 = (upFv, downFv, qFv, aFv) - | y < -0.5 = (qFv, aFv, downFv, upFv) - | z <= -0.5 = (downFv, upFv, aFv, qFv) - | y >= 0.5 = (aFv, qFv, upFv, downFv) - - dir <- keyW KeyLeft . pure "l" <& keyW KeyRight . pure "r" <& - keyW KeyUp . pure "u" <& keyW KeyDown . pure "d" <& - keyW KeyPageUp . pure "q" <& keyW KeyPageDown . pure "a" -< () - - let dir'' = case dir of - Event dir' -> Event $ fromJust $ lookup dir' - [("l",(-1, 0, 0)), ("r",(1, 0, 0)), ("u",upFv'), - ("d",downFv'), ("q",qFv'), ("a",aFv')] - NoEvent -> NoEvent - - returnA -< dir'') - - --- A state is modified by a function, until a predicate is met. --- In between each step a wire with the old and new state is run. - -stateStepperW :: a -> (a -> b -> a) -> (a -> Bool) -> (a -> a -> (GameWire (Event b) (Event ())) ) -> GameWire (Event b) (Event ()) -stateStepperW startState stateF pred wire = switch $ mkPure_ (\evtB -> case evtB of - Event val -> let - nextState = stateF startState val - finish = pred nextState - nextWire = if finish then sendOnce . now . pure () else stateStepperW nextState stateF pred wire - in Right (NoEvent, Event (wire startState nextState --> nextWire)) - NoEvent -> Right (NoEvent, NoEvent)) - - - --- this wire runs one cuboid and upon completion, it sends an anonymous event -runCuboidW :: [AudioSource] -> Entity -> GameWire (Event Cuboid, Event FieldVec) (Event ()) -runCuboidW sounds redSphere = switchIntoAndRunW (\cuboid -> processCuboW cuboid ) where - - processCuboW cubo = stateStepperW startState stateF pred wire where - - startState = (cbStart cubo, CursorStepped) - stateF = \(pos, res) nextStepFV -> if res == CursorOutOfBounds then - stepCursor (cbStart cubo) nextStepFV cubo - else - stepCursor pos nextStepFV cubo - pred = \(pos, res) -> res == CursorSuccess - wire (startPos, startRes) (endPos, endRes) = let - startSound = 0 - stopSound = case endRes of - CursorOutOfBounds -> 2 - CursorSuccess -> 3 - CursorStepped -> 1 - moveToPos = moveTo redSphere (cuboFieldToPos cubo endPos ) 1.0 - moveToEnd = if endRes == CursorOutOfBounds then - moveTo redSphere (cuboFieldToPos cubo (cbStart cubo)) 1.0 - else mkEmpty - in playSoundW sounds startSound --> pure (NoEvent) . moveToPos --> - playSoundW sounds stopSound --> pure (NoEvent) . moveToEnd --> mkEmpty - - -playSoundW sounds i = mkEmpty . soundW (sounds !! i) . now . pure () - --- THE MAIN PROGRAM - -renderLoop g3ds guis s w cmd = do - (ds, s') <- stepSession s - (cmd', w') <- stepWire w ds (Right cmd) - let cmd'' = case cmd' of - (Right (Event cmd''')) -> (Event cmd''') - _ -> Event CmdNoOp - (evt, qFlag) <- loopHGamer3D g3ds guis - if qFlag then return () else renderLoop g3ds guis s' w' cmd'' - -main = do - (g3ds, guis, camera, viewport) <- initHGamer3D "HGamer3D - Cuboid2" True False True - - positionTo3D camera cameraPosC - cameraLookAt camera cameraLookAtC - let white = Colour 1.0 1.0 1.0 1.0 - setAmbientLight g3ds white - light <- pointLight g3ds white (Vec3 10.0 10.0 20.0) - loadGuiScheme guis "hg3d.scheme" - cuboLayout <- loadGuiLayoutFromFile guis "cuboid2.layout" "" - addGuiElToDisplay guis cuboLayout - - let (redMesh, greenMesh, blueMesh) = createMeshes - (sphereRed, sphereGreen) <- createSpheres g3ds redMesh greenMesh - - rE <- veloEntity "s1" sphereRed (Vec3 (-60.0) 0.0 0.0) - gE <- veloEntity "s2" sphereGreen (Vec3 60.0 0.0 0.0) - - lines <- create3dLines g3ds (oneAndOnlyLevel !! 0) - cubes <- createCubes g3ds blueMesh - cbsE <- mapM (\(i, o) -> veloEntity ("cube" ++ (show i)) o (cubeStartPos i)) (zip [0..] cubes) - - combined <- object3DFromObjects g3ds $ [sphereRed, sphereGreen] ++ lines ++ cubes - cE <- rotEntity "combi" combined unitU - - sounds <- createSounds - - -- create the systems - let x = (Vec3 1.0 0.0 0.0) - let locSysW = createSystem locationSystem - let oriSysW = createSystem orientationSystem - let velSysW = createSystem velocitySystem - - -- create game logic wire - let gameWire re ge ce = proc inCmd -> do - rec - -- run Level - - -- currently, we only have one level, inject this in the beginning - evtNewLevel <- now -< oneAndOnlyLevel - -- get first next cuboid event - evtNextCuboid' <- delay (Event ()) -< evtNextCuboid - -- on next cuboid event, get a new cuboid from level - evtCuboid <- buildCuboidW rE gE cbsE . runLevelW -< (evtNewLevel, evtNextCuboid') - - -- run one cuboid - - -- create a movement event, which moves the red sphere from a key - evtMove <- getStepsFromKeyW ce -< () - evtNextCuboid <- runCuboidW sounds re -< (evtCuboid, evtMove) - - - (rotate ce x 1.0) . keyW KeyW -< inCmd - (rotate ce x (-1.0)) . keyW KeyS -< inCmd - outVal <- cmdFifo . locSysW . velSysW . oriSysW -< inCmd - - returnA -< outVal - - let startCmd = CmdArr [ - (CmdAddEntity rE), - (CmdAddEntity gE), - (CmdAddEntity cE), - (CmdArr (map CmdAddEntity cbsE)) - ] - - renderLoop g3ds guis clockSession_ (gameWire rE gE cE) (Event startCmd) - exitHGamer3D g3ds guis - return () - - - diff --git a/Examples/Games/EntityComponentSystem.hs b/Examples/Games/EntityComponentSystem.hs deleted file mode 100644 index 88710a6..0000000 --- a/Examples/Games/EntityComponentSystem.hs +++ /dev/null @@ -1,284 +0,0 @@ -{-# LANGUAGE Arrows #-} - --- (c) 2014 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - - --- this module will probably not be part of future API --- it is solely for testing new paradigms in game programming --- the state modifications by IORef might be replaced in the future - -module EntityComponentSystem where - -import Control.Wire -import Control.Wire.Unsafe.Event - -import Prelude hiding ((.), id) -import Data.List -import Data.IORef -import qualified Data.Map as M - -import HGamer3D - -import GameWire - -type CommandWire = GameWire (Event Command) (Event Command) - --- Commands ------------ - --- all commands go into one type (for now) -data Command = CmdArr [Command] - | CmdAddEntity Entity - | CmdRemEntity ObId - | CmdMoveTo Vec3 Time - | CmdNoOp - - --- a wire which deconstructs a CmdArr into a sequence of single events --- single commands will be ignored and not added to the list --- to be added into a chain of command senders, receivers -cmdFifo :: CommandWire -cmdFifo = fifo_ [] where - fifo_ list = mkPureN (\cmdIn -> let - newList = case cmdIn of - (Event (CmdArr addList)) -> list ++ addList - _ -> list -- do not add single command here, intentionally, this will create an infinite loop in a chain - (evtOut, listOut) = case newList of - [] -> (NoEvent,[]) - (e:es) -> (Event e, es) - in (Right evtOut, fifo_ listOut) ) - --- Entity Component System --------------------------- - --- this is a prototype implementation to show the potential --- IORef's are solely used in the system data aka components of the engine --- (reading some ECS literature, I thought implementing components as pure FRP might be a big hassle) - --- object ids will be simple string -type ObId = String - --- an entity has an object id and components -data Entity = Entity { entId :: ObId, entComps :: [Component] } - --- SYSTEMS - -data SystemData d = SystemData { - sdInitialize :: d, - sdAddEntity :: Entity -> d -> d, - sdRemoveEntity :: ObId -> d -> d, - sdRunAction :: d -> RunState -> IO () -- only side effects on the IORef data, but complete set as input! - } - -createSystem :: SystemData d -> CommandWire -createSystem sdata = let - - (SystemData initD addE remE runAction) = sdata - dOut dIn evt = case evt of - (Event (CmdAddEntity ent)) -> (addE ent dIn) - (Event (CmdRemEntity oid)) -> (remE oid dIn) - _ -> dIn - wire dIn = mkGen (\s evt -> do - let out = dOut dIn evt - runAction out s - return (Right evt, wire out) ) - in wire initD - --- COMPONENTS - -modifyIORef'' :: IORef a -> (a -> a) -> IO () -modifyIORef'' ref f = do - x <- readIORef ref - let x' = (f x) - x' `seq` writeIORef ref x' - --- a component holds the "data", a state with an identity, there are different types of components --- each component comes with its onwn type of system -data Component = Location (IORef Vec3) - | Orientation (IORef UnitQuaternion) - | GObj Object3D - | Velocity (IORef Vec3) - --- LOCATION - -location :: Component -> Bool -location (Location _) = True -location _ = False - -getLocation :: Entity -> IO (Maybe Vec3) -getLocation e = case e `gC` location of - Just (Location l) -> do - val <- readIORef l - return $ seq val (Just val) - _ -> return Nothing - -setLocation :: Entity -> (Vec3 -> Vec3) -> IO () -setLocation e f = do - case e `gC` location of - Just (Location l) -> do - modifyIORef'' l f - return () - _ -> return () - -locationSystem :: SystemData (M.Map ObId (IORef Vec3, Object3D)) -locationSystem = let - fInit = M.fromList [] :: M.Map ObId (IORef Vec3, Object3D) - fAdd e mapIn = case (e `gC` location, e `gC` gObj) of - (Just (Location ref), Just (GObj o3d)) -> M.insert (entId e) (ref, o3d) mapIn - _ -> mapIn - fRem = M.delete - runAction mapIn _ = do - mapM (\(ref, obj3D) -> do - pos <- readIORef ref - positionTo3D obj3D pos ) (map snd (M.toList mapIn)) - return () - in (SystemData fInit fAdd fRem runAction) - - --- move position of Entity by a vector (per second) -move :: Entity -> Vec3 -> GameWire (Event a) (Event a) -move e vec = mkGen $ \s evt -> case evt of - Event _ -> do - let t = realToFrac (dtime s) - setLocation e (\pos -> pos &+ (vec &* t)) - return $ (Right evt, move e vec) - _ -> return (Right evt, move e vec) - - --- ORIENTATION - -orientation :: Component -> Bool -orientation (Orientation _) = True -orientation _ = False - -getOrientation :: Entity -> IO (Maybe U) -getOrientation e = case e `gC` orientation of - Just (Orientation o) -> do - val <- readIORef o - return $ seq val (Just val) - _ -> return Nothing - -setOrientation :: Entity -> (U -> U) -> IO () -setOrientation e f = do - case e `gC` orientation of - Just (Orientation o) -> modifyIORef'' o f - _ -> return () - -orientationSystem :: SystemData (M.Map ObId (IORef UnitQuaternion, Object3D)) -orientationSystem = let - fInit = M.fromList [] :: M.Map ObId (IORef UnitQuaternion, Object3D) - fAdd e mapIn = case (e `gC` orientation, e `gC` gObj) of - (Just (Orientation ref), Just (GObj o3d)) -> M.insert (entId e) (ref, o3d) mapIn - _ -> mapIn - fRem = M.delete - runAction mapIn _ = do - mapM (\(ref, obj3D) -> do - ori <- readIORef ref - orientationTo3D obj3D ori) (map snd (M.toList mapIn)) - return () - in (SystemData fInit fAdd fRem runAction) - -rotate :: Entity -> Vec3 -> Float -> GameWire (Event a) (Event a) -rotate e rv a = mkGen $ \s evt -> case (evt, (e `gC` orientation)) of - (Event _, Just (Orientation r)) -> do - let t = realToFrac (dtime s) - modifyIORef'' r (\ori -> ori .*. (rotU rv (a*t))) - return $ (Right evt, rotate e rv a) - _ -> return $ (Right evt, rotate e rv a) - - --- Object3D COMPONENT - -gObj :: Component -> Bool -gObj (GObj _) = True -gObj _ = False - -gC :: Entity -> (Component -> Bool) -> Maybe Component -gC e f = find f (entComps e) - --- VELOCITY - -velocity :: Component -> Bool -velocity (Velocity _) = True -velocity _ = False - -setVelocity :: Entity -> (Vec3 -> Vec3) -> IO () -setVelocity e f = do - case e `gC` velocity of - Just (Velocity v) -> modifyIORef'' v f - _ -> return () - -velocitySystem :: SystemData (M.Map ObId (IORef Vec3, IORef Vec3)) -velocitySystem = let - fInit = M.fromList [] :: M.Map ObId (IORef Vec3, IORef Vec3) - fAdd e mapIn = case (e `gC` velocity, e `gC` location) of - (Just (Velocity rV), Just (Location rP)) -> M.insert (entId e) (rV, rP) mapIn - _ -> mapIn - fRem = M.delete - runAction mapIn s = do - mapM (\(rV, rP) -> do - vel <- readIORef rV - let t = realToFrac $ dtime s :: Float - modifyIORef'' rP (\pos -> pos &+ (vel &* t)) ) (map snd (M.toList mapIn)) - return () - in (SystemData fInit fAdd fRem runAction) - -accelerate :: Entity -> Vec3 -> GameWire (Event a) (Event a) -accelerate e vec = mkGen_ $ \evt -> case (evt, (e `gC` velocity)) of - (Event _, Just (Velocity r)) -> do - modifyIORef'' r (\vel -> vel &+ vec) - return $ (Right evt) - _ -> return $ (Right evt) - - --- move position to target within specific time -moveTo :: Entity -> Vec3 -> Float -> GameWire a () -moveTo e target dt = let - startAction = do - mLoc <- getLocation e - case mLoc of - Just loc -> do - let vel = (target &- loc) &* (1.0 / dt) - setVelocity e (\_ -> vel) - return $ Left () - _ -> return $ Left () - endAction = do - setVelocity e (\_ -> (Vec3 0.0 0.0 0.0)) - setLocation e (\_ -> target) - return $ Left () - in (mkGen_ (\_ -> startAction)) --> for (realToFrac dt) . pure () --> (mkGen_ (\_ -> endAction)) - --- create entity with a graphics object, a location and a velocity -veloEntity :: String -> Object3D -> Vec3 -> IO Entity -veloEntity name obj pos = do - ref <- newIORef pos - vel <- newIORef (Vec3 0.0 0.0 0.0) - let e = Entity name [ - Location ref, - Velocity vel, - GObj obj - ] - return e - --- create entity with a graphics object and a rotation, only -rotEntity :: String -> Object3D -> UnitQuaternion -> IO Entity -rotEntity name obj ori = do - ref <- newIORef ori - let e = Entity name [ - Orientation ref, - GObj obj - ] - return e - diff --git a/Examples/Games/GameWire.hs b/Examples/Games/GameWire.hs deleted file mode 100644 index 3ff6ef9..0000000 --- a/Examples/Games/GameWire.hs +++ /dev/null @@ -1,113 +0,0 @@ -{-# LANGUAGE Arrows #-} - --- Some useful wires for game programming --- --- (c) 2014 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - -module GameWire where - -import Control.Wire as W -import Control.Wire.Unsafe.Event as U - -import Prelude hiding ((.), id) - -import HGamer3D.Audio -import HGamer3D.InputSystem - --- TYPES - -type Time = Double -type RunState = (Timed NominalDiffTime ()) -type GameWire = Wire RunState () IO - - --- USEFUL WIRES - --- sends the event one time and then inhibit ! - -sendOnce :: GameWire (W.Event a) (W.Event a) -sendOnce = proc inevt -> do - rec - devt <- delay (U.NoEvent) -< devt' - devt' <- id -< inevt - case devt of - U.NoEvent -> do - returnA -< inevt - U.Event evt -> do - x <- pure U.NoEvent . mkEmpty -< () - returnA -< x - --- wire to play a sound -soundW :: AudioSource -> Wire s e IO (W.Event a) (W.Event a) -soundW aSource = onEventM (\aIn -> do - playAudioSource aSource - return aIn ) - --- samples generated keypress -keyW :: EnumKey -> Wire s e IO a (W.Event a) -keyW key = mkGen_ ( \inVal -> do - press <- isKeyPressed key - let evt = if press then U.Event inVal else U.NoEvent - return $ (Right evt) ) - --- Cycles through a list, stop at end -cycleW :: [b] -> Wire s () IO (W.Event a) (W.Event b) -cycleW lin = if length lin > 0 then - mkPureN (\evt -> case evt of - U.Event _ -> (Right (U.Event (head lin)), cycleW (tail lin)) - _ -> (Right U.NoEvent, cycleW lin) ) - else - mkConst $ Left () - - -printEvt :: Show a => GameWire (W.Event a) (W.Event a) -printEvt = mkGen_ (\evt -> do case evt of - U.Event x -> do - print x - return (Right evt) - _ -> return (Right evt)) - - --- generic switch, in event is two-fold, left side creates new wire of a -> b --- right side is a output is b, runs sequentially, first do new wire switched in, then restart switch logic - --- different types of switching logic, eases up game programming ----------------------------------------------------------------- - --- this wire creates a wire from a function which creates a wire from an input status --- the resulting wire switches into the created wire, runs this until it inihibits and then --- switches back to the switchIntoAndRun semantics - --- useful for providing game states, which run for a certain amount of time and then wait for a new --- initializer, during running the created wire additional state input is ignored - -switchIntoAndRunW :: (gst -> GameWire (Event a) (Event b)) -> GameWire (Event gst, Event a) (Event b) -switchIntoAndRunW inWireF = switch $ mkPure_ (\(gsEvt, aEvt) -> case gsEvt of - Event gs -> let - newWire = (inWireF gs) . mkPure_ (\(a, b) -> Right b) --> switchIntoAndRunW inWireF - in Right (NoEvent, Event (newWire)) - _ -> Right (NoEvent, NoEvent) ) - --- same logic, but does not need to process events during run phase --- usefule if something needs to happen, but no input processing -switchIntoAndRunW' :: (gst -> GameWire () (Event b)) -> GameWire (Event gst) (Event b) -switchIntoAndRunW' inWireF = switch $ mkPure_ (\gsEvt -> case gsEvt of - Event gs -> let - newWire = (inWireF gs) . pure () --> switchIntoAndRunW' inWireF - in Right (NoEvent, Event (newWire)) - _ -> Right (NoEvent, NoEvent) ) - - - diff --git a/Examples/Games/YWing-Flight-Readme.txt b/Examples/Games/YWing-Flight-Readme.txt deleted file mode 100644 index 5c93511..0000000 --- a/Examples/Games/YWing-Flight-Readme.txt +++ /dev/null @@ -1,69 +0,0 @@ -HGamer3D - YWing-Flight Example -------------------------------- - - -(c) 2011-2012 Peter Althainz - - -HGamer3D (http://www.hgamer3d.org) ----------------------------------- - -HGamer3D is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -Compile -------- -For compilation you need to install runtime and haskell libraries, see http://www.hgamer3d.org/Install.html. - -Media ------ - -Sound: New Friendly.wav ------------------------ -Sound by Kevin MacLeod, www.incompetech.com, license creative commons 3, credit given by text in configuration dialog (do not remove) -Details: - File: "New Friendly.wav" - Genre: Electronica - Time: 2:49 - Instruments: Synths, Choir - 114 BPM (Moderato - A Bit Fast) - ISRC: USUAN1200005 - © 2009 Kevin MacLeod - -YWing-Model ------------ -YWing-Model by Al Meerow, model downloaded from www.scifi3d.com. -http://www.scifi3d.com - -permission from Al Meerow to distribute with HGamer3D is given, Feb. 2012 by e-mail. - - -Original files: - ywing3DS.zip - -Description and Version: - 3D Model, by Al Meerow. Including Textures, 3DS format. - -Obtained from: - http://www.scifi3d.com - http://www.scifi3d.com/details.asp?intGenreID=10&intCatID=10&key=54 - -Date: January, 2012 - -Used Parts/Usage: - Mesh and Textures used, Mesh converted to Ogre Format. - -Distribution: - Ogre formatted version and graphics are distributed in installer. - Further distribution possible, if licenses and obligations are - fulfilled. - -License Source: - Displayed, during download from website above, see Dep-Licenses/ywing-model/www.sifi3d.com-usage-terms.txt. - -Remarks to License (you still need to fulfill the complete license): - If you use it, you need to give author (Al Meerow) and www.scifi3d.com proper credits (display). - diff --git a/Examples/Games/YWing-Flight.hs b/Examples/Games/YWing-Flight.hs deleted file mode 100644 index 453ae84..0000000 --- a/Examples/Games/YWing-Flight.hs +++ /dev/null @@ -1,396 +0,0 @@ --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.althainz.de/HGamer3D.html --- --- (c) 2011, 2014 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - - --- YWing-Flight.hs - -module Main where - -import HGamer3D -import HGamer3D.InputSystem -import HGamer3D.Audio - -import Control.Monad -import Control.Monad.Trans -import Data.IORef - --- some basic vectors -xv = Vec3 1.0 0.0 0.0 -yv = Vec3 0.0 1.0 0.0 -zv = Vec3 0.0 0.0 1.0 -v0 = Vec3 0.0 0.0 0.0 - --- functions, to rotate on axis, relative to object -rotRelativeToObjectAxis :: Object3D -> Vec3 -> Float -> IO () -rotRelativeToObjectAxis object axis val = do - qob <- orientation3D object - let odir = actU qob axis - let qrot = rotU odir val - let nrot = qrot .*. qob - orientationTo3D object nrot - return () -moveYaw object val = rotRelativeToObjectAxis object yv val -moveRoll object val = rotRelativeToObjectAxis object zv val -movePitch object val = rotRelativeToObjectAxis object xv val - --- function, to move into direction of flight -moveTrans :: Object3D -> Float -> IO () -moveTrans object val = do - quat <- orientation3D object - -- this points towards nose - let vdir = actU quat zv - translate3D object ( val *& vdir) - return () - --- Mover, encapsulation of moving by input source -data Mover = Mover Float EnumJoystickAxis (Object3D -> Float -> IO ()) - -doMover :: Object3D -> Mover -> Joystick -> IO () -doMover object (Mover val axis mover) joystick = do - updateJoystickStatus - valAction <- getJoystickAxisPosition joystick axis - if (abs valAction) > 2 then do - mover object (valAction * val) - return () - else return () - -createMover :: EnumJoystickAxis -> Float -> (Object3D -> Float -> IO ()) -> Mover -createMover axis value movef = (Mover value axis movef) - -createMovers :: [Mover] -createMovers = map (\(axis, factor, movef) -> createMover axis factor movef) [ - - (JoystickAxisX, -0.00005, moveYaw), - (JoystickAxisY, -0.00005, movePitch), - (JoystickAxisR, -0.00005, moveRoll), - (JoystickAxisZ, -0.15, moveTrans) ] - --- camera position management ] -setNewCameraPosition :: Camera -> Object3D -> [(Vec3, UnitQuaternion)] -> IO () -setNewCameraPosition c ywing newhist = do - - wingpos <- position3D ywing - let (pos, quat) = newhist !! 20 - -- this points towards nose - let zdir = actU quat zv - let ydir = actU quat yv - let newcampos = ( (-50.0) *& zdir) &+ pos &+ (20.0 *& ydir) - - positionTo3D c newcampos - directionTo3D c (wingpos &- newcampos) - return () - - --- Joystick selection handling - -initJoystickState outtext = do - ref <- liftIO $ newIORef (Nothing::Maybe Joystick) - setGuiElProperty outtext "Text" "Press C to configure!" - return ref - -type StepFuncStateType = ( GUIElement, [Mover], Object3D, Object3D, [(Vec3, UnitQuaternion)], IORef (Maybe Joystick), Graphics3DSystem, GUISystem, Camera) - -selectJoystick :: GUIElement -> GUIElement -> IORef (Maybe Joystick) -> IO () -selectJoystick comboWin confWin selRef = do - -- define js - txt <- getGuiElProperty comboWin "Text" --- liftIO $ print ("selected text: " ++ txt) - let js = snd ((filter (\(t,j) -> t == txt) [ ("Joystick " ++ (show x), Joystick x)| x <- [0..20]] ) !! 0) --- liftIO $ print ("selected js: " ++ (show js)) - -- setGuiElProperty outtext "Text" "Joystick selected!" - setGuiElProperty confWin "Visible" "False" - liftIO $ writeIORef selRef (Just js) - return () - - - -setupVolumeSlider guis window = do - - slider <- findChildGuiElRecursive window "SliderMusicVolume" - - case slider of - Just sliderWin -> do - setGuiElProperty sliderWin "CurrentValue" "100.0" - registerGUIEvent guis sliderWin "ValueChanged" "VolumeTag" - return () - Nothing -> do - return () - - -setupJoystickSelectionBox guis window ref = do - - combo <- findChildGuiElRecursive window "ComboboxJoystick" - case combo of - Just comboWin -> do - addGuiElToDisplay guis window - - -- for all joysticks found - let ns = [ x | x <- [0..10]] - updateJoystickStatus - js <- filterM (\x -> do - c <- isJoystickConnected (Joystick x) - return c ) ns - - mapM (\joyn -> do - let joy = (Joystick joyn) - comboboxAddText comboWin ("Joystick " ++ (show joyn)) - ) js - - registerGUIEvent guis comboWin "ListSelectionAccepted" "JoystickTag" - return () - Nothing -> do - return () - --- function called during each frame -stepFunc :: StepFuncStateType -> IO StepFuncStateType -stepFunc (configwin, movers, world, ywing, history, joyState, g3ds, guis, camera) = do - - -- check if F1 key is pressed for selection menue - flagMenu <- isKeyPressed KeyC - if flagMenu then do - setGuiElProperty configwin "Visible" "True" - return (configwin, movers, world, ywing, history, joyState, g3ds, guis, camera) - else do - - - -- do moves, only if Joystick selected - jState <- liftIO $ readIORef joyState - case jState of - Just js -> do - sequence $ map ( \m -> doMover ywing m js) movers - - -- get new position and orientation - q <- orientation3D ywing - pos <- position3D ywing - let newhist = history ++ [(pos, q)] - - - -- work on history - if length newhist > 30 then do - let newhist2 = drop 1 newhist - setNewCameraPosition camera ywing newhist - return (configwin, movers, world, ywing, newhist2, joyState, g3ds, guis, camera) - else return (configwin, movers, world, ywing, newhist, joyState, g3ds, guis, camera) - - Nothing -> return (configwin, movers, world, ywing, history, joyState, g3ds, guis, camera) - - --- build the world in 3D - -createCubeTemplates g3ds = do - - -- create ring templates - let col = Colour 1.0 1.0 1.0 1.0 - let red = Colour 1.0 0.0 0.0 1.0 - let yellow = Colour 1.0 1.0 0.0 1.0 - blueT <- colouredCubeMesh g3ds col - redT <- colouredCubeMesh g3ds red - yellowT <- colouredCubeMesh g3ds yellow - return (blueT, redT, yellowT) - - -createGates g3ds thickness freespace depth cubeT r = do - - -- parameters horizontal bars - let hl = freespace + thickness -- length horizontal bar - let hw = thickness/2.0 -- width horizontal bar - let hpt = Vec3 0.0 (freespace + thickness/2.0) 0.0 -- horizontal bar, position top - let hpb = Vec3 0.0 (-1.0 * (freespace + thickness/2.0)) 0.0 -- horizontal bar, position bottom - - -- create top and bottom cube - top <- object3DFromMesh g3ds cubeT (Just (ResourceMaterial "YWing/Blue50")) False - bottom <- object3DFromMesh g3ds cubeT (Just (ResourceMaterial "YWing/Blue50")) False - scaleTo3D top (Vec3 hl hw depth) - scaleTo3D bottom (Vec3 hl hw depth) - positionTo3D top hpt - positionTo3D bottom hpb - - -- parameters vertical bars - let vl = freespace -- vertical bar, length - let vw = thickness/2.0 -- vertical bar, width - let vpr = Vec3 (freespace + thickness/2.0) 0.0 0.0 -- vertical bar, position right - let vpl = Vec3 (-1.0 * (freespace + thickness/2.0)) 0.0 0.0 - - -- create left and right cube - left <- object3DFromMesh g3ds cubeT (Just (ResourceMaterial "YWing/Blue50")) False - right <- object3DFromMesh g3ds cubeT (Just (ResourceMaterial "YWing/Blue50")) False - scaleTo3D left (Vec3 vw vl depth) - scaleTo3D right (Vec3 vw vl depth) - positionTo3D left vpl - positionTo3D right vpr - - gate <- object3DFromObjects g3ds [top, bottom, left, right] - translate3D gate (Vec3 0.0 0.0 r) - - return gate - - -createLines g3ds space cubeAT cubeBT r = do - - let x = 0.0 - let y = 0.0 - let z = 0.0 - - -- yellow and red lines along the way - let a1 = Vec3 (x + space) y z - let a2 = Vec3 (x - space) y z - let a3 = Vec3 x (y + space) z - let a4 = Vec3 x (y - space) z - let ascale = Vec3 0.5 0.5 5.0 - - red1 <- object3DFromMesh g3ds cubeAT (Just (ResourceMaterial "YWing/Red50")) False - positionTo3D red1 a1 - scaleTo3D red1 ascale - - yellow1 <- object3DFromMesh g3ds cubeBT (Just (ResourceMaterial "YWing/Yellow50")) False - positionTo3D yellow1 a3 - scaleTo3D yellow1 ascale - - red2 <- object3DFromMesh g3ds cubeAT (Just (ResourceMaterial "YWing/Red50")) False - positionTo3D red2 a2 - scaleTo3D red2 ascale - - yellow2 <- object3DFromMesh g3ds cubeBT (Just (ResourceMaterial "YWing/Yellow50")) False - positionTo3D yellow2 a4 - scaleTo3D yellow2 ascale - - -- combine all and give back correct i for further processing - lines <- object3DFromObjects g3ds [red1, red2, yellow1, yellow2] - translate3D lines (Vec3 0.0 0.0 r) - - - return lines - - --- function calculating flow of gates in the world -modifyPos x object = do - - translate3D object (Vec3 (100*(sin (x/500.0))) (100*(cos (x/500.0))) 0.0) - return object - - -createLineCubes g3ds = do - - (blueT, redT, yellowT) <- createCubeTemplates g3ds - - gates <- mapM (\r -> createGates g3ds 20.0 100.0 10.0 blueT r >>= modifyPos r ) (map (\x -> 100.0 * x) [1..1000]) - lines <- mapM (\r -> createLines g3ds 60.0 redT yellowT r >>= modifyPos r ) (map (\x -> 20.0 * x) [1..5000]) - - lc <- object3DFromObjects g3ds (gates ++ lines) - return lc - -doGUIEvents guis configWindow joyState event = do - case event of - GUIEvent tag sender window -> do - case tag of - "VolumeTag" -> do - val <- getGuiElProperty window "CurrentValue" - setAudioMainVolume (read val) - return () - "JoystickTag" -> do - selectJoystick window configWindow joyState - return () - - -checkEvents g3ds guis configWindow joyState = do - (evt, qFlag) <- loopHGamer3D g3ds guis - if qFlag then - return False - else - case evt of - Just (EventGUI evts) -> do - mapM (\evt -> doGUIEvents guis configWindow joyState evt) evts - return True - Just (EventWindow (EvtQuit ts)) -> return False - _ -> return True - -renderLoop (configwindow, movers, world, ywing, hist, joyState, g3ds, guis, camera) = do - (configwindow, movers, world, ywing, hist, joyState, g3ds, guis, camera) <- stepFunc (configwindow, movers, world, ywing, hist, joyState, g3ds, guis, camera) - proceed <- checkEvents g3ds guis configwindow joyState - if proceed then renderLoop (configwindow, movers, world, ywing, hist, joyState, g3ds, guis, camera) else return () - - --- main 3d program -main = do - (g3ds, guis, c, viewport) <- initHGamer3D "HGamer3D - YWing-Flight Example" True True True - - -- add media locations --- mediaDir <- getExeMediaDirectory --- addResourceZipfileMedia g3ds (mediaDir ++ osSep ++ "ywing.zip") - - -- camera position - let pos = Vec3 20.0 20.0 (-100.0) - positionTo3D c pos - let at = Vec3 0.0 0.0 (300.0) - directionTo3D c at - - -- load ywing - let ywingMesh = resourceMesh "ywing.mesh" - ywing <- object3DFromMesh g3ds ywingMesh Nothing False - scaleTo3D ywing (Vec3 0.05 0.05 0.05) - - lc <- createLineCubes g3ds - world <- object3DFromObjects g3ds ([ywing] ++ [lc]) - - -- define light - let col = Colour 1.0 1.0 1.0 1.0 - light <- pointLight g3ds col (Vec3 20.0 80.0 50.0) - setAmbientLight g3ds col - - -- GUI Code starts here, display hg3d logo - loadGuiScheme guis "hg3d.scheme" - logo <- loadGuiLayoutFromFile guis "hgamer3d.layout" "" - addGuiElToDisplay guis logo - - mu <- createMusic "New Friendly.wav" - case mu of - Just audio -> do - playAudioSource audio - return (Just audio) - Nothing -> do - return Nothing - - -- create Movers - let movers = createMovers - - configwindow <- loadGuiLayoutFromFile guis "ywing1.layout" "" - sttext <- loadGuiLayoutFromFile guis "ywing2.layout" "" - outtext <- findChildGuiElRecursive sttext "OutputTextBox" - - case outtext of - Just outtext -> do - addGuiElToDisplay guis outtext - joyState <- initJoystickState outtext - - setupJoystickSelectionBox guis configwindow joyState - setupVolumeSlider guis configwindow - - renderLoop (configwindow, movers, world, ywing, [], joyState, g3ds, guis, c) - return () - Nothing -> do - return () - - -- start render loop - exitHGamer3D g3ds guis - return () - - - - - - diff --git a/Examples/SConstruct b/Examples/SConstruct index 748f942..2a977c4 100644 --- a/Examples/SConstruct +++ b/Examples/SConstruct @@ -19,16 +19,14 @@ for (p, s) in [ ("BaseAPI", "Audio"), ("BaseAPI", "BlueCube"), -# ("BaseAPI", "BumpMappingCube"), + ("BaseAPI", "BumpMappingCube"), ("BaseAPI", "GUI-Widgets"), -# ("GUI", "GUI-Wire"), -# ("InputSystem", "Joystick"), -# ("InputSystem", "Keyboard"), -# ("InputSystem", "Mouse"), -# ("Network", "Network-Chat"), -# ("WinEvent", "WinEvent"), -# ("Games", "Cuboid2"), -# ("Games", "YWing-Flight") + ("BaseAPI", "Joystick"), + ("BaseAPI", "Keyboard"), + ("BaseAPI", "Mouse"), + ("BaseAPI", "Network-Chat"), + ("BaseAPI", "WinEvent") + ]: env.Command("build/" + s, [p + "/" + s + ".hs", "build/.HGamer3D" From d6c4ec231cbf7d0680d4974b351d1acd7215b5b5 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Sun, 27 Jul 2014 21:26:50 +0200 Subject: [PATCH 19/28] ECS Api added --- Examples/EcsAPI/GUI-Switch.hs | 181 ++++++++++++++++++++++++++++++++++ Examples/SConstruct | 10 +- 2 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 Examples/EcsAPI/GUI-Switch.hs diff --git a/Examples/EcsAPI/GUI-Switch.hs b/Examples/EcsAPI/GUI-Switch.hs new file mode 100644 index 0000000..8fb1951 --- /dev/null +++ b/Examples/EcsAPI/GUI-Switch.hs @@ -0,0 +1,181 @@ +{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} + +module Main + +where + +import HGamer3D.Data +import HGamer3D.Graphics3D.Schema.Material +import HGamer3D.Graphics3D.Schema.Geometry +import HGamer3D.Graphics3D.Schema.Figure +import HGamer3D.Graphics3D.Schema.Camera +import HGamer3D.Graphics3D.Schema.Light +import HGamer3D.Graphics3D.Schema.Scene + +import HGamer3D.GUI.Schema.Widget +import HGamer3D.GUI.Schema.Layout +import HGamer3D.GUI.Schema.Form +import HGamer3D.GUI.Schema.GUIDim + +import HGamer3D.Engine.Schema.EventReceiver +import HGamer3D.Engine.Schema.EventChannel + +import HGamer3D.Engine.Internal.Entity +import HGamer3D.Engine.Internal.Event + +import HGamer3D.Audio.Schema.AudioSource + +import HGamer3D.WinEvent.BaseAPI +import HGamer3D.Engine.EcsAPI +import HGamer3D.Audio.EcsAPI + +import Control.Concurrent + +-- define a camera and some light +camera1 = Camera (Frustum 5.0 5000.0 (Deg 60)) (Viewport 0 (Rectangle 0.0 0.0 1.0 1.0) black) +light1 = Light white white PointLight + +-- define some test geometry +f0 = SimpleFigure Sphere (ResourceMaterial "Colours/Red") +f1 = SimpleFigure Sphere (ResourceMaterial "Colours/Blue") +f2 = SimpleFigure Sphere (ResourceMaterial "Colours/Green") +f3 = SimpleFigure Cube (ResourceMaterial "Colours/Red") +f4 = SimpleFigure Cube (ResourceMaterial "Colours/Blue") +f5 = SimpleFigure Cube (ResourceMaterial "Colours/Green") + +figure1 = CombinedFigure [ + (Vec3 200.0 0.0 0.0, unitU, unitVec3 &* 0.3, f0), + (Vec3 0.0 200.0 0.0, unitU, unitVec3 &* 0.3 , f1), + (Vec3 0.0 0.0 200.0, unitU, unitVec3 &* 0.3 , f2), + (Vec3 (-200.0) 0.0 0.0, unitU, unitVec3 &* 0.3, f3), + (Vec3 0.0 (-200.0) 0.0, unitU, unitVec3 &* 0.3 , f4), + (Vec3 0.0 0.0 (-200.0), unitU, unitVec3 &* 0.3 , f5) + ] + +-- define some gui layouts +textWindow = Form "Vanilla" + (LayoutFC (Window "Text Window" [ + Text "GUI Switch Example - Text Window", + XPos (GUIDim 0.1 0.0), + YPos (GUIDim 0.1 0.0), + Width (GUIDim 0.0 300.0), + Height (GUIDim 0.0 400.0) + ]) [ + + ( + LayoutFC (VerticalLayout [ + XPos (GUIDim 0.0 0.0), + YPos (GUIDim 0.0 0.0), + Width (GUIDim 0.0 300.0), + Height (GUIDim 0.0 400.0) + ]) + [ + (WidgetFC (MultilineText "myMultiLineText" [ + Margin (GUIDim 0.0 5.0), + Text "This is a cool\nMultiline textbox\nwhich is editable", + Width (GUIDim 0.0 200.0), + Height (GUIDim 0.0 300.0) + ] )) + ] + )]) + +textWindow2 = Form "WindowsLook" + (LayoutFC (VerticalLayout [ + Text "GUI Switch Example - Text Window", + XPos (GUIDim 0.1 0.0), + YPos (GUIDim 0.1 0.0), + Width (GUIDim 0.0 300.0), + Height (GUIDim 0.0 400.0) + ]) [ + + ( + LayoutFC (VerticalLayout [ + XPos (GUIDim 0.0 0.0), + YPos (GUIDim 0.0 0.0), + Width (GUIDim 0.0 300.0), + Height (GUIDim 0.0 400.0) + ]) + [ + (WidgetFC (MultilineText "myMultiLineText" [ + Margin (GUIDim 0.0 5.0), + Text "This is a cool\nMultiline textbox\nwhich is editable", + Width (GUIDim 0.0 200.0), + Height (GUIDim 0.0 300.0) + ] )) + ] + )]) + +buttonBlock = Form "Vanilla" (LayoutFC (VerticalLayout [ + XPos (GUIDim 0.7 0.0), + YPos (GUIDim 0.1 0.0), + Width (GUIDim 0.3 0.0), + Height (GUIDim 0.5 0.0) + ]) + [ + (WidgetFC (Button "B-GUI1" [ + Margin (GUIDim 0.0 5.0), + Text "GUI One", + Width (GUIDim 0.3 0.0), + Height (GUIDim 0.0 20.0) + ] )), + (WidgetFC (Button "B-GUI2" [ + Margin (GUIDim 0.0 5.0), + Text "GUI Two", + Width (GUIDim 0.3 0.0), + Height (GUIDim 0.0 20.0) + ] )), + (WidgetFC (MultilineText "outText" [ + Margin (GUIDim 0.0 5.0), + Width (GUIDim 0.3 0.0), + Height (GUIDim 0.5 0.0), + Text "out text to be done" + ] )) + ] ) + +-- create entities, which are needed + +makeEs = do + -- camera, light and scene parameters into one + camE <- entity [ + CTCam #: camera1, + CTLig #: light1, + CTPos #: Vec3 0.0 0.0 0.0, + CTScP #: SceneParameter white NoShadows NoSky + ] + + -- button gui into one + bE <- entity [ + CTGFo #: buttonBlock + ] + + -- switchable gui into the other, re-used as event receiver for form events + guiE <- entity [ + CTGFo #: textWindow, + CTEvR #: EventReceiver [FormEvents] + ] + + return [camE, bE, guiE] + +checkEvents guiE bE = do + evts <- receiveEvents guiE + mapM (\evt -> case evt of + (FormEvt (FormButtonClick "B-GUI1")) -> updateC (guiE # CTGFo) (const textWindow) + (FormEvt (FormButtonClick "B-GUI2")) -> updateC (guiE # CTGFo) (const textWindow2) + (FormEvt (FormValueChange "myMultiLineText" _)) -> sendEvent bE (FormEvt (FormSetValue [("outText", (FVS (show evt)))])) + _ -> return () + ) evts + threadDelay (msec (msecT 50)) + checkEvents guiE bE + + +main = do + + ecsG3D <- runSystemGraphics3D (msecT 30) + ecsAud <- runSystemAudio (msecT 100) + ecsEvt <- runSystemEvent (msecT 110) + let systems = ecsG3D #+ ecsAud #+ ecsEvt #+ [] + [camE, bE, guiE] <- makeEs + mapM (addToWorld systems) [camE, bE, guiE] + checkEvents guiE bE + return () + diff --git a/Examples/SConstruct b/Examples/SConstruct index 2a977c4..9cb2be1 100644 --- a/Examples/SConstruct +++ b/Examples/SConstruct @@ -15,7 +15,7 @@ env.Command("build", "", Mkdir("build")) for (p, s) in [ - # the BaseAPI binaries + # the BaseAPI examples ("BaseAPI", "Audio"), ("BaseAPI", "BlueCube"), @@ -25,12 +25,16 @@ for (p, s) in [ ("BaseAPI", "Keyboard"), ("BaseAPI", "Mouse"), ("BaseAPI", "Network-Chat"), - ("BaseAPI", "WinEvent") + ("BaseAPI", "WinEvent"), + + # first EcsAPI examples + + ("EcsAPI", "GUI-Switch") ]: env.Command("build/" + s, [p + "/" + s + ".hs", "build/.HGamer3D" - ] , "rm -f build/*.o && " + "ghc --make -odir build -hidir build -i" + p + " -o build/" + s + " " + p + "/" + s) + ] , "rm -f build/*.o && " + "ghc --make -threaded -odir build -hidir build -i" + p + " -o build/" + s + " " + p + "/" + s) # the media files need to be copied to .HGamer3D env.Command("build/.HGamer3D", "MediaFiles", [ From 554e4c436a273149364ed7fa68ea87d5ad43f10f Mon Sep 17 00:00:00 2001 From: uotbw Date: Sun, 27 Jul 2014 22:04:18 +0200 Subject: [PATCH 20/28] needed ghc-prim on windows for generics --- Main/HGamer3D.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main/HGamer3D.cabal b/Main/HGamer3D.cabal index 28e1489..9a0c36e 100644 --- a/Main/HGamer3D.cabal +++ b/Main/HGamer3D.cabal @@ -31,7 +31,7 @@ Flag InputSystem Default: True Library - Build-Depends: base >= 3 && < 5, split, clock, containers, hashtables, hashable, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 + Build-Depends: base >= 3 && < 5, ghc-prim, split, clock, containers, hashtables, hashable, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 Exposed-modules: HGamer3D.Engine.Internal.Component, HGamer3D.Engine.Internal.ComponentType, HGamer3D.Engine.Internal.Entity, HGamer3D.Engine.Internal.System, HGamer3D.Engine.Internal.SystemGraphics3D, HGamer3D.Engine.Internal.SystemEvent, HGamer3D.Engine.Internal.GameLoop, HGamer3D.Engine.Internal.Event, HGamer3D.Engine.Schema.EventReceiver, HGamer3D.Engine.Schema.EventChannel, HGamer3D.Engine.EcsAPI, HGamer3D.Engine.BaseAPI, HGamer3D.Internal.Engine Other-modules: From f03b8f936fe9bfef7ecd7fe25ccb36342fb012ba Mon Sep 17 00:00:00 2001 From: urs-of-the-backwoods Date: Sun, 27 Jul 2014 22:08:00 +0200 Subject: [PATCH 21/28] Update README.md --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 14582ef..3750dd0 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,11 @@ Documentation is on: http://www.hgamer3d.org News ---- -- HGamer3D now works on 64 bit Linux -- Fixes of various build problems, April 2014, see new install instructions on http://www.hgamer3d.org/Install.html -- Version 0.3.x published on master, changes keep 0.3.x compatibility +- this release-0.4 branch is usable now and contains great new features +- entity component system +- add, update, remove 3d entities, sounds, guis at runtime +- schema based specification of entities +- see Examples/EcsAPI +- more than one camera +- multi-threading, live coding from GHCI + From 339d121b250cec59d14bfac51d0b19a8629ee7ed Mon Sep 17 00:00:00 2001 From: uotbw Date: Wed, 30 Jul 2014 10:50:58 +0200 Subject: [PATCH 22/28] bugfix camera orientation --- Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index c323f68..049b3ed 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -187,7 +187,7 @@ instance System ECSGraphics3D where return () lacApplyChanges (cameras ecsg3d) (Gr.addCamera g3ds) (Gr.updateCamera g3ds) (Gr.removeCamera g3ds) handleU2CEvents lacHandleC2UEvents lacApplyOtherChanges (poscam ecsg3d) (cameras ecsg3d) update' - lacApplyOtherChanges (orifig ecsg3d) (cameras ecsg3d) update'' + lacApplyOtherChanges (oricam ecsg3d) (cameras ecsg3d) update'' -- lights lacApplyChanges (lights ecsg3d) (Gr.addLight g3ds) (Gr.updateLight g3ds) (Gr.removeLight g3ds) lacHandleU2CEvents lacHandleC2UEvents From ced7e679e0ada7568beb3146ea0244981bdc16af Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Wed, 30 Jul 2014 12:46:25 +0200 Subject: [PATCH 23/28] bugfix manual objects, removed old Wire source --- .../HGamer3D/Graphics3D/Internal/Shapes.hs | 4 +- .../HGamer3D/Graphics3D/Schema/Geometry.hs | 4 +- Wire/HGamer3D-Wire.cabal | 33 -- Wire/HGamer3D/Wire.hs | 107 ------- Wire/HGamer3D/Wire/ECSWire.hs | 158 ---------- Wire/HGamer3D/Wire/EntityComponentSystem.hs | 202 ------------ Wire/HGamer3D/Wire/GUI.hs | 293 ------------------ Wire/HGamer3D/Wire/Types.hs | 121 -------- Wire/LICENSE | 42 --- Wire/SConstruct | 43 --- Wire/Setup.hs | 22 -- 11 files changed, 5 insertions(+), 1024 deletions(-) delete mode 100644 Wire/HGamer3D-Wire.cabal delete mode 100644 Wire/HGamer3D/Wire.hs delete mode 100644 Wire/HGamer3D/Wire/ECSWire.hs delete mode 100644 Wire/HGamer3D/Wire/EntityComponentSystem.hs delete mode 100644 Wire/HGamer3D/Wire/GUI.hs delete mode 100644 Wire/HGamer3D/Wire/Types.hs delete mode 100644 Wire/LICENSE delete mode 100644 Wire/SConstruct delete mode 100644 Wire/Setup.hs diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs index 887959d..c5dffcc 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Shapes.hs @@ -130,7 +130,9 @@ _createFigure g3ds parent fig = do case fig of SimpleFigure geo mat -> do meshEntity <- _createGeometry g3ds geo - _buildTV meshEntity + if (geo /= Dodekaeder) && (geo /= Ikosaeder) then + _buildTV meshEntity + else return () _setMaterial meshEntity mat _addEntityToNode g3ds node meshEntity return (EDEntityNode meshEntity node) diff --git a/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs b/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs index f4b2349..81208a1 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Schema/Geometry.hs @@ -36,7 +36,7 @@ data Geometry = -- Primitive 3D Geometries | Cube | Sphere - | Cylinder +-- | Cylinder -- Platon Geometries | Ikosaeder @@ -44,7 +44,7 @@ data Geometry = -- 2D Geometries | Plane - | Line +-- | Line deriving (Eq, Show, Typeable) diff --git a/Wire/HGamer3D-Wire.cabal b/Wire/HGamer3D-Wire.cabal deleted file mode 100644 index c6f53c7..0000000 --- a/Wire/HGamer3D-Wire.cabal +++ /dev/null @@ -1,33 +0,0 @@ -Name: HGamer3D-Wire -Version: 0.4.0 -Synopsis: Wire Functionality for HGamer3D -Description: - HGamer3D is a game engine for developing 3D games in the programming - language Haskell. - - This package shows experimental usage of netwire for a GUI example. - -License: OtherLicense -License-file: LICENSE -Author: Peter Althainz -Maintainer: althainz@gmail.com -Build-Type: Simple -Cabal-Version: >=1.4 -Homepage: http://www.hgamer3d.org -Category: Game Engine -Extra-source-files: Setup.hs - -Library - Build-Depends: base >= 3 && < 5, netwire >= 5, containers, transformers, mtl, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0, HGamer3D-InputSystem >= 0.4.0 && < 0.5.0, HGamer3D-Audio >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0 - - Exposed-modules: HGamer3D.Wire.Types,HGamer3D.Wire.EntityComponentSystem,HGamer3D.Wire.ECSWire,HGamer3D.Wire.GUI,HGamer3D.Wire - Other-modules: - - c-sources: - - ghc-options: - cc-options: -Wno-attributes - hs-source-dirs: . - Include-dirs: . - build-depends: - extra-libraries: diff --git a/Wire/HGamer3D/Wire.hs b/Wire/HGamer3D/Wire.hs deleted file mode 100644 index 8c6531c..0000000 --- a/Wire/HGamer3D/Wire.hs +++ /dev/null @@ -1,107 +0,0 @@ -{-# LANGUAGE Arrows #-} - --- Some useful wires for game programming --- --- (c) 2014 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - - -module HGamer3D.Wire ( - - module HGamer3D.Wire.Types, - module HGamer3D.Wire.EntityComponentSystem, - module HGamer3D.Wire.ECSWire, - module HGamer3D.Wire.GUI, - - HGamer3D.Wire.loopHGamer3D, - HGamer3D.Wire.initHGamer3D, - HGamer3D.Wire.exitHGamer3D - - ) where - -import Control.Wire as W -import Control.Wire.Unsafe.Event as U - -import Prelude hiding ((.), id) - -import HGamer3D.Graphics3D -import HGamer3D.Audio -import HGamer3D.InputSystem -import HGamer3D.WinEvent hiding (initHGamer3D, loopHGamer3D, exitHGamer3D) -import HGamer3D.GUI - -import Control.Monad.Trans.Maybe - -import HGamer3D.Wire.Types -import HGamer3D.Wire.EntityComponentSystem -import HGamer3D.Wire.ECSWire -import HGamer3D.Wire.GUI - -import Data.IORef -import qualified Data.Map as M -import Data.Maybe - - - --- event register mechanism - --- init - -initHGamer3D :: String -- ^ Window Title - -> Bool -- ^ Flag show config dialogue - -> Bool -- ^ Flag logging enabled - -> Bool -- ^ show Graphics Cursor - -> IO (WireSystem, Camera, Viewport) -initHGamer3D windowTitle fConfigDialogue fLog fGraphicsCursor = do - (g3ds, guis, camera, viewport) <- HGamer3D.initHGamer3D windowTitle fConfigDialogue fLog fGraphicsCursor - un <- createUniqueName "wire" - gedm <- newIORef (M.fromList []) - wedm <- newIORef [] - widgetListRef <- newIORef [] - let evtDistMap = (gedm, wedm) - let ws = WireSystem un g3ds guis evtDistMap widgetListRef - return (ws, camera, viewport) - --- loop - -loopHGamer3D :: WireSystem -> IO Bool -loopHGamer3D ws = do - let g3ds = wsG3d ws - let guis = wsGui ws - let (gedm, wedm) = wsEvtDistMap ws - (mevt, qFlag) <- HGamer3D.loopHGamer3D g3ds guis - qFlag' <- case mevt of - Just (EventWindow sdle) -> do - fm <- readIORef wedm - mapM (\fwin -> fwin sdle) fm - case sdle of - (EvtQuit _) -> return True - _ -> return False - Just (EventGUI gevts) -> do - mapM (\gevt@(GUIEvent tag _ _) -> do - fm <- readIORef gedm - let f = fromJust (M.lookup tag fm) - f gevt - return ()) gevts - return False - _ -> return False - - return (qFlag || qFlag') - --- exit - -exitHGamer3D = HGamer3D.exitHGamer3D - - - diff --git a/Wire/HGamer3D/Wire/ECSWire.hs b/Wire/HGamer3D/Wire/ECSWire.hs deleted file mode 100644 index a0d9ca5..0000000 --- a/Wire/HGamer3D/Wire/ECSWire.hs +++ /dev/null @@ -1,158 +0,0 @@ -{-# LANGUAGE Arrows #-} - --- Some useful wires for game programming --- --- (c) 2014 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - -module HGamer3D.Wire.ECSWire where - -import Control.Wire as W -import Control.Wire.Unsafe.Event as U - -import Prelude hiding ((.), id) - -import HGamer3D.Graphics3D -import HGamer3D.Audio -import HGamer3D.InputSystem - -import HGamer3D.Wire.Types -import HGamer3D.Wire.EntityComponentSystem - -import Control.Monad.Trans.Maybe - --- ECS Wires - --- move position of Entity by a vector (per second) -move :: Entity -> Vec3 -> GameWire (Event a) (Event a) -move e vec = mkGen $ \s evt -> case evt of - Event _ -> do - let t = realToFrac (dtime s) - runMaybeT $ setLocation e (\pos -> pos &+ (vec &* t)) - return (Right evt, move e vec) - _ -> return (Right evt, move e vec) - -rotate :: Entity -> Vec3 -> Float -> GameWire (Event a) (Event a) -rotate e rv a = mkGen $ \s evt -> case evt of - Event _ -> do - let t = realToFrac (dtime s) - runMaybeT $ setOrientation e (\ori -> ori .*. (rotU rv (a*t))) - return (Right evt, rotate e rv a) - _ -> return (Right evt, rotate e rv a) - -accelerate :: Entity -> Vec3 -> GameWire (Event a) (Event a) -accelerate e vec = mkGen $ \s evt -> case evt of - Event _ -> do - runMaybeT $ setVelocity e (\vel -> vel &+ vec) - return $ (Right evt, accelerate e vec) - _ -> return $ (Right evt, accelerate e vec) - - --- move position to target within specific time -moveTo :: Entity -> Vec3 -> Float -> GameWire a () -moveTo e target dt = let - startAction = do - runMaybeT (do - loc <- getLocation e - let vel = (target &- loc) &* (1.0 / dt) - setVelocity e (\_ -> vel) - return () ) - return $ Left () - endAction = do - runMaybeT (do - setVelocity e (\_ -> (Vec3 0.0 0.0 0.0)) - setLocation e (\_ -> target) - return () ) - return $ Left () - in (mkGen_ (\_ -> startAction)) --> for (realToFrac dt) . pure () --> (mkGen_ (\_ -> endAction)) - - --- USEFUL WIRES - --- sends the event one time and then inhibit ! - -sendOnce :: GameWire (W.Event a) (W.Event a) -sendOnce = proc inevt -> do - rec - devt <- delay (U.NoEvent) -< devt' - devt' <- id -< inevt - case devt of - U.NoEvent -> do - returnA -< inevt - U.Event evt -> do - x <- pure U.NoEvent . mkEmpty -< () - returnA -< x - --- wire to play a sound -soundW :: AudioSource -> Wire s e IO (W.Event a) (W.Event a) -soundW aSource = onEventM (\aIn -> do - playAudioSource aSource - return aIn ) - --- samples generated keypress -keyW :: EnumKey -> Wire s e IO a (W.Event a) -keyW key = mkGen_ ( \inVal -> do - press <- isKeyPressed key - let evt = if press then U.Event inVal else U.NoEvent - return $ (Right evt) ) - --- Cycles through a list, stop at end -cycleW :: [b] -> Wire s () IO (W.Event a) (W.Event b) -cycleW lin = if length lin > 0 then - mkPureN (\evt -> case evt of - U.Event _ -> (Right (U.Event (head lin)), cycleW (tail lin)) - _ -> (Right U.NoEvent, cycleW lin) ) - else - mkConst $ Left () - - -printEvt :: Show a => GameWire (W.Event a) (W.Event a) -printEvt = mkGen_ (\evt -> do case evt of - U.Event x -> do - print x - return (Right evt) - _ -> return (Right evt)) - - --- generic switch, in event is two-fold, left side creates new wire of a -> b --- right side is a output is b, runs sequentially, first do new wire switched in, then restart switch logic - --- different types of switching logic, eases up game programming ----------------------------------------------------------------- - --- this wire creates a wire from a function which creates a wire from an input status --- the resulting wire switches into the created wire, runs this until it inihibits and then --- switches back to the switchIntoAndRun semantics - --- useful for providing game states, which run for a certain amount of time and then wait for a new --- initializer, during running the created wire additional state input is ignored - -switchIntoAndRunW :: (gst -> GameWire (Event a) (Event b)) -> GameWire (Event gst, Event a) (Event b) -switchIntoAndRunW inWireF = switch $ mkPure_ (\(gsEvt, aEvt) -> case gsEvt of - Event gs -> let - newWire = (inWireF gs) . mkPure_ (\(a, b) -> Right b) --> switchIntoAndRunW inWireF - in Right (NoEvent, Event (newWire)) - _ -> Right (NoEvent, NoEvent) ) - --- same logic, but does not need to process events during run phase --- usefule if something needs to happen, but no input processing -switchIntoAndRunW' :: (gst -> GameWire () (Event b)) -> GameWire (Event gst) (Event b) -switchIntoAndRunW' inWireF = switch $ mkPure_ (\gsEvt -> case gsEvt of - Event gs -> let - newWire = (inWireF gs) . pure () --> switchIntoAndRunW' inWireF - in Right (NoEvent, Event (newWire)) - _ -> Right (NoEvent, NoEvent) ) - - - diff --git a/Wire/HGamer3D/Wire/EntityComponentSystem.hs b/Wire/HGamer3D/Wire/EntityComponentSystem.hs deleted file mode 100644 index b1a9414..0000000 --- a/Wire/HGamer3D/Wire/EntityComponentSystem.hs +++ /dev/null @@ -1,202 +0,0 @@ -{-# LANGUAGE Arrows #-} - --- (c) 2014 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - -module HGamer3D.Wire.EntityComponentSystem where - -import HGamer3D.Wire.Types - -import HGamer3D.Graphics3D -import HGamer3D.Audio -import HGamer3D.InputSystem - -import Control.Monad.Trans -import Control.Monad.Trans.Maybe - -import Control.Wire -import Control.Wire.Unsafe.Event - -import Prelude hiding ((.), id) -import Data.List -import Data.IORef -import Data.Dynamic -import Data.Maybe -import qualified Data.Map as M - -createSystem :: SystemData d -> GameWire (Event Command) (Event Command) -createSystem sdata = let - - (SystemData initD addE remE runAction) = sdata - dOut dIn evt = case evt of - (Event (CmdAddEntity ent)) -> (addE ent dIn) - (Event (CmdRemEntity oid)) -> (remE oid dIn) - _ -> dIn - wire dIn = mkGen (\s evt -> do - let out = dOut dIn evt - runAction out s - return (Right evt, wire out) ) - in wire initD - --- a wire which deconstructs a CmdArr into a sequence of single events --- single commands will be ignored and not added to the list --- to be added into a chain of command senders, receivers -cmdFifo :: GameWire (Event Command) (Event Command) -cmdFifo = fifo_ [] where - fifo_ list = mkPureN (\cmdIn -> let - newList = case cmdIn of - (Event (CmdArr addList)) -> list ++ addList - _ -> list -- do not add single command here, intentionally, this will create an infinite loop in a chain - (evtOut, listOut) = case newList of - [] -> (NoEvent,[]) - (e:es) -> (Event e, es) - in (Right evtOut, fifo_ listOut) ) - -readIORef' :: IORef a -> MaybeT IO a -readIORef' ref = MaybeT $ do - val <- readIORef ref - return $ Just val - -writeIORef' :: IORef a -> a -> MaybeT IO () -writeIORef' ref val = MaybeT $ do - writeIORef ref val - return $ Just () - -modifyIORef'' :: IORef a -> (a -> a) -> MaybeT IO () -modifyIORef'' ref f = MaybeT $ do - x <- readIORef ref - let x' = (f x) - x' `seq` writeIORef ref x' - return $ Just () - -getC :: Typeable a => Entity -> Maybe a -getC entity = case find isJust (map fromDynamic (entComps entity)) of - Just (Just c) -> Just c - _ -> Nothing - -getC' :: Typeable a => Entity -> MaybeT IO a -getC' entity = MaybeT $ - do - let rval = getC entity - return rval - --- LOCATION - -getLocation :: Entity -> MaybeT IO Vec3 -getLocation e = do - LocationC l <- getC' e - val <- readIORef' l - return val - -setLocation :: Entity -> (Vec3 -> Vec3) -> MaybeT IO () -setLocation e f = do - LocationC l <- getC' e - modifyIORef'' l f - return () - -locationSystem :: SystemData (M.Map ObId (IORef Vec3, Object3D)) -locationSystem = let - fInit = M.fromList [] :: M.Map ObId (IORef Vec3, Object3D) - fAdd e mapIn = case (getC e, getC e) of - (Just (LocationC ref), Just (ObjectC o3d)) -> M.insert (entId e) (ref, o3d) mapIn - _ -> mapIn - fRem = M.delete - runAction mapIn _ = do - mapM (\(ref, obj3D) -> do - pos <- readIORef ref - positionTo3D obj3D pos ) (map snd (M.toList mapIn)) - return () - in (SystemData fInit fAdd fRem runAction) - --- ORIENTATION - -getOrientation :: Entity -> MaybeT IO U -getOrientation e = do - OrientationC o <- getC' e - val <- readIORef' o - return $ val - -setOrientation :: Entity -> (U -> U) -> MaybeT IO () -setOrientation e f = do - OrientationC o <- getC' e - modifyIORef'' o f - return () - -orientationSystem :: SystemData (M.Map ObId (IORef UnitQuaternion, Object3D)) -orientationSystem = let - fInit = M.fromList [] :: M.Map ObId (IORef UnitQuaternion, Object3D) - fAdd e mapIn = case (getC e, getC e) of - (Just (OrientationC ref), Just (ObjectC o3d)) -> M.insert (entId e) (ref, o3d) mapIn - _ -> mapIn - fRem = M.delete - runAction mapIn _ = do - mapM (\(ref, obj3D) -> do - ori <- readIORef ref - orientationTo3D obj3D ori) (map snd (M.toList mapIn)) - return () - in (SystemData fInit fAdd fRem runAction) - --- VELOCITY - -getVelocity :: Entity -> MaybeT IO Vec3 -getVelocity e = do - VelocityC v <- getC' e - val <- readIORef' v - return $ val - -setVelocity :: Entity -> (Vec3 -> Vec3) -> MaybeT IO () -setVelocity e f = do - VelocityC v <- getC' e - modifyIORef'' v f - return () - -velocitySystem :: SystemData (M.Map ObId (IORef Vec3, IORef Vec3)) -velocitySystem = let - fInit = M.fromList [] :: M.Map ObId (IORef Vec3, IORef Vec3) - fAdd e mapIn = case (getC e, getC e) of - (Just (VelocityC rV), Just (LocationC rP)) -> M.insert (entId e) (rV, rP) mapIn - _ -> mapIn - fRem = M.delete - runAction mapIn s = do - mapM (\(rV, rP) -> do - vel <- readIORef rV - let t = realToFrac $ dtime s :: Float - runMaybeT (modifyIORef'' rP (\pos -> pos &+ (vel &* t))) ) (map snd (M.toList mapIn)) - return () - in (SystemData fInit fAdd fRem runAction) - - --- ENTITY CREATION - --- create entity with a graphics object, a location and a velocity -veloEntity :: String -> Object3D -> Vec3 -> IO Entity -veloEntity name obj pos = do - ref <- newIORef pos - vel <- newIORef (Vec3 0.0 0.0 0.0) - let e = Entity name [ - toDyn (LocationC ref), - toDyn (VelocityC vel), - toDyn (ObjectC obj) - ] - return e - --- create entity with a graphics object and a rotation, only -rotEntity :: String -> Object3D -> UnitQuaternion -> IO Entity -rotEntity name obj ori = do - ref <- newIORef ori - let e = Entity name [ - toDyn (OrientationC ref), - toDyn (ObjectC obj) - ] - return e diff --git a/Wire/HGamer3D/Wire/GUI.hs b/Wire/HGamer3D/Wire/GUI.hs deleted file mode 100644 index c8a1d21..0000000 --- a/Wire/HGamer3D/Wire/GUI.hs +++ /dev/null @@ -1,293 +0,0 @@ -{-# LANGUAGE Arrows #-} - --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Wire/GUI.hs - --- | The GUI functionality of the FRP API -module HGamer3D.Wire.GUI -( - -- * fundamental and simple Wires - guiEventW, - guiPropertyW, - guiSetPropertyW, - guiGetPropertyW, - - buttonW, - staticTextW, - - -- * editable GUI element Wires - -- $EditGUIWire - editBoxW, - doubleBoxW, - checkBoxW, - radioButtonW, - - -- * special elements - sliderW, - spinnerW, - listBoxW -) - -where - -import HGamer3D.Graphics3D -import HGamer3D.GUI - -import Control.Monad.Trans - -import Control.Monad.Identity (Identity) -import Control.Wire -import Control.Wire.Unsafe.Event -import Prelude hiding ((.), id) - -import Data.IORef -import HGamer3D.Wire.Types - - --- functions to put gui events into a list and pop them out again, as well as fire, when there is an event in it --- - -_gatherGUIEvents :: IORef [evtType] -> evtType -> IO () -_gatherGUIEvents ref event = do - list <- readIORef ref - liftIO $ writeIORef ref (list ++ [event]) - return () - -_popGUIEvent :: IORef [evtType] -> IO (Event evtType) -_popGUIEvent ref = do - list <- readIORef ref - case list of - [] -> return NoEvent - (x : xs) -> do - writeIORef ref xs - return $ Event x - --- | A wire, which which delivers the input value as an event, when GUI event occurs -guiEventW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> String -- ^ name of event - -> IO (GameWire a (Event a)) -- ^ resulting wire -guiEventW ws widgetname eventname = do - let guis = wsGui ws - let un = wsUniqueName ws - widget <- getGuiWidget ws widgetname - tagname <- nextUniqueName un - ref <- liftIO $ newIORef [] - registerGUIEvent guis widget eventname tagname - registerGUIEventFunction ws tagname (_gatherGUIEvents ref) - let wire = mkGen_ (\aval -> do - rval <- _popGUIEvent ref - case rval of - Event _ -> return (Right (Event aval)) - NoEvent -> return (Right NoEvent) ) - return wire - --- | A wire, which delivers input value as event on button click -buttonW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> IO (GameWire a (Event a)) -- ^ resulting wire -buttonW ws widgetname = do - wire <- guiEventW ws widgetname "Clicked" - return wire - --- | A property wire, you can set a property and query a property with this wire -guiPropertyW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> String -- ^ name of property - -> IO (GameWire (Event a, Event String) (Event String)) -- ^ resulting wire, input of left event queries property, right event sets the property -guiPropertyW ws widgetname propname = do - widget <- getGuiWidget ws widgetname - let wire = mkGen_ (\(evtL, evtR) -> do - let rVal = do - case evtL of - Event _ -> do - val <- getGuiElProperty widget propname - return (Right (Event val)) - _ -> return $ Right NoEvent - - case evtR of - Event value -> do - setGuiElProperty widget propname value - r <- rVal - return r - _ -> do - r <- rVal - return r) - return wire - --- | A wire, which sets a property upon event -guiSetPropertyW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> String -- ^ name of property - -> IO (GameWire (Event String) (Event String)) -- ^ resulting wire, input sets property and is routed through unchanged -guiSetPropertyW ws widgetname propname = do - wire <- guiPropertyW ws widgetname propname - let wire' = proc inval -> do - wire . (never &&& id) -< inval - returnA -< inval - return wire' - --- | A wire, which queries a property upon event -guiGetPropertyW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> String -- ^ name of property - -> IO (GameWire (Event a) (Event String)) -- ^ resulting wire, gets current value of property upon in-event -guiGetPropertyW ws widgetname propname = do - wire <- guiPropertyW ws widgetname propname - let wire' = proc inval -> do - outval <- wire . (id &&& never) -< inval - returnA -< outval - return wire' - -_createGUIValueW :: WireSystem -> String -> String -> String -> String -> IO (GameWire (Event String) (Event String, String)) -_createGUIValueW ws widgetname propname eventchangename startv = do - propW <- guiPropertyW ws widgetname propname - eventW <- guiEventW ws widgetname eventchangename - let wire = proc setE -> do - changeE <- eventW -< () - setE' <- id &> now . pure startv -< setE - changeE' <- propW -< (changeE, setE') - value <- hold -< setE' `mergeL` changeE' - inhibitFlag <- (pure False . holdFor 0.5) <|> (pure True) -< setE - changeE'' <- arr (\(c, p) -> if p then c else NoEvent) -< (changeE', inhibitFlag) - returnA -< (changeE'', value) - return wire - --- | An edit box wire, editable text element -editBoxW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> String -- ^ start value - -> IO (GameWire (Event String) (Event String, String) ) -- ^ resulting wire -editBoxW ws widgetname startv = _createGUIValueW ws widgetname "Text" "TextChanged" startv - - -_strtd :: Double -> GameWire (Event String, String) (Event Double, Double) -_strtd def = let - convert = (\str -> case (reads str)::[(Double, String)] of - [(a, _)] -> a - _ -> def) - in arr (\(evt, val) -> (fmap convert evt, convert val)) -_dtstr :: GameWire (Event Double) (Event String) -_dtstr = (arr . fmap) (\d -> show d) - --- | A wire, which provides an editable double value -doubleBoxW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> Double -- ^ start and default value, in case string does not translate to a double value - -> IO (GameWire (Event Double) (Event Double, Double) ) -- ^ resulting wire -doubleBoxW ws widgetname def = do - wire <- editBoxW ws widgetname (show def) - let wire' = _strtd def . wire . _dtstr - return wire' - --- | A wire, which simply displays a text -staticTextW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> IO (GameWire (Event String) (Event String)) -- ^ resulting wire -staticTextW ws widgetname = guiSetPropertyW ws widgetname "Text" - -_bst = arr (\val -> fmap (\b -> if b then "True" else "False") val) -_stb = let convert = (\st -> if st == "True" then True else False) - in arr (\(evt, val) -> (fmap convert evt, convert val)) - --- | A checkbox wire -checkBoxW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> Bool -- ^ start value - -> IO (GameWire (Event Bool) (Event Bool, Bool) ) -- ^ resulting wire -checkBoxW ws widgetname startv = do - wire <- _createGUIValueW ws widgetname "Selected" "CheckStateChanged" (show startv) - return $ _stb . wire . _bst - --- | A radiobutton wire -radioButtonW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> Bool -- ^ start value - -> IO (GameWire (Event Bool) (Event Bool, Bool) ) -- ^ resulting wire -radioButtonW ws widgetname startv = do - wire <- _createGUIValueW ws widgetname "Selected" "SelectStateChanged" (show startv) - return $ _stb . wire . _bst - --- | A slider wire -sliderW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> Double -- ^ start value - -> IO (GameWire (Event Double) (Event Double, Double)) -- ^ resulting wire -sliderW ws widgetname def = do - wire <- _createGUIValueW ws widgetname "CurrentValue" "ValueChanged" (show def) - return $ _strtd def . wire . _dtstr - --- | A spinner wire (rename of sliderW) -spinnerW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> Double -- ^ start value - -> IO (GameWire (Event Double) (Event Double, Double)) -- ^ resulting wire -spinnerW = sliderW - - --- LISTBOX AND COMBOBOX ------------------------ - -_guiPropertyListboxW :: GUIElement - -> (a -> String) - -> IO (GameWire (Event b, Event [(a, Bool)]) (Event [a]) ) -_guiPropertyListboxW widget toStringF = do - let wire slist = mkGenN (\(evtL, evtR) -> do - let rVal slist' = do - case evtL of - Event _ -> do - val <- listboxStatus widget - let val' = fmap snd (filter (\( (e', s'), entry) -> s') (zip val slist')) - return (Right (Event val'), wire slist') - _ -> return (Right NoEvent, wire slist') - - case evtR of - Event value -> do - let value' = fmap (\(aval,s) -> (toStringF aval, s)) value - let value'' = fmap fst value - listboxInitialize widget value' - r <- rVal value'' - return r - _ -> do - r <- rVal slist - return r) - return $ wire [] - --- | A listbox wire, , output events are selection changes, output contains selected data -listBoxW :: WireSystem -- ^ the Wiresystem - -> String -- ^ name of widget - -> (a -> String) -- ^ function to convert data values to display string - -> [(a, Bool)] -- ^ start values - -> IO (GameWire (Event [(a, Bool)]) (Event [a], [a])) -- ^ resulting wire -listBoxW ws widgetname toStringF startv = do - widget <- getGuiWidget ws widgetname - propW <- _guiPropertyListboxW widget toStringF - eventW <- guiEventW ws widgetname "ItemSelectionChanged" - let wire = proc setE -> do - changeE <- eventW -< () - setE' <- id &> now . pure startv -< setE - changeE' <- propW -< (changeE, setE') - let setE'' = fmap (fmap fst) (fmap (\l -> filter (\(e, s) -> s) l) setE') - value <- hold -< setE'' `mergeL` changeE' - inhibitFlag <- (pure False . holdFor 0.5) <|> (pure True) -< setE - changeE'' <- arr (\(c, p) -> if p then c else NoEvent) -< (changeE', inhibitFlag) - returnA -< (changeE'', value) - return wire - diff --git a/Wire/HGamer3D/Wire/Types.hs b/Wire/HGamer3D/Wire/Types.hs deleted file mode 100644 index 82fffc5..0000000 --- a/Wire/HGamer3D/Wire/Types.hs +++ /dev/null @@ -1,121 +0,0 @@ -{-# LANGUAGE Arrows, DeriveDataTypeable, StandaloneDeriving #-} - -module HGamer3D.Wire.Types - - -where - -import Data.IORef -import Data.Typeable -import Data.Dynamic -import Data.List -import Data.Maybe -import qualified Data.Map as M - -import HGamer3D.Graphics3D -import HGamer3D.Audio -import HGamer3D.InputSystem - -import Control.Wire -import Control.Wire.Unsafe.Event -import Prelude hiding ((.), id) - --- One type for event map, unique names, guisystem, graphics3Dsystem --------------------------------------------------------------------- - -data WireSystem = WireSystem { - wsUniqueName :: UniqueName, - wsG3d :: Graphics3DSystem, - wsGui :: GUISystem, - wsEvtDistMap :: (IORef (M.Map String (GUIEvent -> IO ())), IORef [(SDLEvent -> IO ())] ), - wsGuiElList :: IORef [GUIElement] - } - --- The basic Wire type ----------------------- - -type Time = Double -type RunState = (Timed NominalDiffTime ()) -type GameWire = Wire RunState () IO - --- Entity Component System --------------------------- - --- this is a prototype implementation to show the potential --- IORef's are solely used in the system data aka components of the engine --- (reading some ECS literature, I thought implementing components as pure FRP might be a big hassle) - --- object ids will be simple string -type ObId = String - --- a component holds the "data", a state with an identity, there are different types of components --- each component comes with its onwn type of system -data LocationC = LocationC (IORef Vec3) deriving (Typeable) -data OrientationC = OrientationC (IORef UnitQuaternion) deriving (Typeable) -data ObjectC = ObjectC Object3D deriving (Typeable) -data VelocityC = VelocityC (IORef Vec3) deriving (Typeable) - -deriving instance Typeable UnitQuaternion -deriving instance Typeable Vec3 - -type Component = Dynamic - --- an entity has an object id and components -data Entity = Entity { entId :: ObId, entComps :: [Component] } - --- SYSTEMS for ECS - -data SystemData d = SystemData { - sdInitialize :: d, - sdAddEntity :: Entity -> d -> d, - sdRemoveEntity :: ObId -> d -> d, - sdRunAction :: d -> RunState -> IO () -- only side effects on the IORef data, but complete set as input! - } - --- all commands go into one type (for now) -data Command = CmdArr [Command] - | CmdAddEntity Entity - | CmdRemEntity ObId - | CmdMoveTo Vec3 Time - | CmdNoOp - - - --- administration function --------------------------- - - -registerGUIEventFunction :: WireSystem -> String -> (GUIEvent -> IO ()) -> IO () -registerGUIEventFunction ws tag gevtF = do - let (gedm, wedm) = wsEvtDistMap ws - modifyIORef gedm (\m -> M.insert tag gevtF m) - return () - -registerWinEventFunction :: WireSystem -> (SDLEvent -> IO ()) -> IO () -registerWinEventFunction ws wevtF = do - let (gedm, wedm) = wsEvtDistMap ws - modifyIORef wedm (\l -> (wevtF : l)) - return () - -loadGuiLayout :: WireSystem -> String -> IO () -loadGuiLayout ws name = do - let guis = wsGui ws - let refList = wsGuiElList ws - mainwidget <- loadGuiLayoutFromFile guis name "" - modifyIORef refList (\l -> (mainwidget : l)) - addGuiElToDisplay guis mainwidget - return () - -getGuiWidget :: WireSystem -> String -> IO GUIElement -getGuiWidget ws name = do - let ref = wsGuiElList ws - lGE <- readIORef ref - rlist <- mapM (\wg -> do - rval <- findChildGuiElRecursive wg name - return rval ) lGE - let rval = case find isJust rlist of - Just (Just val) -> val - Nothing -> undefined - return rval -- we assume, that element is available, otherwise runtime error - - diff --git a/Wire/LICENSE b/Wire/LICENSE deleted file mode 100644 index 7e2d6f1..0000000 --- a/Wire/LICENSE +++ /dev/null @@ -1,42 +0,0 @@ -LICENSE -------- - -(c) 2011-2014 Peter Althainz - - -HGamer3D (http://www.hgamer3d.org) ----------------------------------- - -HGamer3D is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - -Source Code ------------ -You can obtain the latest version of the source code under http://www.bitbucket.org/althainz/HGamer3D - - -Open Source Software Used - Module HGamer3D -------------------------------------------- - -HGamer3D uses a number of open source software libraries. You are responsible to comply to the licenses of those packages and the licenses of software used by those packages if you use HGamer3D. - -The HGamer3D module uses the following Haskell libraries from Hackage: - -base, license: BSD3 -containers, license: BSD3 -text, license: BSD3 -directory, license: BSD3 -mtl, license: BSD3 -FindBin, license: BSD3 -monad-loops, license: PublicDomain, BSD3 similar -split, license: BSD3 -netwire, license: BSD3 -HGamer3D-Data, license: Apache 2.0 -HGamer3D-Ogre-Binding, license: Apache 2.0 and dependencies see in that module -HGamer3D-SFML-Binding, license: Apache 2.0 and dependencies see in that module -HGamer3D-CEGUI-Binding, license: Apache 2.0 and dependencies see in that module -HGamer3D-Enet-Binding, license: Apache 2.0 and dependencies see in that module diff --git a/Wire/SConstruct b/Wire/SConstruct deleted file mode 100644 index caa3e3b..0000000 --- a/Wire/SConstruct +++ /dev/null @@ -1,43 +0,0 @@ -# SConstruct file to build Haskell packages for Wire Module -# ######################################################### - -# set environment -################# -from os.path import expanduser -import os -home = expanduser("~") -env = Environment() -env["ENV"]["PATH"] = os.environ.get("PATH") -env["ENV"]["HOME"] = os.environ.get("HOME") - -# Gather main dependencies -########################## - -dependsOn = [ - Glob("HGamer3D/*"), - Glob("HGamer3D/Wire/*"), - Glob("*.cabal"), - "LICENSE", - - Glob("../Data/dist/HGamer3D-*.tar.gz"), - Glob("../GUI/dist/HGamer3D-*.tar.gz"), - Glob("../WinEvent/dist/HGamer3D-*.tar.gz"), - Glob("../Graphics3D/dist/HGamer3D-*.tar.gz"), - Glob("../Audio/dist/HGamer3D-*.tar.gz"), - Glob("../Network/dist/HGamer3D-*.tar.gz"), - Glob("../InputSystem/dist/HGamer3D-*.tar.gz"), - Glob("../Schema/dist/HGamer3D-*.tar.gz"), -] - -target = [ "dist/setup-config", Glob("dist/HGamer3D-*.tar.gz")] - -env.Command(target, dependsOn, [ - -"ghc-pkg unregister HGamer3D || true", - -"cabal configure --user", -"cabal build", -"cabal haddock", -"cabal install --user --extra-lib-dirs=" + home + "/.HGamer3D/lib", -"cabal sdist" -]) diff --git a/Wire/Setup.hs b/Wire/Setup.hs deleted file mode 100644 index 5c383dc..0000000 --- a/Wire/Setup.hs +++ /dev/null @@ -1,22 +0,0 @@ --- This source file is part of HGamer3D --- (A project to enable 3D game development in Haskell) --- For the latest info, see http://www.hgamer3d.org --- --- (c) 2011-2013 Peter Althainz --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. - --- Setup.hs - -import Distribution.Simple -main = defaultMain From 5b212fe0dca0b25989a423b639043f6dca4ef1b6 Mon Sep 17 00:00:00 2001 From: Urs of the Backwoods Date: Wed, 30 Jul 2014 14:48:50 +0200 Subject: [PATCH 24/28] added EcsAPI --- Main/HGamer3D.cabal | 7 +++-- Main/HGamer3D/GUI/EcsAPI.hs | 29 +++++++++++++++++++ Main/HGamer3D/Graphics3D/EcsAPI.hs | 46 ++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 Main/HGamer3D/GUI/EcsAPI.hs create mode 100644 Main/HGamer3D/Graphics3D/EcsAPI.hs diff --git a/Main/HGamer3D.cabal b/Main/HGamer3D.cabal index 9a0c36e..68e1af4 100644 --- a/Main/HGamer3D.cabal +++ b/Main/HGamer3D.cabal @@ -33,7 +33,8 @@ Flag InputSystem Library Build-Depends: base >= 3 && < 5, ghc-prim, split, clock, containers, hashtables, hashable, HGamer3D-Data >= 0.4.0 && < 0.5.0, HGamer3D-Graphics3D >= 0.4.0 && < 0.5.0, HGamer3D-WinEvent >= 0.4.0 && < 0.5.0, HGamer3D-GUI >= 0.4.0 && < 0.5.0 - Exposed-modules: HGamer3D.Engine.Internal.Component, HGamer3D.Engine.Internal.ComponentType, HGamer3D.Engine.Internal.Entity, HGamer3D.Engine.Internal.System, HGamer3D.Engine.Internal.SystemGraphics3D, HGamer3D.Engine.Internal.SystemEvent, HGamer3D.Engine.Internal.GameLoop, HGamer3D.Engine.Internal.Event, HGamer3D.Engine.Schema.EventReceiver, HGamer3D.Engine.Schema.EventChannel, HGamer3D.Engine.EcsAPI, HGamer3D.Engine.BaseAPI, HGamer3D.Internal.Engine + Exposed-modules: HGamer3D.Engine.Internal.Component, HGamer3D.Engine.Internal.ComponentType, HGamer3D.Engine.Internal.Entity, HGamer3D.Engine.Internal.System, HGamer3D.Engine.Internal.SystemGraphics3D, HGamer3D.Engine.Internal.SystemEvent, HGamer3D.Engine.Internal.GameLoop, HGamer3D.Engine.Internal.Event, HGamer3D.Engine.Schema.EventReceiver, HGamer3D.Engine.Schema.EventChannel, HGamer3D.Engine.EcsAPI, HGamer3D.Engine.BaseAPI, HGamer3D.Internal.Engine, HGamer3D.GUI.EcsAPI, HGamer3D.Graphics3D.EcsAPI + Other-modules: c-sources: @@ -51,9 +52,9 @@ Library if flag(network) build-depends: HGamer3D-Network >= 0.4 && < 0.5 - exposed-modules: HGamer3D.Network.EcsAPI +-- exposed-modules: HGamer3D.Network.EcsAPI if flag(inputsystem) build-depends: HGamer3D-InputSystem >= 0.4 && < 0.5 - exposed-modules: HGamer3D.InputSystem.EcsAPI +-- exposed-modules: HGamer3D.InputSystem.EcsAPI diff --git a/Main/HGamer3D/GUI/EcsAPI.hs b/Main/HGamer3D/GUI/EcsAPI.hs new file mode 100644 index 0000000..a21c178 --- /dev/null +++ b/Main/HGamer3D/GUI/EcsAPI.hs @@ -0,0 +1,29 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Graphics.hs + +-- | GUI for HGamer3D, ECS public API. +module HGamer3D.GUI.EcsAPI + +( +) + +where + + diff --git a/Main/HGamer3D/Graphics3D/EcsAPI.hs b/Main/HGamer3D/Graphics3D/EcsAPI.hs new file mode 100644 index 0000000..69442ad --- /dev/null +++ b/Main/HGamer3D/Graphics3D/EcsAPI.hs @@ -0,0 +1,46 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2011-2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Graphics.hs + +-- | 3D Graphics for HGamer3D, ECS public API. +module HGamer3D.Graphics3D.EcsAPI + +( + module HGamer3D.Graphics3D.Schema.Camera + , module HGamer3D.Graphics3D.Schema.Figure + , module HGamer3D.Graphics3D.Schema.Geometry + , module HGamer3D.Graphics3D.Schema.Light + , module HGamer3D.Graphics3D.Schema.Material + , module HGamer3D.Graphics3D.Schema.Scene + + +) + +where + + import HGamer3D.Graphics3D.Schema.Camera + import HGamer3D.Graphics3D.Schema.Figure + import HGamer3D.Graphics3D.Schema.Geometry + import HGamer3D.Graphics3D.Schema.Light + import HGamer3D.Graphics3D.Schema.Material + import HGamer3D.Graphics3D.Schema.Scene + + import HGamer3D.Graphics3D.Internal.Base + + From 6dccec1330237130ef086d1804468b870adc0840 Mon Sep 17 00:00:00 2001 From: uotbw Date: Sun, 3 Aug 2014 22:07:50 +0200 Subject: [PATCH 25/28] new example EcsAPI/Coordinates, fixed initial values bug --- Bindings/SConstruct | 147 ------------------ Data/HGamer3D/Data/Colour.hs | 2 + Examples/EcsAPI/Coordinates.hs | 104 +++++++++++++ Examples/EcsAPI/GUI-Switch.hs | 27 +--- Examples/SConstruct | 1 + .../HGamer3D/Graphics3D/Internal/Camera.hs | 8 +- Main/HGamer3D/Engine/EcsAPI.hs | 16 +- Main/HGamer3D/Engine/Internal/Event.hs | 4 + Main/HGamer3D/Engine/Internal/System.hs | 8 + .../Engine/Internal/SystemGraphics3D.hs | 5 + Main/HGamer3D/Engine/Schema/EventReceiver.hs | 1 + Main/HGamer3D/GUI/EcsAPI.hs | 10 +- Main/HGamer3D/Graphics3D/EcsAPI.hs | 6 +- Main/SConstruct | 2 + 14 files changed, 161 insertions(+), 180 deletions(-) delete mode 100644 Bindings/SConstruct create mode 100644 Examples/EcsAPI/Coordinates.hs diff --git a/Bindings/SConstruct b/Bindings/SConstruct deleted file mode 100644 index e75d14c..0000000 --- a/Bindings/SConstruct +++ /dev/null @@ -1,147 +0,0 @@ -# build bindings - -# set environment -################# -from os.path import expanduser, exists -import os, sys -home = expanduser("~") -env = Environment() -env["ENV"]["PATH"] = os.environ.get("PATH") -env["ENV"]["HOME"] = os.environ.get("HOME") - -if env["PLATFORM"] == "win32": - print "works currently only for Linux" - sys.exit(1) - - -# Default target is empty, need to choose between options -######################################################### -Default(None) - - -# Build the library file dependencies -##################################### - -def buildFileDeps(dir, files): - list = [] - for f in files.split(): - list.append(dir + "/Deps/lib/" + f) - env.Command(list, None, "cd " + dir + "/Deps && scons") - return list - -# Enet Files -enetFiles = buildFileDeps("Enet", """ -libenet.so -libenet.so.2 -libenet.so.2.2.0 -""") - -# CEGUI Files -ceguiFiles = buildFileDeps("CEGUI", """ -libCEGUIBase-0.7.7.so -libCEGUIBase.so -libCEGUIFalagardWRBase-0.7.7.so -libCEGUIFalagardWRBase.so -libCEGUIFreeImageImageCodec-0.7.7.so -libCEGUIFreeImageImageCodec.so -libCEGUIOgreRenderer-0.7.7.so -libCEGUIOgreRenderer.so -libCEGUIOpenGLRenderer-0.7.7.so -libCEGUIOpenGLRenderer.so -libCEGUISTBImageCodec-0.7.7.so -libCEGUISTBImageCodec.so -libCEGUITGAImageCodec-0.7.7.so -libCEGUITGAImageCodec.so -libCEGUITinyXMLParser-0.7.7.so -libCEGUITinyXMLParser.so -""") - -# Ogre Files -ogreFiles = buildFileDeps("Ogre", """ -libOgreMain.so -libOgreMain.so.1.8.1 -libOgrePaging.so -libOgrePaging.so.1.8.1 -libOgreProperty.so -libOgreProperty.so.1.8.1 -libOgreRTShaderSystem.so -libOgreRTShaderSystem.so.1.8.1 -libOgreTerrain.so -libOgreTerrain.so.1.8.1 -Plugin_BSPSceneManager.so -Plugin_BSPSceneManager.so.1.8.1 -Plugin_OctreeSceneManager.so -Plugin_OctreeSceneManager.so.1.8.1 -Plugin_OctreeZone.so -Plugin_OctreeZone.so.1.8.1 -Plugin_ParticleFX.so -Plugin_ParticleFX.so.1.8.1 -Plugin_PCZSceneManager.so -Plugin_PCZSceneManager.so.1.8.1 -RenderSystem_GL.so -RenderSystem_GL.so.1.8.1 -""") - -# SDL2 Files -sdl2Files = buildFileDeps("SDL2", """ -libSDL2-2.0.so -libSDL2-2.0.so.0 -libSDL2-2.0.so.0.1.0 -""") - -# SFML Files -sfmlFiles = buildFileDeps("SFML", """ -libsfml-audio.so -libsfml-audio.so.2 -libsfml-audio.so.2.1 -libsfml-graphics.so -libsfml-graphics.so.2 -libsfml-graphics.so.2.1 -libsfml-network.so -libsfml-network.so.2 -libsfml-network.so.2.1 -libsfml-system.so -libsfml-system.so.2 -libsfml-system.so.2.1 -libsfml-window.so -libsfml-window.so.2 -libsfml-window.so.2.1 -""") - -ogreHG3DLib = env.Command("Ogre/cBuild/libhg3dogre032.so", "", "cd Ogre/cBuild && scons") -enetHG3DLib = env.Command("Enet/cBuild/libhg3denet032.so", "", "cd Enet/cBuild && scons") -ceguiHG3DLib = env.Command("CEGUI/cBuild/libhg3dcegui031.so", "", "cd CEGUI/cBuild && scons") -sdl2HG3DLib = env.Command("SDL2/cBuild/libhg3dsdl2033.so", "", "cd SDL2/cBuild && scons") -sfmlHG3DLib = env.Command("SFML/cBuild/libhg3dsfml032.so", "", "cd SFML/cBuild && scons") - -# a couple of aliases, who define the build targets -################################################### - -libpath = home + "/.HGamer3D/lib" -def libFiles(inList): - outList = [] - for fSource in inList: - fTarget = libpath + "/" + os.path.basename(fSource) - outList.append(fTarget) - env.Command(fTarget, fSource, "cp -r $SOURCE $TARGET") - return outList - -# Graphics3D -graphics3DFiles = ogreFiles + ["Ogre/cBuild/libhg3dogre032.so"] -graphics3D = libFiles(graphics3DFiles) -Alias('Graphics3D', graphics3D) - -# GUI -guiFiles = sdl2Files + ["SDL2/cBuild/libhg3dsdl2033.so"] + ceguiFiles + ["CEGUI/cBuild/libhg3dcegui031.so"] -gui = libFiles(guiFiles) -Alias('GUI', gui) - -# Aux -auxFiles = sdl2Files + ["SDL2/cBuild/libhg3dsdl2033.so"] + sfmlFiles + ["SFML/cBuild/libhg3dsfml032.so"] + enetFiles + ["Enet/cBuild/libhg3denet032.so"] -aux = libFiles(auxFiles) -Alias('Aux', aux) - -# all -allFiles = graphics3D + gui + aux -Alias('all', allFiles) - diff --git a/Data/HGamer3D/Data/Colour.hs b/Data/HGamer3D/Data/Colour.hs index 61ce52d..ada6fb2 100644 --- a/Data/HGamer3D/Data/Colour.hs +++ b/Data/HGamer3D/Data/Colour.hs @@ -26,6 +26,7 @@ module HGamer3D.Data.Colour white, silver, grey, + darkgrey, black, red, maroon, @@ -54,6 +55,7 @@ data Colour = Colour { white = Colour 1.0 1.0 1.0 1.0 silver = Colour 0.75 0.75 0.75 1.0 grey = Colour 0.5 0.5 0.5 1.0 +darkgrey = Colour 0.25 0.25 0.25 1.0 black = Colour 0.0 0.0 0.0 1.0 red = Colour 1.0 0.0 0.0 1.0 maroon = Colour 0.5 0.0 0.0 1.0 diff --git a/Examples/EcsAPI/Coordinates.hs b/Examples/EcsAPI/Coordinates.hs new file mode 100644 index 0000000..47a93a8 --- /dev/null +++ b/Examples/EcsAPI/Coordinates.hs @@ -0,0 +1,104 @@ +module Main + +where + +-- import the Ecs API files, needed +import HGamer3D.Data +import HGamer3D.Engine.EcsAPI +import HGamer3D.Graphics3D.EcsAPI + +-- other imports +import Control.Concurrent + +-- define two cameras +darkgrey = Colour 0.2 0.2 0.2 1.0 +camera1 = Camera (Frustum 5.0 5000.0 (Deg 40)) (Viewport 0 (Rectangle 0.0 0.0 1.0 1.0) black) +camera2 = Camera (Frustum 5.0 5000.0 (Deg 10)) (Viewport 1 (Rectangle 0.7 0.7 0.27 0.27) darkgrey) + +-- define some light +light1 = Light white white PointLight + +-- define some test geometry +fzero = SimpleFigure Sphere (ResourceMaterial "Colours/Green") +fx = SimpleFigure Cube (ResourceMaterial "Colours/Blue") +fy = SimpleFigure Cube (ResourceMaterial "Colours/Red") + +figure1 = CombinedFigure [ + (Vec3 0.0 0.0 (-200.0), unitU, unitVec3 &* 0.1, fzero), + (Vec3 20.0 0.0 (-200.0), unitU, unitVec3 &* 0.1, fx), + (Vec3 0.0 20.0 (-200.0), unitU, unitVec3 &* 0.1 , fy) + ] + +-- define event listener, to get quit event +events1 = EventReceiver [ApplicationEvents] + +-- rotate +rotate alpha vstart radius = let + x = (sin alpha) * radius + z = (cos alpha) * radius + in (Vec3 x 0.0 z) &+ vstart + +alphaTime :: IO Float +alphaTime = do + t <- getTime + let t' = fromIntegral ((msec t) `mod` 5000) + let v = (t' * 6.28 / 5000.0) + return v + +main = do + + -- make entities for environment and geometry + + -- camera, light and scene parameters into one + envE <- entity [ + CTCam #: camera1, + CTScP #: SceneParameter white NoShadows NoSky, + CTEvR #: events1 + ] + + -- a rotating camera for fun + rotC <- entity [ + CTPos #: Vec3 0.0 0.0 0.0, + CTOri #: unitU, + CTCam #: camera2 + ] + + -- geometry entity + geoE <- entity [ + CTPos #: unitVec3, + CTOri #: unitU, + CTFig #: figure1 + ] + + -- light entity + liE1 <- entity [ + CTLig #: light1, + CTPos #: Vec3 500.0 500.0 (-500.0) + ] + liE2 <- entity [ + CTLig #: light1, + CTPos #: Vec3 100.0 50.0 0.0 + ] + + -- run graphics system + ecsG3D <- runSystemGraphics3D (msecT 30) + ecsEvt <- runSystemEvent (msecT 110) + let systems = ecsG3D #+ ecsEvt #+ [] + + -- add entities to running system + mapM (addToWorld systems) [envE, rotC, geoE, liE1, liE2] + + let listenQuitLoop = do + evts <- receiveEvents envE + if length (filter (\evt -> case evt of + (AppEvt AppQuit) -> True + _ -> False) evts) == 0 then do + threadDelay 100000 -- wait 100 msec + -- rotate second camera + alpha <- alphaTime + updateC (rotC # CTPos) (const (rotate alpha (Vec3 0.0 0.0 (-200.0)) 400.0)) + updateC (rotC # CTOri) (const (rotU vec3Y alpha)) + listenQuitLoop + else return () + + listenQuitLoop diff --git a/Examples/EcsAPI/GUI-Switch.hs b/Examples/EcsAPI/GUI-Switch.hs index 8fb1951..afe276e 100644 --- a/Examples/EcsAPI/GUI-Switch.hs +++ b/Examples/EcsAPI/GUI-Switch.hs @@ -5,29 +5,9 @@ module Main where import HGamer3D.Data -import HGamer3D.Graphics3D.Schema.Material -import HGamer3D.Graphics3D.Schema.Geometry -import HGamer3D.Graphics3D.Schema.Figure -import HGamer3D.Graphics3D.Schema.Camera -import HGamer3D.Graphics3D.Schema.Light -import HGamer3D.Graphics3D.Schema.Scene - -import HGamer3D.GUI.Schema.Widget -import HGamer3D.GUI.Schema.Layout -import HGamer3D.GUI.Schema.Form -import HGamer3D.GUI.Schema.GUIDim - -import HGamer3D.Engine.Schema.EventReceiver -import HGamer3D.Engine.Schema.EventChannel - -import HGamer3D.Engine.Internal.Entity -import HGamer3D.Engine.Internal.Event - -import HGamer3D.Audio.Schema.AudioSource - -import HGamer3D.WinEvent.BaseAPI import HGamer3D.Engine.EcsAPI -import HGamer3D.Audio.EcsAPI +import HGamer3D.Graphics3D.EcsAPI +import HGamer3D.GUI.EcsAPI import Control.Concurrent @@ -171,9 +151,8 @@ checkEvents guiE bE = do main = do ecsG3D <- runSystemGraphics3D (msecT 30) - ecsAud <- runSystemAudio (msecT 100) ecsEvt <- runSystemEvent (msecT 110) - let systems = ecsG3D #+ ecsAud #+ ecsEvt #+ [] + let systems = ecsG3D #+ ecsEvt #+ [] [camE, bE, guiE] <- makeEs mapM (addToWorld systems) [camE, bE, guiE] checkEvents guiE bE diff --git a/Examples/SConstruct b/Examples/SConstruct index 9cb2be1..ad62417 100644 --- a/Examples/SConstruct +++ b/Examples/SConstruct @@ -29,6 +29,7 @@ for (p, s) in [ # first EcsAPI examples + ("EcsAPI", "Coordinates"), ("EcsAPI", "GUI-Switch") ]: diff --git a/Graphics3D/HGamer3D/Graphics3D/Internal/Camera.hs b/Graphics3D/HGamer3D/Graphics3D/Internal/Camera.hs index eff3b9c..0d5b45b 100644 --- a/Graphics3D/HGamer3D/Graphics3D/Internal/Camera.hs +++ b/Graphics3D/HGamer3D/Graphics3D/Internal/Camera.hs @@ -93,14 +93,14 @@ addCamera g3ds schema = do -- create camera cameraName <- (nextUniqueName uname) >>= (\n -> return ("Camera"++n)) camera <- SceneManager.createCamera sceneManager cameraName - -- set Frustum parameters - Frustum.setNearClipDistance camera nd - Frustum.setFarClipDistance camera fd - Frustum.setFOVy camera (fromAngle fov) -- add Viewport viewport <- RenderTarget.addViewport renderWindow camera z (rectX pos) (rectY pos) (rectWidth pos) (rectHeight pos) -- set Viewport parameters Viewport.setBackgroundColour viewport bgr + -- set Frustum parameters + Frustum.setNearClipDistance camera nd + Frustum.setFarClipDistance camera fd + Frustum.setFOVy camera (fromAngle fov) -- create camera return value let cam = Camera camera viewport schema -- adapt aspect ratio diff --git a/Main/HGamer3D/Engine/EcsAPI.hs b/Main/HGamer3D/Engine/EcsAPI.hs index 578a2e4..006a34b 100644 --- a/Main/HGamer3D/Engine/EcsAPI.hs +++ b/Main/HGamer3D/Engine/EcsAPI.hs @@ -49,11 +49,19 @@ module HGamer3D.Engine.EcsAPI -- * System -- $System System, - ECSGraphics3D, - runSystemGraphics3D, ECSEventQueues, runSystemEvent, + HG3DEvent (..), + GUIFormEvent (..), + ApplicationEvent (..), + AudioEvent (..), + + sendEvent, + receiveEvents, + + module HGamer3D.Engine.Schema.EventReceiver, + module HGamer3D.Engine.Schema.EventChannel, SomeSystem, (#+), @@ -63,6 +71,10 @@ module HGamer3D.Engine.EcsAPI ) where import HGamer3D.Internal.Engine +import HGamer3D.Engine.Schema.EventReceiver +import HGamer3D.Engine.Schema.EventChannel + + diff --git a/Main/HGamer3D/Engine/Internal/Event.hs b/Main/HGamer3D/Engine/Internal/Event.hs index 4c9640a..17b11d6 100644 --- a/Main/HGamer3D/Engine/Internal/Event.hs +++ b/Main/HGamer3D/Engine/Internal/Event.hs @@ -39,11 +39,15 @@ data GUIFormEvent = FormSetValue [(String, F.FormValue)] | FormButtonClick String deriving (Show) +data ApplicationEvent = AppQuit + deriving (Show) + data HG3DEvent = WindowEvt SDLEvent | GUIEvt GUIEvent -- ^ Low level GUI evts | FormEvt GUIFormEvent -- ^ High level GUI evts, directly form related | AudioEvt AudioEvent | UserEvt Dynamic + | AppEvt ApplicationEvent deriving (Show) diff --git a/Main/HGamer3D/Engine/Internal/System.hs b/Main/HGamer3D/Engine/Internal/System.hs index 78aff4e..95efb83 100644 --- a/Main/HGamer3D/Engine/Internal/System.hs +++ b/Main/HGamer3D/Engine/Internal/System.hs @@ -215,6 +215,11 @@ lacApplyOtherChanges lac lac' update' = do stampedVal <- readC c >>= return . fromJust let val = fromStamped stampedVal HT.insert (lacCache lac) eid ((), stampedVal) -- empty engine value, only need to store stampedValue + -- do one time change in main component + mMainCacheVal <- HT.lookup (lacCache lac') eid + case mMainCacheVal of + Just (engineMainVal, stampedMainCacheVal) -> update' val engineMainVal (fromStamped stampedMainCacheVal) + Nothing -> return () modifyIORef (lacList lac) ( (:) (eid, c) ) ) insertList putMVar (lacAddList lac) [] @@ -330,6 +335,9 @@ filterEventType types events = let UserEvents -> case evt of (UserEvt _ ) -> True _ -> False + ApplicationEvents -> case evt of + (AppEvt _) -> True + _ -> False AllEvents -> True _ -> False filterAllTypes evttypes evt = length (filter id (map (filterOneType evt) evttypes)) > 0 diff --git a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs index 049b3ed..66b0731 100644 --- a/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs +++ b/Main/HGamer3D/Engine/Internal/SystemGraphics3D.hs @@ -47,6 +47,8 @@ import Data.List.Split import qualified HGamer3D.Data as D import qualified HGamer3D.Internal.Graphics3D as Gr import qualified HGamer3D.Engine.BaseAPI as E +import qualified HGamer3D.Engine.Internal.Event as Evt + import qualified HGamer3D.GUI.BaseAPI as GU import qualified HGamer3D.WinEvent.BaseAPI as WinEvt @@ -232,6 +234,9 @@ instance System ECSGraphics3D where mapM (\(eid, com) -> do _pushC2UEvents com evts _pushC2UEvents com evts' + if qFlag then + _pushC2UEvents com [Evt.AppEvt Evt.AppQuit] + else return () ) inList diff --git a/Main/HGamer3D/Engine/Schema/EventReceiver.hs b/Main/HGamer3D/Engine/Schema/EventReceiver.hs index 372a9b9..7979bba 100644 --- a/Main/HGamer3D/Engine/Schema/EventReceiver.hs +++ b/Main/HGamer3D/Engine/Schema/EventReceiver.hs @@ -36,6 +36,7 @@ data EventType = ChannelEvents | FormEvents | JoystickEvents | UserEvents + | ApplicationEvents | AllEvents deriving (Eq, Show, Typeable) diff --git a/Main/HGamer3D/GUI/EcsAPI.hs b/Main/HGamer3D/GUI/EcsAPI.hs index a21c178..1304ef9 100644 --- a/Main/HGamer3D/GUI/EcsAPI.hs +++ b/Main/HGamer3D/GUI/EcsAPI.hs @@ -22,8 +22,16 @@ module HGamer3D.GUI.EcsAPI ( + module HGamer3D.GUI.Schema.Form, + module HGamer3D.GUI.Schema.GUIDim, + module HGamer3D.GUI.Schema.Layout, + module HGamer3D.GUI.Schema.Widget ) where - +import HGamer3D.GUI.Schema.Form +import HGamer3D.GUI.Schema.GUIDim +import HGamer3D.GUI.Schema.Layout +import HGamer3D.GUI.Schema.Widget +import HGamer3D.Internal.GUI diff --git a/Main/HGamer3D/Graphics3D/EcsAPI.hs b/Main/HGamer3D/Graphics3D/EcsAPI.hs index 69442ad..7924ed7 100644 --- a/Main/HGamer3D/Graphics3D/EcsAPI.hs +++ b/Main/HGamer3D/Graphics3D/EcsAPI.hs @@ -19,6 +19,7 @@ -- Graphics.hs -- | 3D Graphics for HGamer3D, ECS public API. + module HGamer3D.Graphics3D.EcsAPI ( @@ -29,7 +30,8 @@ module HGamer3D.Graphics3D.EcsAPI , module HGamer3D.Graphics3D.Schema.Material , module HGamer3D.Graphics3D.Schema.Scene - + , ECSGraphics3D + , runSystemGraphics3D ) where @@ -41,6 +43,6 @@ where import HGamer3D.Graphics3D.Schema.Material import HGamer3D.Graphics3D.Schema.Scene - import HGamer3D.Graphics3D.Internal.Base + import HGamer3D.Engine.Internal.SystemGraphics3D diff --git a/Main/SConstruct b/Main/SConstruct index 9390956..79cb83e 100644 --- a/Main/SConstruct +++ b/Main/SConstruct @@ -25,6 +25,8 @@ dependsOn = [ Glob("HGamer3D/Engine/*"), Glob("HGamer3D/Engine/Internal/*"), Glob("HGamer3D/Engine/Schema/*"), + Glob("HGamer3D/GUI/*"), + Glob("HGamer3D/Graphics3D/*"), Glob("*.cabal"), "LICENSE", From 4f5c539e8e7b9fb4de1a9066d0d011fd97366783 Mon Sep 17 00:00:00 2001 From: uotbw Date: Sun, 10 Aug 2014 23:13:31 +0200 Subject: [PATCH 26/28] updated examples (EcsAPI)# --- Examples/EcsAPI/Coordinates.hs | 41 +++++++++--- Examples/EcsAPI/GUI-Switch.hs | 17 +++++ Examples/EcsAPI/RotatePlaton.hs | 108 ++++++++++++++++++++++++++++++++ Examples/SConstruct | 1 + 4 files changed, 158 insertions(+), 9 deletions(-) create mode 100644 Examples/EcsAPI/RotatePlaton.hs diff --git a/Examples/EcsAPI/Coordinates.hs b/Examples/EcsAPI/Coordinates.hs index 47a93a8..02a5e7f 100644 --- a/Examples/EcsAPI/Coordinates.hs +++ b/Examples/EcsAPI/Coordinates.hs @@ -1,8 +1,29 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Coordinates.hs +-- Orientate yourself in 3D world + module Main where --- import the Ecs API files, needed +-- import the needed Ecs API files import HGamer3D.Data import HGamer3D.Engine.EcsAPI import HGamer3D.Graphics3D.EcsAPI @@ -11,14 +32,13 @@ import HGamer3D.Graphics3D.EcsAPI import Control.Concurrent -- define two cameras -darkgrey = Colour 0.2 0.2 0.2 1.0 camera1 = Camera (Frustum 5.0 5000.0 (Deg 40)) (Viewport 0 (Rectangle 0.0 0.0 1.0 1.0) black) camera2 = Camera (Frustum 5.0 5000.0 (Deg 10)) (Viewport 1 (Rectangle 0.7 0.7 0.27 0.27) darkgrey) -- define some light light1 = Light white white PointLight --- define some test geometry +-- define a geometry, which is laid out in different axes fzero = SimpleFigure Sphere (ResourceMaterial "Colours/Green") fx = SimpleFigure Cube (ResourceMaterial "Colours/Blue") fy = SimpleFigure Cube (ResourceMaterial "Colours/Red") @@ -32,12 +52,7 @@ figure1 = CombinedFigure [ -- define event listener, to get quit event events1 = EventReceiver [ApplicationEvents] --- rotate -rotate alpha vstart radius = let - x = (sin alpha) * radius - z = (cos alpha) * radius - in (Vec3 x 0.0 z) &+ vstart - +-- rotation helper functions alphaTime :: IO Float alphaTime = do t <- getTime @@ -45,6 +60,11 @@ alphaTime = do let v = (t' * 6.28 / 5000.0) return v +rotate alpha vstart radius = let + x = (sin alpha) * radius + z = (cos alpha) * radius + in (Vec3 x 0.0 z) &+ vstart + main = do -- make entities for environment and geometry @@ -80,6 +100,8 @@ main = do CTPos #: Vec3 100.0 50.0 0.0 ] + -- end definition of entities + -- run graphics system ecsG3D <- runSystemGraphics3D (msecT 30) ecsEvt <- runSystemEvent (msecT 110) @@ -102,3 +124,4 @@ main = do else return () listenQuitLoop + diff --git a/Examples/EcsAPI/GUI-Switch.hs b/Examples/EcsAPI/GUI-Switch.hs index afe276e..d62c01d 100644 --- a/Examples/EcsAPI/GUI-Switch.hs +++ b/Examples/EcsAPI/GUI-Switch.hs @@ -1,4 +1,21 @@ {-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. module Main diff --git a/Examples/EcsAPI/RotatePlaton.hs b/Examples/EcsAPI/RotatePlaton.hs new file mode 100644 index 0000000..34de21f --- /dev/null +++ b/Examples/EcsAPI/RotatePlaton.hs @@ -0,0 +1,108 @@ +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- RotatePlaton.hs +-- Setup Basic Elements + +module Main + +where + +-- initialization + +-- import the needed Ecs API files +import HGamer3D.Data +import HGamer3D.Engine.EcsAPI +import HGamer3D.Graphics3D.EcsAPI + +-- other imports +import Control.Concurrent + +-- define a camera +camera1 = Camera (Frustum 5.0 5000.0 (Deg 40)) (Viewport 0 (Rectangle 0.0 0.0 1.0 1.0) black) + +-- define some light and the geometry +light1 = Light white white PointLight +platon = SimpleFigure Dodekaeder (ResourceMaterial "Colours/Red") + +-- define event listener, to get quit event +events1 = EventReceiver [ApplicationEvents] + +-- rotation angle, depending on time +rotationAngle :: IO Float +rotationAngle = do + t <- getTime + let t' = fromIntegral ((msec t) `mod` 5000) + let v = (t' * 6.28 / 5000.0) + return v + +-- main program +main = do + + -- make entities and hand it to the runtime systems + + -- camera, light and scene parameters into one + envE <- entity [ + CTCam #: camera1, + CTScP #: SceneParameter white NoShadows NoSky, + CTEvR #: events1 + ] + + -- geometry and light entities + geoE <- entity [ + CTPos #: Vec3 0.0 0.0 (-20.0), + CTOri #: unitU, + CTFig #: platon + ] + liE1 <- entity [ + CTLig #: light1, + CTPos #: Vec3 500.0 500.0 (-500.0) + ] + liE2 <- entity [ + CTLig #: light1, + CTPos #: Vec3 100.0 50.0 0.0 + ] + + -- run graphics system + ecsG3D <- runSystemGraphics3D (msecT 30) + ecsEvt <- runSystemEvent (msecT 110) + let systems = ecsG3D #+ ecsEvt #+ [] + + -- add entities to running system + mapM (addToWorld systems) [envE, geoE, liE1, liE2] + + -- run logic until quit (logis is to rotate the dodekaeder) + + -- run until quit + let listenQuitLoop = do + -- receive event and quit loop on AppQuit + evts <- receiveEvents envE + if length (filter (\evt -> case evt of + (AppEvt AppQuit) -> True + _ -> False) evts) > 0 + then return () + else do + -- wait 100 msec to save CPU time + threadDelay 100000 + -- rotate geometry + rangle <- rotationAngle + updateC (geoE # CTOri) (const (rotU vec3Y rangle)) + listenQuitLoop + + listenQuitLoop + diff --git a/Examples/SConstruct b/Examples/SConstruct index ad62417..7a16d39 100644 --- a/Examples/SConstruct +++ b/Examples/SConstruct @@ -29,6 +29,7 @@ for (p, s) in [ # first EcsAPI examples + ("EcsAPI", "RotatePlaton"), ("EcsAPI", "Coordinates"), ("EcsAPI", "GUI-Switch") From e651ec4101954c84bfb56d72502abda2e794676d Mon Sep 17 00:00:00 2001 From: uotbw Date: Mon, 11 Aug 2014 18:14:02 +0200 Subject: [PATCH 27/28] new example with material manager --- Examples/EcsAPI/MaterialManager.hs | 200 ++++++++++++++++++ Examples/SConstruct | 1 + .../HGamer3D/Graphics3D/Internal/Shapes.hs | 12 +- 3 files changed, 207 insertions(+), 6 deletions(-) create mode 100644 Examples/EcsAPI/MaterialManager.hs diff --git a/Examples/EcsAPI/MaterialManager.hs b/Examples/EcsAPI/MaterialManager.hs new file mode 100644 index 0000000..8b8e3fa --- /dev/null +++ b/Examples/EcsAPI/MaterialManager.hs @@ -0,0 +1,200 @@ +{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} +-- This source file is part of HGamer3D +-- (A project to enable 3D game development in Haskell) +-- For the latest info, see http://www.hgamer3d.org +-- +-- (c) 2014 Peter Althainz +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Material Manager Example + +module Main + +where + +import HGamer3D.Data +import HGamer3D.Engine.EcsAPI +import HGamer3D.Graphics3D.EcsAPI +import HGamer3D.GUI.EcsAPI + +import Control.Concurrent + +-- the things we need for the rotating entity +camera1 = Camera (Frustum 5.0 5000.0 (Deg 40)) (Viewport 0 (Rectangle 0.0 0.0 1.0 1.0) black) + +light1 = Light white white PointLight + +toFigure scale geo mat = CombinedFigure [(zeroVec3, unitU, scale, SimpleFigure geo mat)] +fromFigure fig = case fig of + CombinedFigure [(zeroVec3, unitU, scale, SimpleFigure geo mat)] -> (scale, geo, mat) + _ -> error "wrong figure type" +platon = toFigure unitVec3 Dodekaeder (ResourceMaterial "Colours/Red") + +rotationAngle :: IO Float +rotationAngle = do + t <- getTime + let t' = fromIntegral ((msec t) `mod` 5000) + let v = (t' * 6.28 / 5000.0) + return v + +-- define event listener, to get quit event and GUI events +events = EventReceiver [ApplicationEvents, FormEvents] + +-- define gui layout for radio button switch selection on the left +shapeSelect = Form "Vanilla" + (LayoutFC (Window "Select Shape" [ + Text "Select Shape", + XPos (GUIDim 0.0 0.0), + YPos (GUIDim 0.1 0.0), + Width (GUIDim 0.2 0.0), + Height (GUIDim 0.5 0.0) + ]) [ + + ( + LayoutFC (VerticalLayout [ + Width (GUIDim 0.2 0.0), + Height (GUIDim 0.5 0.0) + ]) + [ + (WidgetFC (RadioButton "Sphere" [ + Margin (GUIDim 0.0 5.0), + Text "Sphere", + Width (GUIDim 1.0 0.0), + Height (GUIDim 0.0 20.0), + Selected False + ] )), + (WidgetFC (RadioButton "Cube" [ + Margin (GUIDim 0.0 5.0), + Text "Cube", + Width (GUIDim 1.0 0.0), + Height (GUIDim 0.0 20.0), + Selected False + ] )), + (WidgetFC (RadioButton "Dodekaeder" [ + Margin (GUIDim 0.0 5.0), + Text "Dodekaeder", + Width (GUIDim 1.0 0.0), + Height (GUIDim 0.0 20.0), + Selected True + ] )), + (WidgetFC (RadioButton "Ikosaeder" [ + Margin (GUIDim 0.0 5.0), + Text "Ikosaeder", + Width (GUIDim 1.0 0.0), + Height (GUIDim 0.0 20.0), + Selected False + ] )) + ] + )]) + +-- define gui layout for material selection window on the right +materialSelect = Form "Vanilla" + (LayoutFC (Window "Select Material" [ + Text "Select Material", + XPos (GUIDim 0.8 0.0), + YPos (GUIDim 0.1 0.0), + Width (GUIDim 0.2 0.0), + Height (GUIDim 0.5 0.0) + ]) [ + + ( + LayoutFC (VerticalLayout [ + Width (GUIDim 1.0 0.0), + Height (GUIDim 1.0 0.0) + ]) + [ + (WidgetFC (ComboBox "Material" [ + Margin (GUIDim 0.0 5.0), + Text "", Width (GUIDim 1.0 0.0), Height (GUIDim 1.0 0.0), - TextChoice ["Blue", "Green", "Red"] + TextChoice (map fst materials) ] )) ] )]) +-- define the materials +materials = [ + ("Red", ResourceMaterial "Colours/Red"), + ("Green", ResourceMaterial "Colours/Green"), + ("Blue", ResourceMaterial "Colours/Blue") + ] -- main program main = do @@ -167,9 +178,9 @@ main = do mapM (addToWorld systems) [envE, geoE, liE1, liE2, leftGuiE, rightGuiE] -- changing a material - let materialChange [(_, FVS mat)] = updateC (geoE # CTFig) (\fig -> let (scale, geo, _) = fromFigure fig in toFigure scale geo (ResourceMaterial ("Colours/" ++ mat))) + let materialChange [(_, FVS mat)] = updateC (geoE # CTFig) (\fig -> let (scale, geo, _) = fromFigure fig in toFigure scale geo (fromJust (lookup mat materials))) - -- change sphere + -- change shape let doshape name = case name of "Sphere" -> updateC (geoE # CTFig) (\fig -> let (scale, geo, mat) = fromFigure fig in toFigure (unitVec3 &* 0.05) Sphere mat) "Cube" -> updateC (geoE # CTFig) (\fig -> let (scale, geo, mat) = fromFigure fig in toFigure (unitVec3 &* 0.03) Cube mat) @@ -195,6 +206,7 @@ main = do updateC (geoE # CTOri) (const (rotU vec3Y rangle)) loop + -- run loop loop