source: trunk/src/lol/gpu/texture.h @ 2354

Last change on this file since 2354 was 2354, checked in by sam, 8 years ago

base: move headers around and promote gpu/ to lol/gpu/.

  • Property svn:keywords set to Id
File size: 1.1 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 Texture class
13// -----------------
14//
15
16#if !defined __LOL_GPU_TEXTURE_H__
17#define __LOL_GPU_TEXTURE_H__
18
19namespace lol
20{
21
22struct PixelFormat
23{
24    /* XXX: make sure to update texture.cpp when this changes */
25    enum Value
26    {
27        Unknown = 0,
28        RGB_8,
29        ARGB_8,
30        ABGR_8,
31        Y_8,
32    }
33    m_value;
34
35    inline PixelFormat() : m_value(Unknown) {}
36    inline PixelFormat(Value v) : m_value(v) {}
37    inline operator Value() { return m_value; }
38};
39
40class Texture
41{
42public:
43    Texture(ivec2 size, PixelFormat format);
44    ~Texture();
45
46    void Bind();
47    void SetData(void *data);
48    void SetSubData(ivec2 origin, ivec2 size, void *data);
49
50    ShaderTexture GetTexture() const;
51
52private:
53    class TextureData *m_data;
54};
55
56} /* namespace lol */
57
58#endif // __LOL_GPU_TEXTURE_H__
59
Note: See TracBrowser for help on using the repository browser.