Sha256: e2a0436aac63d12ce7a0a3a6ce8a5013a9a3e7d6445f78320da6f8f9c3200930

Contents?: true

Size: 952 Bytes

Versions: 15

Compression:

Stored size: 952 Bytes

Contents

#ifndef GOSU_SRC_BLOCKALLOCATOR_HPP
#define GOSU_SRC_BLOCKALLOCATOR_HPP

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

namespace Gosu
{
    class BlockAllocator
    {
        struct Impl;
        const GOSU_UNIQUE_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 block(unsigned left, unsigned top, unsigned width, unsigned height);
        void free(unsigned left, unsigned top, unsigned width, unsigned height);
    };
}

#endif

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gosu-0.10.9.pre1 src/Graphics/BlockAllocator.hpp
gosu-0.10.8 src/Graphics/BlockAllocator.hpp
gosu-0.10.7 src/Graphics/BlockAllocator.hpp
gosu-0.10.6 src/Graphics/BlockAllocator.hpp
gosu-0.10.5 src/Graphics/BlockAllocator.hpp
gosu-0.10.5.pre0 src/Graphics/BlockAllocator.hpp
gosu-0.10.5.pre1 src/Graphics/BlockAllocator.hpp
gosu-0.10.4 src/Graphics/BlockAllocator.hpp
gosu-0.10.3 src/Graphics/BlockAllocator.hpp
gosu-0.10.2 src/Graphics/BlockAllocator.hpp
gosu-0.10.2.pre1 src/Graphics/BlockAllocator.hpp
gosu-0.10.1.2 src/Graphics/BlockAllocator.hpp
gosu-0.10.1.1 src/Graphics/BlockAllocator.hpp
gosu-0.10.1 src/Graphics/BlockAllocator.hpp
gosu-0.10.0 src/Graphics/BlockAllocator.hpp