2
* Copyright © 2008 Dennis Kasprzyk
3
* Copyright © 2007 Novell, Inc.
5
* Permission to use, copy, modify, distribute, and sell this software
6
* and its documentation for any purpose is hereby granted without
7
* fee, provided that the above copyright notice appear in all copies
8
* and that both that copyright notice and this permission notice
9
* appear in supporting documentation, and that the name of
10
* Dennis Kasprzyk not be used in advertising or publicity pertaining to
11
* distribution of the software without specific, written prior permission.
12
* Dennis Kasprzyk makes no representations about the suitability of this
13
* software for any purpose. It is provided "as is" without express or
16
* DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
18
* NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
20
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
21
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
22
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24
* Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
25
* David Reveman <davidr@novell.com>
28
#include <core/core.h>
29
#include <core/privatehandler.h>
32
const CompMetadata::OptionInfo glOptionInfo[GL_OPTION_NUM] = {
33
{ "texture_filter", "int", RESTOSTRING (0, 2), 0, 0 },
34
{ "lighting", "bool", 0, 0, 0 },
35
{ "sync_to_vblank", "bool", 0, 0, 0 },
36
{ "texture_compression", "bool", 0, 0, 0 },
40
GLScreen::getOptions ()
46
GLScreen::setOption (const char *name,
47
CompOption::Value &value)
52
o = CompOption::findOption (priv->opt, name, &index);
57
case GL_OPTION_TEXTURE_FILTER:
60
priv->cScreen->damageScreen ();
62
if (!o->value ().i ())
63
priv->textureFilter = GL_NEAREST;
65
priv->textureFilter = GL_LINEAR;
71
if (CompOption::setOption (*o, value))
79
class OpenglPluginVTable :
80
public CompPlugin::VTableForScreenAndWindow<GLScreen, GLWindow>
87
PLUGIN_OPTION_HELPER (GLScreen)
90
COMPIZ_PLUGIN_20081216 (opengl, OpenglPluginVTable)
93
OpenglPluginVTable::init ()
95
if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) ||
96
!CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI))
100
p.uval = COMPIZ_OPENGL_ABI;
101
screen->storeValue ("opengl_ABI", p);
103
getMetadata ()->addFromOptionInfo (glOptionInfo, GL_OPTION_NUM);
104
getMetadata ()->addFromFile (name ());
110
OpenglPluginVTable::fini ()
112
screen->eraseValue ("opengl_ABI");