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-0.14.5 src/Texture.hpp
gosu-0.14.4 src/Texture.hpp
gosu-0.14.4.pre2 src/Texture.hpp
gosu-0.14.3.pre1 src/Texture.hpp
gosu-0.14.3 src/Texture.hpp
gosu-0.14.0 src/Texture.hpp
gosu-0.14.0.pre2 src/Texture.hpp