OpenSceneGraph 3.6.5
TexEnvFilter
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_TEXENVFILTER
15#define OSG_TEXENVFILTER 1
16
17#include <osg/GL>
18#include <osg/StateAttribute>
19
20#ifndef GL_EXT_texture_lod_bias
21#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
22#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
23#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
24#endif
25
26namespace osg {
27
30{
31 public:
32 TexEnvFilter(float lodBias = 0.0f);
33
36 StateAttribute(texenv,copyop),
37 _lodBias(texenv._lodBias) {}
38
40
41 virtual bool isTextureAttribute() const { return true; }
42
44 virtual int compare(const StateAttribute& sa) const
45 {
46 // check the types are equal and then create the rhs variable
47 // used by the COMPARE_StateAttribute_Parameter macros below.
49
50 // compare each parameter in turn against the rhs.
52
53 return 0; // passed all the above comparison macros, must be equal.
54 }
55
56 void setLodBias( float lodBias ) { _lodBias = lodBias; }
57
58 float getLodBias() const { return _lodBias; }
59
60 virtual void apply(State& state) const;
61
62 protected:
63 virtual ~TexEnvFilter();
64
65 float _lodBias;
66};
67
68}
69
70#endif
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
@ TEXENVFILTER
Definition StateAttribute:145
virtual bool isTextureAttribute() const
Return true if StateAttribute is a type which controls texturing and needs to be issued w....
Definition TexEnvFilter:41
virtual int compare(const StateAttribute &sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition TexEnvFilter:44
TexEnvFilter(const TexEnvFilter &texenv, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition TexEnvFilter:35
void setLodBias(float lodBias)
Definition TexEnvFilter:56
virtual void apply(State &state) const
apply the OpenGL state attributes.
float getLodBias() const
Definition TexEnvFilter:58
META_StateAttribute(osg, TexEnvFilter, TEXENVFILTER)
float _lodBias
Definition TexEnvFilter:65
TexEnvFilter(float lodBias=0.0f)
virtual ~TexEnvFilter()
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.