source: trunk/src/tileset.h @ 2183

Last change on this file since 2183 was 2183, checked in by sam, 7 years ago

build: fix the WTFPL site URL in all code comments.

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2012 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    void Bind();
47    void Unbind();
48    void BlitTile(uint32_t id, vec3 pos, int o, vec2 scale,
49                  float *vertex, float *texture);
50
51private:
52    TileSetData *data;
53};
54
55} /* namespace lol */
56
57#endif // __LOL_TILESET_H__
58
Note: See TracBrowser for help on using the repository browser.