Sha256: 8fc066d9b014b8002f14796192cf71be786589316eb23465561ad91494f17776

Contents?: true

Size: 903 Bytes

Versions: 27

Compression:

Stored size: 903 Bytes

Contents

#pragma once

#include "BlockAllocator.hpp"
#include "GraphicsImpl.hpp"
#include "TexChunk.hpp"
#include <Gosu/Fwd.hpp>
#include <Gosu/Bitmap.hpp>
#include <memory>
#include <vector>

class Gosu::Texture : public std::enable_shared_from_this<Texture>
{
    // BlockAllocator can't be copied or moved, so neither can Texture.
    BlockAllocator allocator_;
    GLuint tex_name_;
    bool retro_;
    
public:
    Texture(unsigned width, unsigned height, bool retro);
    ~Texture();
    unsigned width() const;
    unsigned height() const;
    GLuint tex_name() const;
    bool retro() const;
    std::unique_ptr<TexChunk> try_alloc(const Bitmap& bmp, unsigned padding);
    void block(unsigned x, unsigned y, unsigned width, unsigned height);
    void free(unsigned x, unsigned y, unsigned width, unsigned height);
    Bitmap to_bitmap(unsigned x, unsigned y, unsigned width, unsigned height) const;
};

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
gosu-1.4.6 src/Texture.hpp
gosu-1.4.5 src/Texture.hpp
gosu-1.4.5.pre1 src/Texture.hpp
gosu-1.4.4 src/Texture.hpp
gosu-1.4.3 src/Texture.hpp
gosu-1.4.1 src/Texture.hpp
gosu-1.4.0 src/Texture.hpp
gosu-1.3.0 src/Texture.hpp
gosu-1.2.0 src/Texture.hpp
gosu-1.1.1.1 src/Texture.hpp
gosu-1.1.0 src/Texture.hpp
gosu-1.1.0.pre2 src/Texture.hpp
gosu-1.1.0.pre1 src/Texture.hpp
gosu-1.0.0 src/Texture.hpp
gosu-1.0.0.pre2 src/Texture.hpp
gosu-1.0.0.pre1 src/Texture.hpp
gosu-0.15.2 src/Texture.hpp
gosu-0.15.1 src/Texture.hpp
gosu-0.15.0 src/Texture.hpp
gosu-0.14.6.pre1 src/Texture.hpp