Sha256: ab907a56a2a86d61b09b334ee3e4db4213209a3f0556e8f5a32821c7810b6c6d

Contents?: true

Size: 1.35 KB

Versions: 21

Compression:

Stored size: 1.35 KB

Contents

#ifndef GOSUIMPL_GRAPHICS_TEXCHUNK_HPP
#define GOSUIMPL_GRAPHICS_TEXCHUNK_HPP

#include <Gosu/Fwd.hpp>
#include <Gosu/ImageData.hpp>
#include <Gosu/TR1.hpp>
#include "Common.hpp"
#include <memory>
#include <vector>
#include <stdexcept>

class Gosu::TexChunk : public Gosu::ImageData
{
    Graphics& graphics;
    DrawOpQueueStack& queues;
    std::tr1::shared_ptr<Texture> texture;
    int x, y, w, h, padding;
    
    // Cached for faster access.
    GLTexInfo info;
    
    void setTexInfo();
    
public:
    TexChunk(Graphics& graphics, DrawOpQueueStack& queues,
             std::tr1::shared_ptr<Texture> texture, int x, int y, int w, int h, int padding);
    TexChunk(const TexChunk& parentChunk, int x, int y, int w, int h);
    ~TexChunk();

    int width() const
    {
        return w;
    }
    
    int height() const
    {
        return h;
    }
    
    GLuint texName() const
    {
        return info.texName;
    }
    
    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;
        
    const GLTexInfo* glTexInfo() const;
    Gosu::Bitmap toBitmap() const;
    GOSU_UNIQUE_PTR<ImageData> subimage(int x, int y, int width, int height) const;
    void insert(const Bitmap& bitmap, int x, int y);
};

#endif

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
gosu-0.8.7.2 src/Graphics/TexChunk.hpp
gosu-0.8.7.1 src/Graphics/TexChunk.hpp
gosu-0.8.7 src/Graphics/TexChunk.hpp
gosu-0.8.6 src/Graphics/TexChunk.hpp
gosu-0.8.6.pre1 src/Graphics/TexChunk.hpp
gosu-0.8.5 src/Graphics/TexChunk.hpp
gosu-0.8.5.pre1 src/Graphics/TexChunk.hpp
gosu-0.8.4 src/Graphics/TexChunk.hpp
gosu-0.8.3 src/Graphics/TexChunk.hpp
gosu-0.8.2 src/Graphics/TexChunk.hpp
gosu-0.8.1 src/Graphics/TexChunk.hpp
gosu-0.8.0 src/Graphics/TexChunk.hpp
gosu-0.8.0.pre7 src/Graphics/TexChunk.hpp
gosu-0.8.0.pre6 src/Graphics/TexChunk.hpp
gosu-0.8.0.pre5 src/Graphics/TexChunk.hpp
gosu-0.8.0.pre4 src/Graphics/TexChunk.hpp
gosu-0.8.0.pre3 GosuImpl/Graphics/TexChunk.hpp
gosu-0.8.0.pre2 GosuImpl/Graphics/TexChunk.hpp
gosu-0.8.0.pre1 GosuImpl/Graphics/TexChunk.hpp
gosu-0.7.50 GosuImpl/Graphics/TexChunk.hpp