source: trunk/src/tileset.h @ 664

Last change on this file since 664 was 664, checked in by sam, 9 years ago

Get rid of float3, float4, int3 etc. in favour of GLSL types.

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2011 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://sam.zoy.org/projects/COPYING.WTFPL 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 __DH_TILESET_H__
20#define __DH_TILESET_H__
21
22#include <stdint.h>
23
24#include "entity.h"
25
26class TileSetData;
27
28class TileSet : public Entity
29{
30public:
31    TileSet(char const *path, vec2i size, vec2i count, float dilate);
32    virtual ~TileSet();
33
34protected:
35    /* Inherited from Entity */
36    virtual char const *GetName();
37    virtual void TickDraw(float deltams);
38
39public:
40    /* New methods */
41    vec2i GetSize() const;
42    vec2i GetCount() const;
43    void Bind();
44    void BlitTile(uint32_t id, int x, int y, int z, int o,
45                  float *vertex, float *texture);
46
47private:
48    TileSetData *data;
49};
50
51#endif // __DH_TILESET_H__
52
Note: See TracBrowser for help on using the repository browser.