1 /*
2   ==============================================================================
3 
4    This file is part of the JUCE library.
5    Copyright (c) 2020 - Raw Material Software Limited
6 
7    JUCE is an open source library subject to commercial or open-source
8    licensing.
9 
10    By using JUCE, you agree to the terms of both the JUCE 6 End-User License
11    Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
12 
13    End User License Agreement: www.juce.com/juce-6-licence
14    Privacy Policy: www.juce.com/juce-privacy-policy
15 
16    Or: You may also use this code under the terms of the GPL v3 (see
17    www.gnu.org/licenses).
18 
19    JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20    EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21    DISCLAIMED.
22 
23   ==============================================================================
24 */
25 
26 namespace juce
27 {
28 
29 //==============================================================================
30 /**
31     Represents the various properties of an OpenGL pixel format.
32 
33     @see OpenGLContext::setPixelFormat
34 
35     @tags{OpenGL}
36 */
37 class JUCE_API  OpenGLPixelFormat
38 {
39 public:
40     //==============================================================================
41     /** Creates an OpenGLPixelFormat.
42 
43         The default constructor just initialises the object as a simple 8-bit
44         RGBA format.
45     */
46     OpenGLPixelFormat (int bitsPerRGBComponent = 8,
47                        int alphaBits = 8,
48                        int depthBufferBits = 16,
49                        int stencilBufferBits = 0) noexcept;
50 
51     bool operator== (const OpenGLPixelFormat&) const noexcept;
52     bool operator!= (const OpenGLPixelFormat&) const noexcept;
53 
54     //==============================================================================
55     int redBits;          /**< The number of bits per pixel to use for the red channel. */
56     int greenBits;        /**< The number of bits per pixel to use for the green channel. */
57     int blueBits;         /**< The number of bits per pixel to use for the blue channel. */
58     int alphaBits;        /**< The number of bits per pixel to use for the alpha channel. */
59 
60     int depthBufferBits;      /**< The number of bits per pixel to use for a depth buffer. */
61     int stencilBufferBits;    /**< The number of bits per pixel to use for a stencil buffer. */
62 
63     int accumulationBufferRedBits;    /**< The number of bits per pixel to use for an accumulation buffer's red channel. */
64     int accumulationBufferGreenBits;  /**< The number of bits per pixel to use for an accumulation buffer's green channel. */
65     int accumulationBufferBlueBits;   /**< The number of bits per pixel to use for an accumulation buffer's blue channel. */
66     int accumulationBufferAlphaBits;  /**< The number of bits per pixel to use for an accumulation buffer's alpha channel. */
67 
68     uint8 multisamplingLevel;         /**< The number of samples to use for full-scene multisampled anti-aliasing (if available). */
69 };
70 
71 } // namespace juce
72