Sha256: 4631c7af18b05666d948b67b79639733e2a8ffed44100f010cbf688cb1bedc67

Contents?: true

Size: 1.61 KB

Versions: 15

Compression:

Stored size: 1.61 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>

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
    {
        // Non-copyable
        ImageData(const ImageData&);
        ImageData& operator=(const ImageData&);
        
    public:
        ImageData()
        {
        }
        
        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 const GLTexInfo* glTexInfo() const = 0;
        virtual Bitmap toBitmap() const = 0;
        
        //! Experimental and undocumented for now.
        virtual void insert(const Bitmap& bitmap, int x, int y) = 0;
    };
}

#endif

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gosu-0.7.38 Gosu/ImageData.hpp
gosu-0.7.38-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.38-universal-darwin Gosu/ImageData.hpp
gosu-0.7.37 Gosu/ImageData.hpp
gosu-0.7.37-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.37-universal-darwin Gosu/ImageData.hpp
gosu-0.7.36.2 Gosu/ImageData.hpp
gosu-0.7.36.2-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.36.2-universal-darwin Gosu/ImageData.hpp
gosu-0.7.36.1-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.36.1-universal-darwin Gosu/ImageData.hpp
gosu-0.7.36-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.35 Gosu/ImageData.hpp
gosu-0.7.35-i386-mingw32 Gosu/ImageData.hpp
gosu-0.7.35-universal-darwin Gosu/ImageData.hpp