Sha256: f37384f839bd0d43c7c28949044713149bac43d102f11d7813bb19a50fcdb86d

Contents?: true

Size: 952 Bytes

Versions: 26

Compression:

Stored size: 952 Bytes

Contents

#ifndef GOSUIMPL_BLOCKALLOCATOR_HPP
#define GOSUIMPL_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

26 entries across 26 versions & 1 rubygems

Version Path
gosu-0.9.2 src/Graphics/BlockAllocator.hpp
gosu-0.9.2.pre1 src/Graphics/BlockAllocator.hpp
gosu-0.9.1 src/Graphics/BlockAllocator.hpp
gosu-0.9.0 src/Graphics/BlockAllocator.hpp
gosu-0.9.0.pre1 src/Graphics/BlockAllocator.hpp
gosu-0.8.7.2 src/Graphics/BlockAllocator.hpp
gosu-0.8.7.1 src/Graphics/BlockAllocator.hpp
gosu-0.8.7 src/Graphics/BlockAllocator.hpp
gosu-0.8.6 src/Graphics/BlockAllocator.hpp
gosu-0.8.6.pre1 src/Graphics/BlockAllocator.hpp
gosu-0.8.5 src/Graphics/BlockAllocator.hpp
gosu-0.8.5.pre1 src/Graphics/BlockAllocator.hpp
gosu-0.8.4 src/Graphics/BlockAllocator.hpp
gosu-0.8.3 src/Graphics/BlockAllocator.hpp
gosu-0.8.2 src/Graphics/BlockAllocator.hpp
gosu-0.8.1 src/Graphics/BlockAllocator.hpp
gosu-0.8.0 src/Graphics/BlockAllocator.hpp
gosu-0.8.0.pre7 src/Graphics/BlockAllocator.hpp
gosu-0.8.0.pre6 src/Graphics/BlockAllocator.hpp
gosu-0.8.0.pre5 src/Graphics/BlockAllocator.hpp