1 // 2 // Copyright (c) 2012-2013 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // angletypes.h : Defines a variety of structures and enum types that are used throughout libGLESv2 8 9 #ifndef LIBGLESV2_ANGLETYPES_H_ 10 #define LIBGLESV2_ANGLETYPES_H_ 11 12 namespace gl 13 { 14 15 enum TextureType 16 { 17 TEXTURE_2D, 18 TEXTURE_CUBE, 19 20 TEXTURE_TYPE_COUNT, 21 TEXTURE_UNKNOWN 22 }; 23 24 enum SamplerType 25 { 26 SAMPLER_PIXEL, 27 SAMPLER_VERTEX 28 }; 29 30 struct Color 31 { 32 float red; 33 float green; 34 float blue; 35 float alpha; 36 }; 37 38 struct Rectangle 39 { 40 int x; 41 int y; 42 int width; 43 int height; 44 }; 45 46 struct RasterizerState 47 { 48 bool cullFace; 49 GLenum cullMode; 50 GLenum frontFace; 51 52 bool polygonOffsetFill; 53 GLfloat polygonOffsetFactor; 54 GLfloat polygonOffsetUnits; 55 56 bool pointDrawMode; 57 bool multiSample; 58 }; 59 60 struct BlendState 61 { 62 bool blend; 63 GLenum sourceBlendRGB; 64 GLenum destBlendRGB; 65 GLenum sourceBlendAlpha; 66 GLenum destBlendAlpha; 67 GLenum blendEquationRGB; 68 GLenum blendEquationAlpha; 69 70 bool colorMaskRed; 71 bool colorMaskGreen; 72 bool colorMaskBlue; 73 bool colorMaskAlpha; 74 75 bool sampleAlphaToCoverage; 76 77 bool dither; 78 }; 79 80 struct DepthStencilState 81 { 82 bool depthTest; 83 GLenum depthFunc; 84 bool depthMask; 85 86 bool stencilTest; 87 GLenum stencilFunc; 88 GLuint stencilMask; 89 GLenum stencilFail; 90 GLenum stencilPassDepthFail; 91 GLenum stencilPassDepthPass; 92 GLuint stencilWritemask; 93 GLenum stencilBackFunc; 94 GLuint stencilBackMask; 95 GLenum stencilBackFail; 96 GLenum stencilBackPassDepthFail; 97 GLenum stencilBackPassDepthPass; 98 GLuint stencilBackWritemask; 99 }; 100 101 struct SamplerState 102 { 103 GLenum minFilter; 104 GLenum magFilter; 105 GLenum wrapS; 106 GLenum wrapT; 107 float maxAnisotropy; 108 int lodOffset; 109 }; 110 111 struct ClearParameters 112 { 113 GLbitfield mask; 114 115 Color colorClearValue; 116 bool colorMaskRed; 117 bool colorMaskGreen; 118 bool colorMaskBlue; 119 bool colorMaskAlpha; 120 121 float depthClearValue; 122 123 GLint stencilClearValue; 124 GLuint stencilWriteMask; 125 }; 126 127 } 128 129 #endif // LIBGLESV2_ANGLETYPES_H_ 130