| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
|
| 7 |
#define GL_SILENCE_DEPRECATION 1 |
| 8 |
|
| 9 |
#if defined(__APPLE__) && defined(__OBJC__) |
| 10 |
#import <AppKit/AppKit.h> |
| 11 |
#else |
| 12 |
struct NSOpenGLContext; |
| 13 |
struct NSOpenGLPixelFormat; |
| 14 |
struct NSView; |
| 15 |
#endif |
| 16 |
|
| 17 |
#include "Common/GL/GLContext.h" |
| 18 |
|
| 19 |
class GLContextAGL final : public GLContext |
| 20 |
{ |
| 21 |
public: |
| 22 |
~GLContextAGL() override; |
| 23 |
|
| 24 |
bool IsHeadless() const override; |
| 25 |
|
| 26 |
std::unique_ptr<GLContext> CreateSharedContext() override; |
| 27 |
|
| 28 |
bool MakeCurrent() override; |
| 29 |
bool ClearCurrent() override; |
| 30 |
|
| 31 |
void Update() override; |
| 32 |
|
| 33 |
void Swap() override; |
| 34 |
void SwapInterval(int interval) override; |
| 35 |
|
| 36 |
protected: |
| 37 |
bool Initialize(const WindowSystemInfo& wsi, bool stereo, bool core) override; |
| 38 |
|
| 39 |
NSView* m_view = nullptr; |
| 40 |
NSOpenGLContext* m_context = nullptr; |
| 41 |
NSOpenGLPixelFormat* m_pixel_format = nullptr; |
| 42 |
}; |