1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GLCONTEXTWGL_H_
8 #define GLCONTEXTWGL_H_
10 #include "GLContext.h"
11 #include "WGLLibrary.h"
16 class GLContextWGL final
: public GLContext
{
18 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextWGL
, override
)
19 // From Window: (possibly for offscreen!)
20 GLContextWGL(const GLContextDesc
&, HDC aDC
, HGLRC aContext
,
21 HWND aWindow
= nullptr);
24 GLContextWGL(const GLContextDesc
&, HANDLE aPbuffer
, HDC aDC
, HGLRC aContext
,
29 virtual GLContextType
GetContextType() const override
{
30 return GLContextType::WGL
;
33 virtual bool MakeCurrentImpl() const override
;
34 virtual bool IsCurrentImpl() const override
;
35 virtual bool IsDoubleBuffered() const override
{ return mIsDoubleBuffered
; }
36 virtual bool SwapBuffers() override
;
37 virtual void GetWSIInfo(nsCString
* const out
) const override
;
39 Maybe
<SymbolLoader
> GetSymbolLoader() const override
{
40 return Some(sWGLLib
.GetSymbolLoader());
43 HGLRC
Context() { return mContext
; }
46 friend class GLContextProviderWGL
;
55 bool mIsDoubleBuffered
= false;
59 } // namespace mozilla
61 #endif // GLCONTEXTWGL_H_