-- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell) -- Edit the ORIGNAL .chs file instead! {-# LINE 1 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-}{-# 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.althainz.de/HGamer3D.html -- -- (c) 2011, 2012 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. -- -- ClassRenderable.chs -- module HGamer3D.Bindings.Ogre.ClassRenderable 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.Ogre.Utils {-# LINE 40 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} import HGamer3D.Bindings.Ogre.ClassPtr {-# LINE 41 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} import HGamer3D.Bindings.Ogre.StructHG3DClass {-# LINE 42 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} import HGamer3D.Bindings.Ogre.StructSharedPtr {-# LINE 43 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Virtual destructor needed as class has virtual methods. delete :: HG3DClass -- ^ classpointer - pointer of Class instance which is going to be deleted. -> IO () -- ^ delete a1 = withHG3DClass a1 $ \a1' -> delete'_ a1' >>= \res -> return () {-# LINE 48 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Retrieves a weak reference to the material this renderable object uses. Note that the Renderable getMaterial :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (SharedPtr) -- ^ getMaterial a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getMaterial'_ a1' a2' >>= \res -> peekSharedPtr a2'>>= \a2'' -> return (a2'') {-# LINE 53 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Called just prior to the RenderableOGRE is a queued renderer, so the actual render commands are executed at a later time than the point at which an object is discovered to be visible. This allows ordering & grouping of renders without the discovery process having to be aware of it. It also means OGRE uses declarative render information rather than immediate mode rendering - this is very useful in that certain effects and processes can automatically be applied to a wide range of scenes, but the downside is that special cases are more difficult to handle, because there is not the declared state to cope with it. This method allows a RenderableRenderableRenderable preRender :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> HG3DClass -- ^ sm -> HG3DClass -- ^ rsys -> IO (Bool) -- ^ return value - true if the automatic render should proceed, false to skip it on the assumption that the preRender a1 a2 a3 = withHG3DClass a1 $ \a1' -> withHG3DClass a2 $ \a2' -> withHG3DClass a3 $ \a3' -> alloca $ \a4' -> preRender'_ a1' a2' a3' a4' >>= \res -> peekBoolUtil a4'>>= \a4'' -> return (a4'') {-# LINE 60 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Called immediately after the Renderable postRender :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> HG3DClass -- ^ sm -> HG3DClass -- ^ rsys -> IO () -- ^ postRender a1 a2 a3 = withHG3DClass a1 $ \a1' -> withHG3DClass a2 $ \a2' -> withHG3DClass a3 $ \a3' -> postRender'_ a1' a2' a3' >>= \res -> return () {-# LINE 66 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Returns the number of world transform matrices this renderable requires. When a renderable uses vertex blending, it uses multiple world matrices instead of a single one. Each vertex sent to the pipeline can reference one or more matrices in this list with given weights. If a renderable does not use vertex blending this method returns 1, which is the default for simplicity. getNumWorldTransforms :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Int) -- ^ getNumWorldTransforms a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getNumWorldTransforms'_ a1' a2' >>= \res -> peekIntConv a2'>>= \a2'' -> return (a2'') {-# LINE 71 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Sets whether or not to use an 'identity' projection. Usually RenderableRenderable::getUseIdentityProjection setUseIdentityProjection :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Bool -- ^ useIdentityProjection -> IO () -- ^ setUseIdentityProjection a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromBool a2} in setUseIdentityProjection'_ a1' a2' >>= \res -> return () {-# LINE 76 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Returns whether or not to use an 'identity' projection. Usually RenderableRenderable::setUseIdentityProjection getUseIdentityProjection :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ getUseIdentityProjection a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getUseIdentityProjection'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 81 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Sets whether or not to use an 'identity' view. Usually RenderableRenderable::getUseIdentityView setUseIdentityView :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Bool -- ^ useIdentityView -> IO () -- ^ setUseIdentityView a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromBool a2} in setUseIdentityView'_ a1' a2' >>= \res -> return () {-# LINE 86 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Returns whether or not to use an 'identity' view. Usually RenderableRenderable::setUseIdentityView getUseIdentityView :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ getUseIdentityView a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getUseIdentityView'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 91 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Returns the camera-relative squared depth of this renderable. Used to sort transparent objects. Squared depth is used rather than actual depth to avoid having to perform a square root on the result. getSquaredViewDepth :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> HG3DClass -- ^ cam -> IO (Float) -- ^ getSquaredViewDepth a1 a2 = withHG3DClass a1 $ \a1' -> withHG3DClass a2 $ \a2' -> alloca $ \a3' -> getSquaredViewDepth'_ a1' a2' a3' >>= \res -> peekFloatConv a3'>>= \a3'' -> return (a3'') {-# LINE 97 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Method which reports whether this renderable would normally cast a shadow. Subclasses should override this if they could have been used to generate a shadow. getCastsShadows :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ getCastsShadows a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getCastsShadows'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 102 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Sets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setting. setPolygonModeOverrideable :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Bool -- ^ override - true means that a lower camera detail will override this renderables detail level, false means it won't. -> IO () -- ^ setPolygonModeOverrideable a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromBool a2} in setPolygonModeOverrideable'_ a1' a2' >>= \res -> return () {-# LINE 107 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} -- | Gets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setting. getPolygonModeOverrideable :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ getPolygonModeOverrideable a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getPolygonModeOverrideable'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 112 ".\\HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs" #-} foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_destruct" delete'_ :: ((HG3DClassPtr) -> (IO ())) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_getMaterial" getMaterial'_ :: ((HG3DClassPtr) -> ((SharedPtrPtr) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_preRender" preRender'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_postRender" postRender'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> ((HG3DClassPtr) -> (IO ())))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_getNumWorldTransforms" getNumWorldTransforms'_ :: ((HG3DClassPtr) -> ((Ptr CUShort) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_setUseIdentityProjection" setUseIdentityProjection'_ :: ((HG3DClassPtr) -> (CInt -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_getUseIdentityProjection" getUseIdentityProjection'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_setUseIdentityView" setUseIdentityView'_ :: ((HG3DClassPtr) -> (CInt -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_getUseIdentityView" getUseIdentityView'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_getSquaredViewDepth" getSquaredViewDepth'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> ((Ptr CFloat) -> (IO ())))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_getCastsShadows" getCastsShadows'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_setPolygonModeOverrideable" setPolygonModeOverrideable'_ :: ((HG3DClassPtr) -> (CInt -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassRenderable.chs.h ogre_rndl_getPolygonModeOverrideable" getPolygonModeOverrideable'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ())))