diff --git a/Audio/HGamer3D-Audio.cabal b/Audio/HGamer3D-Audio.cabal index 269eaa4..edaaf84 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, containers, 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.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/BaseAPI.hs b/Audio/HGamer3D/Audio/BaseAPI.hs new file mode 100644 index 0000000..eebf45f --- /dev/null +++ b/Audio/HGamer3D/Audio/BaseAPI.hs @@ -0,0 +1,78 @@ +-- 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, public API. +module HGamer3D.Audio.BaseAPI + +( + -- * Audio Data Types + module HGamer3D.Bindings.SFML.EnumSoundSourceStatus, + AudioSource, + AudioSlots, + + -- * Audio Listener Functions + setAudioMainVolume, + getAudioMainVolume, + setAudioListenerPosition, + setAudioListenerDirection, + + -- * Audio Source Creation Functions + musicAudioSource, + soundAudioSource, + freeAudioSource, + + -- * Audio Source Play Functions + playAudioSource, + pauseAudioSource, + stopAudioSource, + + -- * Audio Source Property Functions + setAudioSourceLoop, + getAudioSourceLoop, + + getAudioSourceVolume, + setAudioSourceVolume, + + getAudioSourcePitch, + setAudioSourcePitch, + + getAudioSourcePosition, + setAudioSourcePosition, + + getAudioSourceAttenuation, + setAudioSourceAttenuation, + + getAudioSourceMinDistance, + setAudioSourceMinDistance, + + setAudioSourcePositionDependent, + isAudioSourcePositionDependent, + + audioSlots, + updateAudioSlots + + +) + +where + +import HGamer3D.Audio.Internal.Base +import HGamer3D.Bindings.SFML.EnumSoundSourceStatus diff --git a/Audio/HGamer3D/Audio.hs b/Audio/HGamer3D/Audio/Internal/Base.hs similarity index 77% rename from Audio/HGamer3D/Audio.hs rename to Audio/HGamer3D/Audio/Internal/Base.hs index 0014ac4..65dea3f 100644 --- a/Audio/HGamer3D/Audio.hs +++ b/Audio/HGamer3D/Audio/Internal/Base.hs @@ -1,6 +1,9 @@ +{-# 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 -- @@ -16,63 +19,18 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Audio.hs - - --- | Audio functionality for HGamer3D -module HGamer3D.Audio - -( - -- * Types - module HGamer3D.Bindings.SFML.EnumSoundSourceStatus, - - AudioSource (..), - - -- * Audio Listener Functions - setAudioMainVolume, - getAudioMainVolume, - setAudioListenerPosition, - setAudioListenerDirection, - - -- * Audio Source creation and delete Functions - createMusic, - createSound, - deleteAudioSource, - - -- * Audio Source play function - playAudioSource, - pauseAudioSource, - stopAudioSource, - - -- * Audio Source property functions - setAudioSourceLoop, - getAudioSourceLoop, - - getAudioSourceVolume, - setAudioSourceVolume, - - getAudioSourcePitch, - setAudioSourcePitch, +-- Audio/Internal/Base.hs - getAudioSourcePosition, - setAudioSourcePosition, - - getAudioSourceAttenuation, - setAudioSourceAttenuation, - - getAudioSourceMinDistance, - setAudioSourceMinDistance, - - setAudioSourcePositionDependent, - isAudioSourcePositionDependent - -) +-- | 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 where import GHC.Ptr import HGamer3D.Data +import HGamer3D.Data.HG3DClass + import HGamer3D.Util import HGamer3D.Bindings.SFML.ClassPtr @@ -86,15 +44,21 @@ 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 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 @@ -129,9 +93,9 @@ _findMusicFile filename = do -- | create music (stream source, reading from file) -createMusic :: String -- ^ filename of music +musicAudioSource :: String -- ^ filename of music -> IO (Maybe AudioSource) -- ^ audio source, which can be played -createMusic filename = do +musicAudioSource filename = do music <- Music.new -- try to find file in hg3d directories filepath <-_findMusicFile filename @@ -147,9 +111,9 @@ createMusic filename = do Nothing -> return Nothing -- | create sound (stream source, loaded into memory) -createSound :: String -- ^ filename of sound without path +soundAudioSource :: String -- ^ filename of sound without path -> IO (Maybe AudioSource) -- ^ audio source, which can be played -createSound filename = do +soundAudioSource filename = do sound <- Sound.new buffer <- SoundBuffer.new filepath <-_findMusicFile filename @@ -167,8 +131,8 @@ createSound filename = do Nothing -> return Nothing -- | delete audio source -deleteAudioSource :: AudioSource -> IO () -deleteAudioSource (Music music) = do +freeAudioSource :: AudioSource -> IO () +freeAudioSource (Music music) = do Music.delete music deleteAudioSource (Sound sound buffer) = do Sound.delete sound @@ -296,3 +260,41 @@ 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, 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 + 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/Wire/Setup.hs b/Audio/HGamer3D/Internal/Audio.hs similarity index 80% rename from Wire/Setup.hs rename to Audio/HGamer3D/Internal/Audio.hs index 5c383dc..5308ab9 100644 --- a/Wire/Setup.hs +++ b/Audio/HGamer3D/Internal/Audio.hs @@ -16,7 +16,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. --- Setup.hs +-- Audio.hs -import Distribution.Simple -main = defaultMain + +-- | 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 b51ca7e..975481f 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,23 @@ env["ENV"]["HOME"] = os.environ.get("HOME") ########################## dependsOn = [ - Glob("HGamer3D/*"), + "HGamer3D/Audio/BaseAPI.hs", + "HGamer3D/Internal/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..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'] @@ -546,8 +622,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'] @@ -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..c498443 100644 --- a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp +++ b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.cpp @@ -81,3 +81,60 @@ 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; +} + +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 009b715..83a66bd 100644 --- a/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h +++ b/Bindings-HBind-Source/CEGUI/Source/HG3DWindowStaticFunctions.h @@ -40,5 +40,21 @@ 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); + + // 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-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/Ogre.cfg b/Bindings-HBind-Source/Ogre/Ogre.cfg index d852846..22d69a2 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.3'] + Engine, Graphics', !!python/unicode '0.4.0'] /config/namespaces: - class: Namespace values: [!!python/unicode 'namespace Ogre'] 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..6edbfbf 100644 --- a/Bindings-HBind-Source/SDL2/SDL2.cfg +++ b/Bindings-HBind-Source/SDL2/SDL2.cfg @@ -824,86 +824,87 @@ 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\ - \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\ + !!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 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'] @@ -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..c31d5c7 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" @@ -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/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..c137f7c 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" @@ -157,3 +157,88 @@ 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); +; +}; + +// +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/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..0bdb570 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" @@ -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/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..68694b9 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" @@ -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 d757702..b8a1131 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" @@ -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/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..f29c198 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" @@ -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/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/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/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..3c83493 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" @@ -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/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/HG3DWindowStaticFunctions.cpp b/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp index f08201e..c498443 100644 --- a/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp +++ b/Bindings/CEGUI/cBuild/HG3DWindowStaticFunctions.cpp @@ -81,3 +81,60 @@ 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; +} + +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/SConstruct b/Bindings/CEGUI/cBuild/SConstruct index 04c3aaa..27afe6f 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","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, "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","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, "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/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..a08a286 100644 --- a/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/cBuild/include/ClassHG3DWindowStaticFunctions.h @@ -37,6 +37,9 @@ #include "ClassSlider.h" #include "ClassSpinner.h" #include "ClassMultiColumnList.h" +#include "ClassUDim.h" +#include "ClassUVector2.h" +#include "ClassSystem.h" // @@ -72,4 +75,31 @@ 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); + +// +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/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/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/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..83a66bd 100644 --- a/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/cBuild/include/HG3DWindowStaticFunctions.h @@ -40,5 +40,21 @@ 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); + + // 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-CEGUI-Binding.cabal b/Bindings/CEGUI/hBuild/HGamer3D-CEGUI-Binding.cabal index e0aa60c..5f4ff83 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/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.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.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: @@ -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/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..36daf15 100644 --- a/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs +++ b/Bindings/CEGUI/hBuild/HGamer3D/Bindings/CEGUI/ClassHG3DWindowStaticFunctions.chs @@ -96,3 +96,49 @@ 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*} -> `()' #} + +{- 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/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/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/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..a08a286 100644 --- a/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/hBuild/include/ClassHG3DWindowStaticFunctions.h @@ -37,6 +37,9 @@ #include "ClassSlider.h" #include "ClassSpinner.h" #include "ClassMultiColumnList.h" +#include "ClassUDim.h" +#include "ClassUVector2.h" +#include "ClassSystem.h" // @@ -72,4 +75,31 @@ 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); + +// +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/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/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/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..83a66bd 100644 --- a/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h +++ b/Bindings/CEGUI/hBuild/include/HG3DWindowStaticFunctions.h @@ -40,5 +40,21 @@ 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); + + // 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/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/cBuild/SConstruct b/Bindings/Ogre/cBuild/SConstruct index 829ed86..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.3 +# 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 /DHGamer3DOgre033_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("hg3dogre033", ["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.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, "hg3dogre033.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("hg3dogre033", ["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.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, "libhg3dogre033.so") + env.Install(libpath, "libhg3dogre040.so") diff --git a/Bindings/Ogre/cBuild/include/OgreDllDefines.h b/Bindings/Ogre/cBuild/include/OgreDllDefines.h index 37cf974..c4b79df 100644 --- a/Bindings/Ogre/cBuild/include/OgreDllDefines.h +++ b/Bindings/Ogre/cBuild/include/OgreDllDefines.h @@ -16,10 +16,10 @@ // OgreDllDefines.h -#ifndef _HGamer3DOgre033_DLLDEFINES_H_ -#define _HGamer3DOgre033_DLLDEFINES_H_ +#ifndef _HGamer3DOgre040_DLLDEFINES_H_ +#define _HGamer3DOgre040_DLLDEFINES_H_ -/* Cmake will define HGamer3DOgre033_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(HGamer3DOgre033_EXPORTS) + #if defined(HGamer3DOgre040_EXPORTS) #define Ogre_LIB_EXPORT __declspec(dllexport) #else #define Ogre_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DOgre033_EXPORTS */ + #endif /* HGamer3DOgre040_EXPORTS */ #else /* defined (_WIN32) */ #define Ogre_LIB_EXPORT #endif -#endif /* _HGamer3DOgre033_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 38e48b5..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.3 +Version: 0.4.0 Synopsis: Ogre Binding for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming @@ -33,6 +33,6 @@ Library Build-tools: build-depends: if os(windows) - extra-libraries: hg3dogre033 + extra-libraries: hg3dogre040 else - extra-libraries: hg3dogre033,OgreMain,OgrePaging,OgreProperty,OgreRTShaderSystem,OgreTerrain + extra-libraries: hg3dogre040,OgreMain,OgrePaging,OgreProperty,OgreRTShaderSystem,OgreTerrain 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/OgreDllDefines.h b/Bindings/Ogre/hBuild/include/OgreDllDefines.h index 37cf974..c4b79df 100644 --- a/Bindings/Ogre/hBuild/include/OgreDllDefines.h +++ b/Bindings/Ogre/hBuild/include/OgreDllDefines.h @@ -16,10 +16,10 @@ // OgreDllDefines.h -#ifndef _HGamer3DOgre033_DLLDEFINES_H_ -#define _HGamer3DOgre033_DLLDEFINES_H_ +#ifndef _HGamer3DOgre040_DLLDEFINES_H_ +#define _HGamer3DOgre040_DLLDEFINES_H_ -/* Cmake will define HGamer3DOgre033_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(HGamer3DOgre033_EXPORTS) + #if defined(HGamer3DOgre040_EXPORTS) #define Ogre_LIB_EXPORT __declspec(dllexport) #else #define Ogre_LIB_EXPORT __declspec(dllimport) - #endif /* HGamer3DOgre033_EXPORTS */ + #endif /* HGamer3DOgre040_EXPORTS */ #else /* defined (_WIN32) */ #define Ogre_LIB_EXPORT #endif -#endif /* _HGamer3DOgre033_DLLDEFINES_H_ */ +#endif /* _HGamer3DOgre040_DLLDEFINES_H_ */ 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/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..706676f 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 @@ -73,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 @@ -93,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/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 6887102..1680aea 100644 --- a/Data/HGamer3D-Data.cabal +++ b/Data/HGamer3D-Data.cabal @@ -1,5 +1,5 @@ Name: HGamer3D-Data -Version: 0.3.2 +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 @@ -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.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.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 75ea5aa..30d3c95 100644 --- a/Data/HGamer3D/Data.hs +++ b/Data/HGamer3D/Data.hs @@ -23,22 +23,24 @@ module HGamer3D.Data ( - module HGamer3D.Data.HG3DClass, module HGamer3D.Data.Angle, module HGamer3D.Data.Colour, - module HGamer3D.Data.Operation3D, - module HGamer3D.Data.TimeMS, + module HGamer3D.Data.Transform3D, + module HGamer3D.Data.GameTime, module HGamer3D.Data.Vector, - module HGamer3D.Data.ScreenGeometry + module HGamer3D.Data.Geometry2D, + module HGamer3D.Data.TypeSynonyms, + Window, ) where -import HGamer3D.Data.HG3DClass import HGamer3D.Data.Angle import HGamer3D.Data.Colour -import HGamer3D.Data.Operation3D -import HGamer3D.Data.TimeMS +import HGamer3D.Data.Transform3D +import HGamer3D.Data.GameTime import HGamer3D.Data.Vector -import HGamer3D.Data.ScreenGeometry +import HGamer3D.Data.Geometry2D +import HGamer3D.Data.Window +import HGamer3D.Data.TypeSynonyms diff --git a/Data/HGamer3D/Data/Colour.hs b/Data/HGamer3D/Data/Colour.hs index 3f56855..ada6fb2 100644 --- a/Data/HGamer3D/Data/Colour.hs +++ b/Data/HGamer3D/Data/Colour.hs @@ -18,18 +18,57 @@ -- 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, + darkgrey, + 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 +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 +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/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/Data/HGamer3D/Data/ScreenGeometry.hs b/Data/HGamer3D/Data/Geometry2D.hs similarity index 59% rename from Data/HGamer3D/Data/ScreenGeometry.hs rename to Data/HGamer3D/Data/Geometry2D.hs index ec5fb3c..9ca5baf 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,36 +29,36 @@ 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) +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 upperLeft lowerRight = Rectangle x y w h where - x = ptX upperLeft - y = ptY upperLeft - w = (ptX lowerRight) - x - h = (ptY lowerRight) - y +rectFromPoints :: Num a => Point a -> Point a -> Rectangle a +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 :: Num a => Rectangle a -> (Point a, Point a) 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..613012d --- /dev/null +++ b/Data/HGamer3D/Data/Transform3D.hs @@ -0,0 +1,96 @@ +-- 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 + HasPosition (..), + HasSize (..), + HasOrientation (..), + + -- * Functions + translate, + scale, + yaw, + pitch, + roll +) + +where + +import HGamer3D.Data.Vector +import HGamer3D.Data.Angle +import HGamer3D.Data.TypeSynonyms + +-- | a type with a HasPosition instance has a Position +class HasPosition t where + + -- | get position function + position :: t -> IO Position + -- | set position function + positionTo :: t -> Position -> IO () + +-- | a type with a HasSize instance has a Size +class HasSize t where + + -- | get scale function + size :: t -> IO Size + -- | set scale function + sizeTo :: t -> Size -> IO () + +-- | a type with an HasOrientation instance has an oriented in space +class HasOrientation t where + -- | get orientation function + orientation :: t -> IO Orientation + -- | set orientation function + 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 -> 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 -> Angle -> Orientation +yaw ori val = rotRelativeToObjectAxis ori vec3Y (fromAngle val) + +-- | rotate object on own axis (roll) by angle +roll :: Orientation -> Angle -> Orientation +roll ori val = rotRelativeToObjectAxis ori vec3Z (fromAngle val) + +-- | rotate object on own axis (pitch) by angle +pitch :: Orientation -> Angle -> Orientation +pitch ori val = rotRelativeToObjectAxis ori vec3X (fromAngle val) + diff --git a/Data/HGamer3D/Data/TypeSynonyms.hs b/Data/HGamer3D/Data/TypeSynonyms.hs new file mode 100644 index 0000000..2bbea1b --- /dev/null +++ b/Data/HGamer3D/Data/TypeSynonyms.hs @@ -0,0 +1,33 @@ +-- 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/TypeSynonyms.hs + +-- | Module providing better type names for standard types in HGamer3D +module HGamer3D.Data.TypeSynonyms + +where + +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 + + diff --git a/Data/HGamer3D/Data/Vector.hs b/Data/HGamer3D/Data/Vector.hs index 8745ff8..99b3003 100644 --- a/Data/HGamer3D/Data/Vector.hs +++ b/Data/HGamer3D/Data/Vector.hs @@ -1,36 +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 #-} - --- book: math3d vector lib --- |Includes the right pieces of the Vect libray of Balazs Komuves. --- see: -module HGamer3D.Data.Vector -( - module Data.Vect.Float, - module Data.Vect.Float.Util.Quaternion -) - -where - -import Data.Vect.Float -import Data.Vect.Float.Util.Quaternion --- book: end +{-# 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/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/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/BaseAPI/Audio.hs similarity index 88% rename from Examples/Audio/Audio.hs rename to Examples/BaseAPI/Audio.hs index 47925d0..514039f 100644 --- a/Examples/Audio/Audio.hs +++ b/Examples/BaseAPI/Audio.hs @@ -22,12 +22,12 @@ module Main where -import HGamer3D.Audio +import HGamer3D.Audio.BaseAPI 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/Graphics3D/BlueCube.hs b/Examples/BaseAPI/BlueCube.hs similarity index 51% rename from Examples/Graphics3D/BlueCube.hs rename to Examples/BaseAPI/BlueCube.hs index d39fee2..7057b3b 100644 --- a/Examples/Graphics3D/BlueCube.hs +++ b/Examples/BaseAPI/BlueCube.hs @@ -16,41 +16,40 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -import HGamer3D.Graphics3D +import HGamer3D.Data +import HGamer3D.Engine.BaseAPI +import HGamer3D.Graphics3D.BaseAPI +import HGamer3D.Graphics3D.Schema.Camera -white :: Colour -white = (Colour 1.0 1.0 1.0 1.0) - -renderLoop cube g3ds = do +renderLoop cubeF g3ds guis last = do -- rotate - yaw3D cube (Rad 0.005) - roll3D 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 - BlueCube Example" "DefaultSceneManager" 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 - positionTo3D camera pos + 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 - 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) + -- create a shiny blue cube + cubeFigure <- cube g3ds 0.2 (ResourceMaterial "Colours/Blue") + positionTo cubeFigure (Vec3 0.0 0.0 0.0) -- start render loop - renderLoop cube g3ds - exitHGamer3D g3ds + renderLoop cubeFigure g3ds guis last + freeHGamer3D g3ds guis return () diff --git a/Examples/BaseAPI/BumpMappingCube.hs b/Examples/BaseAPI/BumpMappingCube.hs new file mode 100644 index 0000000..cdacb0a --- /dev/null +++ b/Examples/BaseAPI/BumpMappingCube.hs @@ -0,0 +1,61 @@ +-- 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. + +import HGamer3D.Data +import HGamer3D.Engine.BaseAPI +import HGamer3D.Graphics3D.BaseAPI +import HGamer3D.Graphics3D.Schema.Camera +import HGamer3D.Graphics3D.Schema.Figure +import HGamer3D.Graphics3D.Schema.Geometry + + +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, last', quit) <- stepHGamer3D g3ds guis last + if quit then return () else renderLoop cubeF g3ds guis last' + +main :: IO () +main = do + + (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) + cameraLookAt camera at + + -- define light + + setAmbientLight g3ds (Colour 1.0 1.0 1.0 1.0) + 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 guis last + freeHGamer3D g3ds guis + return () + diff --git a/Examples/BaseAPI/GUI-Widgets.hs b/Examples/BaseAPI/GUI-Widgets.hs new file mode 100644 index 0000000..01c4a31 --- /dev/null +++ b/Examples/BaseAPI/GUI-Widgets.hs @@ -0,0 +1,193 @@ +-- 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-Widgets.hs + +module Main where + +import HGamer3D.Data +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 + +printEvent :: GUIElement a -> GUIEvent -> IO () +printEvent outbox event = do + case event of + GUIEvent tag sender window -> do + 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 last = do + (evts, last', qFlag) <- stepHGamer3D g3ds guis last + if qFlag then + return (False, last') + 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, last') + +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, last') <- checkEvents outtext g3ds guis last + if proceed then renderLoop cubeF outtext g3ds guis last' else return () + +main = do + + (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) + cameraLookAt camera at + + -- define light + + setAmbientLight g3ds white + 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.2 0.2 0.2) + + -- GUI Code starts here, display hg3d logo + loadGuiScheme guis "hg3d.scheme" + logo <- loadGuiLayoutFromFile guis "hgamer3d.layout" "" + addGuiElToDisplay guis logo + + + -- display gui elements + guiwidgets <- loadGuiLayoutFromFile guis "gui-widgets.layout" "" + sttext <- loadGuiLayoutFromFile guis "statictext.layout" "" + addGuiElToDisplay guis guiwidgets + + + -- 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 + 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 + mapM (comboboxAddText combobox) ["Choice One", "Choice Two", "Choice Three"] + setGuiElProperty combobox "ReadOnly" "True" + registerGUIEvent guis combobox "ListSelectionAccepted" "combo-done" + + -- start render loop + renderLoop cubeFigure outtext g3ds guis last + freeHGamer3D g3ds guis + return () diff --git a/Examples/InputSystem/Joystick.hs b/Examples/BaseAPI/Joystick.hs similarity index 85% rename from Examples/InputSystem/Joystick.hs rename to Examples/BaseAPI/Joystick.hs index a2189bb..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 @@ -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/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 78% rename from Examples/Network/Network-Chat.hs rename to Examples/BaseAPI/Network-Chat.hs index 9c8e864..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,18 +12,18 @@ doClientWork client = do serverLoop server clients = do - pkgs <- receiveNetworkMessages server (TimeMS 100) + pkgs <- receiveNetworkMessages server (msecT 100) mapM (print . message) pkgs 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/WinEvent/WinEvent.hs b/Examples/BaseAPI/WinEvent.hs similarity index 50% rename from Examples/WinEvent/WinEvent.hs rename to Examples/BaseAPI/WinEvent.hs index 5a6b5f1..12654e6 100644 --- a/Examples/WinEvent/WinEvent.hs +++ b/Examples/BaseAPI/WinEvent.hs @@ -1,21 +1,22 @@ 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 <- 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/Examples/EcsAPI/Coordinates.hs b/Examples/EcsAPI/Coordinates.hs new file mode 100644 index 0000000..02a5e7f --- /dev/null +++ b/Examples/EcsAPI/Coordinates.hs @@ -0,0 +1,127 @@ +-- 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 needed Ecs API files +import HGamer3D.Data +import HGamer3D.Engine.EcsAPI +import HGamer3D.Graphics3D.EcsAPI + +-- other imports +import Control.Concurrent + +-- define two cameras +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 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") + +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] + +-- rotation helper functions +alphaTime :: IO Float +alphaTime = do + t <- getTime + let t' = fromIntegral ((msec t) `mod` 5000) + 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 + + -- 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 + ] + + -- end definition of entities + + -- 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 new file mode 100644 index 0000000..d62c01d --- /dev/null +++ b/Examples/EcsAPI/GUI-Switch.hs @@ -0,0 +1,177 @@ +{-# 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 + +where + +import HGamer3D.Data +import HGamer3D.Engine.EcsAPI +import HGamer3D.Graphics3D.EcsAPI +import HGamer3D.GUI.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) + ecsEvt <- runSystemEvent (msecT 110) + let systems = ecsG3D #+ ecsEvt #+ [] + [camE, bE, guiE] <- makeEs + mapM (addToWorld systems) [camE, bE, guiE] + checkEvents guiE bE + return () + diff --git a/Examples/EcsAPI/MaterialManager.hs b/Examples/EcsAPI/MaterialManager.hs new file mode 100644 index 0000000..13c88eb --- /dev/null +++ b/Examples/EcsAPI/MaterialManager.hs @@ -0,0 +1,212 @@ +{-# 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 needed EcsAPI's +import HGamer3D.Data +import HGamer3D.Engine.EcsAPI +import HGamer3D.Graphics3D.EcsAPI +import HGamer3D.GUI.EcsAPI + +import Control.Concurrent +import Data.Maybe +import Data.List + +-- 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 + +-- build and deconstruct composite figures +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 "