4
* An object oriented GL/GLES Abstraction/Utility Layer
6
* Copyright (C) 2007,2008,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_TEXTURE_2D_SLICED_H
25
#define __COGL_TEXTURE_2D_SLICED_H
27
#include "cogl-bitmap-private.h"
28
#include "cogl-handle.h"
29
#include "cogl-material-private.h"
30
#include "cogl-texture-private.h"
32
#define COGL_TEXTURE_2D_SLICED(tex) ((CoglTexture2DSliced *)tex)
34
typedef struct _CoglTexture2DSliced CoglTexture2DSliced;
35
typedef struct _CoglTexturePixel CoglTexturePixel;
37
/* This is used to store the first pixel of each slice. This is only
38
used when glGenerateMipmap is not available */
39
struct _CoglTexturePixel
41
/* We need to store the format of the pixel because we store the
42
data in the source format which might end up being different for
43
each slice if a subregion is updated with a different format */
49
struct _CoglTexture2DSliced
52
GArray *slice_x_spans;
53
GArray *slice_y_spans;
54
GArray *slice_gl_handles;
57
/* The internal format of the GL texture represented as a
59
CoglPixelFormat format;
60
/* The internal format of the GL texture represented as a GL enum */
70
gboolean mipmaps_dirty;
72
/* This holds a copy of the first pixel in each slice. It is only
73
used to force an automatic update of the mipmaps when
74
glGenerateMipmap is not available. */
75
CoglTexturePixel *first_pixels;
79
_cogl_handle_texture_2d_sliced_get_type (void);
82
_cogl_texture_2d_sliced_new_with_size (unsigned int width,
84
CoglTextureFlags flags,
85
CoglPixelFormat internal_format);
88
_cogl_texture_2d_sliced_new_from_foreign (GLuint gl_handle,
94
CoglPixelFormat format);
97
_cogl_texture_2d_sliced_new_from_bitmap (CoglHandle bmp_handle,
98
CoglTextureFlags flags,
99
CoglPixelFormat internal_format);
101
#endif /* __COGL_TEXTURE_2D_SLICED_H */