2
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
3
// Use of this source code is governed by a BSD-style license that can be
4
// found in the LICENSE file.
7
// DeviceCGL.cpp: CGL implementation of egl::Device
9
#include "common/platform.h"
11
#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
13
# include "libANGLE/renderer/gl/cgl/DeviceCGL.h"
15
# include <EGL/eglext.h>
16
# include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
21
DeviceCGL::DeviceCGL() {}
23
DeviceCGL::~DeviceCGL() {}
25
egl::Error DeviceCGL::initialize()
27
return egl::NoError();
30
egl::Error DeviceCGL::getAttribute(const egl::Display *display, EGLint attribute, void **outValue)
32
DisplayCGL *displayImpl = GetImplAs<DisplayCGL>(display);
36
case EGL_CGL_CONTEXT_ANGLE:
37
*outValue = displayImpl->getCGLContext();
39
case EGL_CGL_PIXEL_FORMAT_ANGLE:
40
*outValue = displayImpl->getCGLPixelFormat();
43
return egl::EglBadAttribute();
46
return egl::NoError();
49
EGLint DeviceCGL::getType()
54
void DeviceCGL::generateExtensions(egl::DeviceExtensions *outExtensions) const
56
outExtensions->deviceCGL = true;
61
#endif // defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)