1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
5
* Mipmap emulation by creation of scaled down images
7
* Copyright (C) 2009 Red Hat, Inc.
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License as
11
* published by the Free Software Foundation; either version 2 of the
12
* License, or (at your option) any later version.
14
* This program is distributed in the hope that it will be useful, but
15
* WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25
#ifndef __MUTTER_TEXTURE_TOWER_H__
26
#define __MUTTER_TEXTURE_TOWER_H__
28
#include <clutter/clutter.h>
33
* SECTION:MutterTextureTower
34
* @short_description: mipmap emulation by creation of scaled down images
36
* A #MutterTextureTower is used to get good looking scaled down images when
37
* we can't use the GL drivers mipmap support. There are two separate reasons
39
* - Some cards (including radeon cards <= r5xx) only support
40
* TEXTURE_RECTANGLE_ARB and not NPOT textures. Rectangular textures
41
* are defined not to support mipmapping.
42
* - Even when NPOT textures are available, the combination of NPOT
43
* textures, texture_from_pixmap, and mipmapping doesn't typically
44
* work, since the X server doesn't allocate pixmaps in the right
45
* layout for mipmapping.
47
* So, what we do is create the "mipmap" levels ourselves by successive
48
* power-of-two scaledowns, and when rendering pick the single texture
49
* that best matches the scale we are rendering at. (Since we aren't
50
* typically using perspective transforms, we'll frequently have a single
51
* scale for the entire texture.)
54
typedef struct _MutterTextureTower MutterTextureTower;
56
MutterTextureTower *mutter_texture_tower_new (void);
57
void mutter_texture_tower_free (MutterTextureTower *tower);
58
void mutter_texture_tower_set_base_texture (MutterTextureTower *tower,
60
void mutter_texture_tower_update_area (MutterTextureTower *tower,
65
CoglHandle mutter_texture_tower_get_paint_texture (MutterTextureTower *tower);
69
#endif /* __MUTTER_TEXTURE_TOWER_H__ */