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.33 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.32 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.31 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.30 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.29 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.28 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.27.1 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.27 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.26.1 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.26 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.25 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.24 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.23 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.22 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.21 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.20 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.19 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.18 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.17 GosuImpl/Graphics/BlockAllocator.hpp
gosu-0.7.16 GosuImpl/Graphics/BlockAllocator.hpp