Sha256: 69bebe3c46811791b27f20fdd611c0dfee63eb3d68767766a15fdba74c439ae6

Contents?: true

Size: 804 Bytes

Versions: 12

Compression:

Stored size: 804 Bytes

Contents

#ifndef GOSUIMPL_BLOCKALLOCATOR_HPP
#define GOSUIMPL_BLOCKALLOCATOR_HPP

#include <memory>

namespace Gosu
{
    class BlockAllocator
    {
        struct Impl;
        const std::auto_ptr<Impl> pimpl;

    public:
        struct Block
        {
            unsigned left, top, width, height;
            Block() {}
            Block(unsigned aLeft, unsigned aTop, unsigned aWidth, unsigned aHeight)
            : left(aLeft), top(aTop), width(aWidth), height(aHeight) {}
        };
    
        BlockAllocator(unsigned width, unsigned height);
        ~BlockAllocator();

        unsigned width() const;
        unsigned height() const;

        bool alloc(unsigned width, unsigned height, Block& block);
        void free(unsigned left, unsigned top);
    };
}

#endif

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gosu-0.7.47.1 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.46 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.45 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.44 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.43 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.41 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.40 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.39 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.38 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.37 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.36.2 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.35 GosuImpl/Graphics/BlockAllocator.hpp