Sha256: d78936181deaf6beb8bae92844a750dea5a09aa5991906353fa10108446ac32b

Contents?: true

Size: 1.41 KB

Versions: 12

Compression:

Stored size: 1.41 KB

Contents

//! \file ImageData.hpp
//! Interface of the ImageData class.

#ifndef GOSU_IMAGEDATA_HPP
#define GOSU_IMAGEDATA_HPP

#include <Gosu/Color.hpp>
#include <Gosu/GraphicsBase.hpp>
#include <boost/optional.hpp>
#include <boost/utility.hpp>

namespace Gosu
{
    //! Contains information about the underlying OpenGL texture and the
    //! u/v space used for image data. Can be retrieved from some images
    //! to use them in OpenGL operations.
    struct GLTexInfo
    {
        int texName;
        float left, right, top, bottom;
    };

    //! The ImageData class is an abstract base class for drawable images.
    //! Instances of classes derived by ImageData are usually returned by
    //! Graphics::createImage and usually only used to implement drawing
    //! primitives like Image, which then provide a more specialized and
    //! intuitive drawing interface.
    class ImageData : boost::noncopyable
    {
    public:
        virtual ~ImageData()
        {
        }

        virtual unsigned width() const = 0;
        virtual unsigned height() const = 0;

        virtual void draw(double x1, double y1, Color c1,
            double x2, double y2, Color c2,
            double x3, double y3, Color c3,
            double x4, double y4, Color c4,
            ZPos z, AlphaMode mode) const = 0;
            
        virtual boost::optional<GLTexInfo> glTexInfo() const = 0;
        virtual Bitmap toBitmap() const = 0;
    };
}

#endif

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gosu-0.7.27.1 Gosu/ImageData.hpp
gosu-0.7.27.1-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.27.1-universal-darwin Gosu/ImageData.hpp
gosu-0.7.27 Gosu/ImageData.hpp
gosu-0.7.27-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.27-universal-darwin Gosu/ImageData.hpp
gosu-0.7.26.1 Gosu/ImageData.hpp
gosu-0.7.26.1-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.26.1-universal-darwin Gosu/ImageData.hpp
gosu-0.7.26 Gosu/ImageData.hpp
gosu-0.7.26-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.26-universal-darwin Gosu/ImageData.hpp