NRE_Context.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include <Header/NRE_Math.hpp>
13  #include "../NRE_GraphicsDriver.hpp"
14  #include "../../Window/Internal/NRE_InternalWindow.hpp"
16 
17  #include "../../../../Header/NRE_Exception.hpp"
18 
23  namespace NRE {
28  namespace Graphics {
29 
30  #ifdef _WIN32 // Windows
31  typedef HGLRC NativeContextType;
32  #elif __linux__ // Linux
33  typedef GLXContext NativeContextType;
34  #endif
35 
40  class Context {
41  private : // Fields
42  NativeContextType internal;
43  ContextAttributes attributes;
44  bool owned;
46  public : // Methods
47  //## Constructor ##//
53  Context(InternalWindow& window, ContextAttributes const& attr);
54 
55  //## Copy Constructor ##//
60  Context(Context const& ctx) = delete;
61 
62  //## Move Constructor ##//
67  Context(Context && ctx) = delete;
68 
69  //## Deconstructor ##//
73  ~Context();
74 
75  //## Methods ##//
79  void release();
80 
81  //## Assignment Operator ##//
87  Context& operator =(Context const& ctx) = delete;
93  Context& operator =(Context && ctx) = delete;
94  };
95  }
96  }
97 
98  #include "NRE_Context.tpp"
Context & operator=(Context const &ctx)=delete
Context(InternalWindow &window, ContextAttributes const &attr)
Definition: NRE_LinuxContext.cpp:18
Describe an OpenGL Context with a set of attributes.
Definition: NRE_Context.hpp:40
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
Manage the internal os-dependant graphics window.
Definition: NRE_InternalWindow.hpp:34
Declaration of Graphics&#39;s API&#39;s Object : ContextAttributes.
void release()
Definition: NRE_LinuxContext.cpp:119