Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 29, 2009, 7:12:27 PM (15 years ago)
Author:
rgrieder
Message:
  • Added unified diff file with our changes for OgreCEGUIRenderer
  • Minimised our changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/src/ogreceguirenderer/OgreCEGUITexture.h

    r2569 r2602  
    11/************************************************************************
    2     filename:   OgreCEGUITexture.h
    3     created:    11/5/2004
    4     author:             Paul D Turner
    5    
    6     purpose:    Interface to Texture implemented via Ogre engine
     2        filename:       OgreCEGUITexture.h
     3        created:        11/5/2004
     4        author:         Paul D Turner
     5       
     6        purpose:        Interface to Texture implemented via Ogre engine
    77*************************************************************************/
    88/*************************************************************************
     
    3737/*!
    3838\brief
    39     Texture class that is created by OgreCEGUIRenderer objects
     39        Texture class that is created by OgreCEGUIRenderer objects
    4040*/
    4141class _OgrePrivate OgreCEGUITexture : public Texture
    4242{
    4343private:
    44     /*************************************************************************
    45         Friends (to allow construction and destruction)
    46     *************************************************************************/
    47     friend      Texture* OgreCEGUIRenderer::createTexture(void);
    48     friend      Texture* OgreCEGUIRenderer::createTexture(const String& filename, const String& resourceGroup);
    49     friend      Texture* OgreCEGUIRenderer::createTexture(float size);
    50     friend      void     OgreCEGUIRenderer::destroyTexture(Texture* texture);
     44        /*************************************************************************
     45                Friends (to allow construction and destruction)
     46        *************************************************************************/
     47        friend  Texture* OgreCEGUIRenderer::createTexture(void);
     48        friend  Texture* OgreCEGUIRenderer::createTexture(const String& filename, const String& resourceGroup);
     49        friend  Texture* OgreCEGUIRenderer::createTexture(float size);
     50        friend  void     OgreCEGUIRenderer::destroyTexture(Texture* texture);
    5151
    5252
    53     /*************************************************************************
    54         Construction & Destruction (by Renderer object only)
    55     *************************************************************************/
    56     OgreCEGUITexture(Renderer* owner);
    57     virtual ~OgreCEGUITexture(void);
     53        /*************************************************************************
     54                Construction & Destruction (by Renderer object only)
     55        *************************************************************************/
     56        OgreCEGUITexture(Renderer* owner);
     57        virtual ~OgreCEGUITexture(void);
    5858
    5959public:
    60     /*!
    61     \brief
    62         Returns the current pixel width of the texture
     60        /*!
     61        \brief
     62                Returns the current pixel width of the texture
    6363
    64     \return
    65         ushort value that is the current width of the texture in pixels
    66     */
    67     virtual     ushort  getWidth(void) const            {return d_width;}
     64        \return
     65                ushort value that is the current width of the texture in pixels
     66        */
     67        virtual ushort  getWidth(void) const            {return d_width;}
    6868
    6969
    70     /*!
    71     \brief
    72         Returns the current pixel height of the texture
     70        /*!
     71        \brief
     72                Returns the current pixel height of the texture
    7373
    74     \return
    75         ushort value that is the current height of the texture in pixels
    76     */
    77     virtual     ushort  getHeight(void) const           {return d_height;}
     74        \return
     75                ushort value that is the current height of the texture in pixels
     76        */
     77        virtual ushort  getHeight(void) const           {return d_height;}
    7878
    7979
    80     /*!
    81     \brief
    82         Loads the specified image file into the texture.  The texture is resized as required to hold the image.
     80        /*!
     81        \brief
     82                Loads the specified image file into the texture.  The texture is resized as required to hold the image.
    8383
    84     \param filename
    85         The filename of the image file that is to be loaded into the texture
     84        \param filename
     85                The filename of the image file that is to be loaded into the texture
    8686
    87     \return
    88         Nothing.
    89     */
    90     virtual void        loadFromFile(const String& filename, const String& resourceGroup);
     87        \return
     88                Nothing.
     89        */
     90        virtual void    loadFromFile(const String& filename, const String& resourceGroup);
    9191
    9292
    93     /*!
    94     \brief
    95         Loads (copies) an image in memory into the texture.  The texture is resized as required to hold the image.
    96    
    97     \param buffPtr
    98         Pointer to the buffer containing the image data
    99    
    100     \param buffWidth
    101         Width of the buffer (in pixels as specified by \a pixelFormat )
    102    
    103     \param buffHeight
    104         Height of the buffer (in pixels as specified by \a pixelFormat )
    105    
    106     \param pixelFormat
    107     PixelFormat value describing the format contained in \a buffPtr
    108    
    109     \return
    110         Nothing.
    111     */
    112     virtual void        loadFromMemory(const void* buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat);
     93        /*!
     94        \brief
     95                Loads (copies) an image in memory into the texture.  The texture is resized as required to hold the image.
     96       
     97        \param buffPtr
     98                Pointer to the buffer containing the image data
     99       
     100        \param buffWidth
     101                Width of the buffer (in pixels as specified by \a pixelFormat )
     102       
     103        \param buffHeight
     104                Height of the buffer (in pixels as specified by \a pixelFormat )
     105       
     106        \param pixelFormat
     107        PixelFormat value describing the format contained in \a buffPtr
     108       
     109        \return
     110                Nothing.
     111        */
     112        virtual void    loadFromMemory(const void* buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat);
    113113
    114114
    115     /*!
    116     \brief
    117         Return a pointer to the internal Ogre::Texture object
     115        /*!
     116        \brief
     117                Return a pointer to the internal Ogre::Texture object
    118118
    119     \return
    120         Pointer to the Ogre::Texture object currently being used by this Texture object
    121     */
    122     Ogre::TexturePtr    getOgreTexture(void) const              {return d_ogre_texture;}
     119        \return
     120                Pointer to the Ogre::Texture object currently being used by this Texture object
     121        */
     122        Ogre::TexturePtr        getOgreTexture(void) const              {return d_ogre_texture;}
    123123
    124124
    125     /*!
    126     \brief
    127         set the size of the internal Ogre texture.  Previous Ogre texture is lost.
     125        /*!
     126        \brief
     127                set the size of the internal Ogre texture.  Previous Ogre texture is lost.
    128128
    129     \param size
    130         pixel size of the new internal texture.  This will be rounded up to a power of 2.
     129        \param size
     130                pixel size of the new internal texture.  This will be rounded up to a power of 2.
    131131
    132     \return
    133         Nothing.
    134     */
    135     void        setOgreTextureSize(uint size);
     132        \return
     133                Nothing.
     134        */
     135        void    setOgreTextureSize(uint size);
    136136
    137137
    138     /*!
    139     \brief
    140         Set the internal Ogre::TexturePtr object.
     138        /*!
     139        \brief
     140                Set the internal Ogre::TexturePtr object.
    141141
    142     \param texture
    143         Reference to an Ogre::TexturePtr object that is to be used by this Texture object.
     142        \param texture
     143                Reference to an Ogre::TexturePtr object that is to be used by this Texture object.
    144144
    145     \return
    146         Nothing.
    147     */
    148     void        setOgreTexture(Ogre::TexturePtr& texture);
     145        \return
     146                Nothing.
     147        */
     148        void    setOgreTexture(Ogre::TexturePtr& texture);
    149149
    150150
    151151private:
    152     /*************************************************************************
    153         Implementation Functions
    154     *************************************************************************/
    155     // safely free Ogre::Texture texture (can be called multiple times with no ill effect)
    156     void        freeOgreTexture(void);
     152        /*************************************************************************
     153                Implementation Functions
     154        *************************************************************************/
     155        // safely free Ogre::Texture texture (can be called multiple times with no ill effect)
     156        void    freeOgreTexture(void);
    157157
    158     // return a Ogre::string that contains a unique name.
    159     Ogre::String        getUniqueName(void);
     158        // return a Ogre::string that contains a unique name.
     159        Ogre::String    getUniqueName(void);
    160160
    161161
    162     /*************************************************************************
    163         Implementation Data
    164     *************************************************************************/
    165     static      uint32          d_texturenumber;        //!< Counter used to provide unique texture names.
     162        /*************************************************************************
     163                Implementation Data
     164        *************************************************************************/
     165        static  uint32          d_texturenumber;        //!< Counter used to provide unique texture names.
    166166
    167     Ogre::TexturePtr            d_ogre_texture;         //!< The 'real' texture.
     167        Ogre::TexturePtr                d_ogre_texture;         //!< The 'real' texture.
    168168
    169     ushort                                      d_width;                        //!< cached width of the texture
    170     ushort                                      d_height;                       //!< cached height of the texture
     169        ushort                                  d_width;                        //!< cached width of the texture
     170        ushort                                  d_height;                       //!< cached height of the texture
    171171
    172     bool        d_isLinked;             //!< True if we are linked to a texture we did not actually create.
     172        bool    d_isLinked;             //!< True if we are linked to a texture we did not actually create.
    173173};
    174174
Note: See TracChangeset for help on using the changeset viewer.