source: trunk/src/tileset.h @ 2444

Last change on this file since 2444 was 2439, checked in by touky, 7 years ago

EasyMesh : vdecl/vbo flag test fixup.
Tileset : added GetTileSize().

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://www.wtfpl.net/ for more details.
9//
10
11//
12// The TileSet class
13// -----------------
14// A TileSet is a collection of tiles stored in a texture. Texture uploading
15// and freeing is done in the render tick method. When the refcount drops to
16// zero, the texture is freed.
17//
18
19#if !defined __LOL_TILESET_H__
20#define __LOL_TILESET_H__
21
22#include <stdint.h>
23
24#include "entity.h"
25
26namespace lol
27{
28
29class TileSetData;
30
31class TileSet : public Entity
32{
33public:
34    TileSet(char const *path, ivec2 size, ivec2 count);
35    virtual ~TileSet();
36
37protected:
38    /* Inherited from Entity */
39    virtual char const *GetName();
40    virtual void TickDraw(float seconds);
41
42public:
43    /* New methods */
44    ivec2 GetCount() const;
45    ivec2 GetSize(int tileid) const;
46    vec2 GetTileSize() const;
47    ShaderTexture GetTexture() const;
48    void Bind();
49    void Unbind();
50    void BlitTile(uint32_t id, vec3 pos, int o, vec2 scale,
51                  float *vertex, float *texture);
52
53private:
54    TileSetData *data;
55};
56
57} /* namespace lol */
58
59#endif // __LOL_TILESET_H__
60
Note: See TracBrowser for help on using the repository browser.