Hash :
da507fea
Author :
Date :
2013-08-20T12:01:42
Refactored the ClearParameters type and moved Renderer11's clear logic into a Clear11 helper class. TRAC #23475 Author: Geoff Lang Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
//
// Copyright (c) 2012-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// angletypes.h : Defines a variety of structures and enum types that are used throughout libGLESv2
#ifndef LIBGLESV2_ANGLETYPES_H_
#define LIBGLESV2_ANGLETYPES_H_
#include "libGLESv2/constants.h"
namespace gl
{
enum TextureType
{
TEXTURE_2D,
TEXTURE_CUBE,
TEXTURE_3D,
TEXTURE_2D_ARRAY,
TEXTURE_TYPE_COUNT,
TEXTURE_UNKNOWN
};
enum SamplerType
{
SAMPLER_PIXEL,
SAMPLER_VERTEX
};
template <typename T>
struct Color
{
T red;
T green;
T blue;
T alpha;
Color() : red(0), green(0), blue(0), alpha(0) { }
Color(T r, T g, T b, T a) : red(r), green(g), blue(b), alpha(a) { }
};
typedef Color<float> ColorF;
typedef Color<int> ColorI;
typedef Color<unsigned int> ColorUI;
struct Rectangle
{
int x;
int y;
int width;
int height;
Rectangle() : x(0), y(0), width(0), height(0) { }
Rectangle(int x_in, int y_in, int width_in, int height_in) : x(x_in), y(y_in), width(width_in), height(height_in) { }
};
struct Box
{
int x;
int y;
int z;
int width;
int height;
int depth;
Box() : x(0), y(0), z(0), width(0), height(0), depth(0) { }
Box(int x_in, int y_in, int z_in, int width_in, int height_in, int depth_in) : x(x_in), y(y_in), z(z_in), width(width_in), height(height_in), depth(depth_in) { }
};
struct Extents
{
int width;
int height;
int depth;
Extents() : width(0), height(0), depth(0) { }
Extents(int width_, int height_, int depth_) : width(width_), height(height_), depth(depth_) { }
};
struct RasterizerState
{
bool cullFace;
GLenum cullMode;
GLenum frontFace;
bool polygonOffsetFill;
GLfloat polygonOffsetFactor;
GLfloat polygonOffsetUnits;
bool pointDrawMode;
bool multiSample;
};
struct BlendState
{
bool blend;
GLenum sourceBlendRGB;
GLenum destBlendRGB;
GLenum sourceBlendAlpha;
GLenum destBlendAlpha;
GLenum blendEquationRGB;
GLenum blendEquationAlpha;
bool colorMaskRed;
bool colorMaskGreen;
bool colorMaskBlue;
bool colorMaskAlpha;
bool sampleAlphaToCoverage;
bool dither;
};
struct DepthStencilState
{
bool depthTest;
GLenum depthFunc;
bool depthMask;
bool stencilTest;
GLenum stencilFunc;
GLuint stencilMask;
GLenum stencilFail;
GLenum stencilPassDepthFail;
GLenum stencilPassDepthPass;
GLuint stencilWritemask;
GLenum stencilBackFunc;
GLuint stencilBackMask;
GLenum stencilBackFail;
GLenum stencilBackPassDepthFail;
GLenum stencilBackPassDepthPass;
GLuint stencilBackWritemask;
};
struct SamplerState
{
GLenum minFilter;
GLenum magFilter;
GLenum wrapS;
GLenum wrapT;
GLenum wrapR;
float maxAnisotropy;
int lodOffset;
GLenum compareMode;
GLenum compareFunc;
};
struct ClearParameters
{
bool clearColor[gl::IMPLEMENTATION_MAX_DRAW_BUFFERS];
ColorF colorFClearValue;
ColorI colorIClearValue;
ColorUI colorUIClearValue;
GLenum colorClearType;
bool colorMaskRed;
bool colorMaskGreen;
bool colorMaskBlue;
bool colorMaskAlpha;
bool clearDepth;
float depthClearValue;
bool clearStencil;
GLint stencilClearValue;
GLuint stencilWriteMask;
bool scissorEnabled;
Rectangle scissor;
};
}
#endif // LIBGLESV2_ANGLETYPES_H_