Sha256: 691b80fab350ae3fec177c72e70192fc963b830f35f43ebbc9af84aff31a59ef

Contents?: true

Size: 838 Bytes

Versions: 31

Compression:

Stored size: 838 Bytes

Contents

#pragma once

#include <Gosu/Platform.hpp>
#include <memory>

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

    public:
        struct Block
        {
            unsigned left, top, width, height;
            Block() {}
            Block(unsigned left, unsigned top, unsigned width, unsigned height)
            : left(left), top(top), width(width), height(height) {}
        };

        BlockAllocator(unsigned width, unsigned height);
        ~BlockAllocator();

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

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

Version data entries

31 entries across 31 versions & 1 rubygems

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