Sha256: 7cb313480d67574654ad1cf1c38d1f6b4352cb92cc1d7440ab0c8a4ec4b1f557

Contents?: true

Size: 851 Bytes

Versions: 30

Compression:

Stored size: 851 Bytes

Contents

#ifndef GOSUIMPL_BLOCKALLOCATOR_HPP
#define GOSUIMPL_BLOCKALLOCATOR_HPP

#include <boost/optional.hpp>
#include <boost/scoped_ptr.hpp>

namespace Gosu
{
    class BlockAllocator
    {
        struct Impl;
        boost::scoped_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;

        boost::optional<Block> alloc(unsigned width, unsigned height);
        void free(unsigned left, unsigned top);
    };
}

#endif

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
gosu-0.7.15 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.14 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.10.1 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.10.2 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.10.3 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.11 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.12 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.13.2 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.13.3 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.13 GosuImpl/Graphics/BlockAllocator.hpp