NRE_ContextAttributes.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include <Utility/Array/NRE_Array.hpp>
13 
18  namespace NRE {
23  namespace Graphics {
24 
29  enum class GLAttributes : int {
30  RED_SIZE,
31  GREEN_SIZE,
32  BLUE_SIZE,
33  ALPHA_SIZE,
34  BUFFER_SIZE,
35  DOUBLEBUFFER,
36  DEPTH_SIZE,
37  STENCIL_SIZE,
38  STEREO,
39  MULTISAMPLE_BUFFERS,
40  MULTISAMPLE_SAMPLES,
41  ACCELERATED_VISUAL,
42  MAJOR_VERSION,
43  MINOR_VERSION,
45  NUM_ATTRIBUTES /*< The number of attributes */
46  };
47 
53  private : // Fields
54  Utility::Array<int, static_cast <std::size_t> (GLAttributes::NUM_ATTRIBUTES)> attributes;
56  public : // Methods
57  //## Constructor ##//
66  ContextAttributes(std::initializer_list<int> list);
67 
68  //## Copy Constructor ##//
73  ContextAttributes(ContextAttributes const& attr) = default;
74 
75  //## Move Constructor ##//
80  ContextAttributes(ContextAttributes && attr) = default;
81 
82  //## Deconstructor ##//
86  ~ContextAttributes() = default;
87 
88  //## Access Operator ##//
94  int& operator[](GLAttributes index);
100  int const& operator[](GLAttributes index) const;
101 
102  //## Assignment Operator ##//
108  ContextAttributes& operator =(ContextAttributes const& attr) = default;
114  ContextAttributes& operator =(ContextAttributes && attr) = default;
115 
116  };
117 
118  }
119  }
120 
121  #include "NRE_ContextAttributes.tpp"
GLAttributes
Regroup all attributes that the user can modiy before create a GL context.
Definition: NRE_ContextAttributes.hpp:29
The NearlyRealEngine&#39;s global namespace.
Graphics&#39; API.
Regroup all attributes needed in a GL context, should be modified before creation.
Definition: NRE_ContextAttributes.hpp:52