GteWGLEngine.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.1 (2016/06/30)
7 
8 #pragma once
9 
11 
12 namespace gte
13 {
14 
16 {
17 public:
18  // Construction and destruction. The first constructor is for windowed
19  // graphics applications. The second constructor is for windowless
20  // compute-program applications.
21  //
22  // TODO: Currently, OpenGL 4.3 is required for compute shaders. See
23  // the comment in GteGL4Engine.h for 'MeetsRequirements()'.
24  virtual ~WGLEngine();
25  WGLEngine(HWND handle, bool saveDriverInfo, int requiredMajor = 4, int requiredMinor = 3);
26  WGLEngine(bool saveDriverInfo, int requiredMajor = 4, int requiredMinor = 3);
27 
28  // Access to members that correspond to constructor inputs.
29  inline HDC GetDevice() const;
30  inline HGLRC GetImmediate() const;
31 
32  // Allow the user to switch between OpenGL contexts when there are
33  // multiple instances of GL4Engine in an application.
34  virtual bool IsActive() const override;
35  virtual void MakeActive() override;
36 
37  // Support for clearing the color, depth, and stencil back buffers.
38  virtual void DisplayColorBuffer(unsigned int syncInterval) override;
39 
40 private:
41  // Helpers for construction and destruction.
42  virtual bool Initialize(int requiredMajor, int requiredMinor, bool saveDriverInfo) override;
43  void Terminate();
44 
45  // Inputs to the constructor.
46  HWND mHandle;
47 
48  // Objects created by the constructors.
51  std::wstring mComputeWindowClass;
53 };
54 
55 inline HDC WGLEngine::GetDevice() const
56 {
57  return mDevice;
58 }
59 
61 {
62  return mImmediate;
63 }
64 
65 }
typedef HGLRC(WINAPI *PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC hDC
std::wstring mComputeWindowClass
Definition: GteWGLEngine.h:51
HGLRC GetImmediate() const
Definition: GteWGLEngine.h:60
ATOM mComputeWindowAtom
Definition: GteWGLEngine.h:52
typedef HDC(WINAPI *PFNWGLGETCURRENTREADDCARBPROC)(void)
HDC GetDevice() const
Definition: GteWGLEngine.h:55
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:02