4
* An object oriented GL/GLES Abstraction/Utility Layer
6
* Copyright (C) 2009 Intel Corporation.
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
24
#ifndef __COGL_SUB_TEXTURE_H
25
#define __COGL_SUB_TEXTURE_H
27
#include "cogl-handle.h"
28
#include "cogl-texture-private.h"
30
#define COGL_SUB_TEXTURE(tex) ((CoglSubTexture *) tex)
32
typedef struct _CoglSubTexture CoglSubTexture;
34
struct _CoglSubTexture
38
/* This is the texture that was passed in to
39
_cogl_sub_texture_new. If this is also a sub texture then we will
40
use the full texture from that to render instead of making a
41
chain. However we want to preserve the next texture in case the
42
user is expecting us to keep a reference and also so that we can
43
later add a cogl_sub_texture_get_full_texture() function. */
44
CoglHandle next_texture;
45
/* This is the texture that will actually be used to draw. It will
46
point to the end of the chain if a sub texture of a sub texture
48
CoglHandle full_texture;
50
/* The region represented by this sub-texture. This is the region of
51
full_texture which won't necessarily be the same as the region
52
passed to _cogl_sub_texture_new if next_texture is actually
53
already a sub texture */
61
_cogl_handle_sub_texture_get_type (void);
64
_cogl_sub_texture_new (CoglHandle next_texture,
70
#endif /* __COGL_SUB_TEXTURE_H */