From 416b9469b895163797f4e87463114d90b2188e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?furby=E2=84=A2?= Date: Mon, 19 Feb 2024 13:12:05 -0600 Subject: [PATCH] Inline apple GL framework (cxx) implementation. * This is so the apple GL framework can be used from pure cxx on apple platforms, which swift requires with cxx interop since apple frameworks in their Objective-C++ implementations are not compliant with ARC (which explicitly forbids release/retain), but through C++, we reserve the right to perform our own memory management and regain the ability to make calls to release/retain. --- Sources/Apple/include/OpenGL/NSGLContext.hpp | 215 +++++++++++------- Sources/Apple/include/OpenGL/NSGLDefines.hpp | 48 ++-- .../Apple/include/OpenGL/NSGLPixelFormat.hpp | 147 ++++++++++++ Sources/Apple/include/OpenGL/NSGLPrivate.hpp | 89 ++++++-- Sources/Apple/include/OpenGL/OpenGL.hpp | 49 ++-- 5 files changed, 403 insertions(+), 145 deletions(-) create mode 100644 Sources/Apple/include/OpenGL/NSGLPixelFormat.hpp diff --git a/Sources/Apple/include/OpenGL/NSGLContext.hpp b/Sources/Apple/include/OpenGL/NSGLContext.hpp index 6ccccc74..73d19def 100644 --- a/Sources/Apple/include/OpenGL/NSGLContext.hpp +++ b/Sources/Apple/include/OpenGL/NSGLContext.hpp @@ -1,27 +1,38 @@ -//------------------------------------------------------------------------------------------------------------------------------------------------------------- -// -// OpenGL/NSGLContext.hpp -// -// Copyright 2020-2023 Apple Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------------------------------------------------------------------------------------- +/* ---------------------------------------------------------------- + * :: : M E T A V E R S E : :: + * ---------------------------------------------------------------- + * This software is Licensed under the terms of the Apache License, + * version 2.0 (the "Apache License") with the following additional + * modification; you may not use this file except within compliance + * of the Apache License and the following modification made to it. + * Section 6. Trademarks. is deleted and replaced with: + * + * Trademarks. This License does not grant permission to use any of + * its trade names, trademarks, service marks, or the product names + * of this Licensor or its affiliates, except as required to comply + * with Section 4(c.) of this License, and to reproduce the content + * of the NOTICE file. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND without even an + * implied warranty of MERCHANTABILITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the Apache License for more details. + * + * You should have received a copy for this software license of the + * Apache License along with this program; or, if not, please write + * to the Free Software Foundation Inc., with the following address + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright (C) 2024 Wabi Foundation. All Rights Reserved. + * ---------------------------------------------------------------- + * . x x x . o o o . x x x . : : : . o x o . : : : . + * ---------------------------------------------------------------- */ #pragma once #include "NSGLDefines.hpp" #include "NSGLPrivate.hpp" +#include "NSGLPixelFormat.hpp" #include @@ -29,54 +40,6 @@ namespace NSGL { -_NSGL_ENUM(NS::UInteger, OpenGLPixelFormatAttribute) -{ - OpenGLPFAAllRenderers = 1, - OpenGLPFATripleBuffer = 3, - OpenGLPFADoubleBuffer = 5, - OpenGLPFAAuxBuffers = 7, - OpenGLPFAColorSize = 8, - OpenGLPFAAlphaSize = 11, - OpenGLPFADepthSize = 12, - OpenGLPFAStencilSize = 13, - OpenGLPFAAccumSize = 14, - OpenGLPFAMinimumPolicy = 51, - OpenGLPFAMaximumPolicy = 52, - OpenGLPFASampleBuffers = 55, - OpenGLPFASamples = 56, - OpenGLPFAAuxDepthStencil = 57, - OpenGLPFAColorFloat = 58, - OpenGLPFAMultisample = 59, - OpenGLPFASupersample = 60, - OpenGLPFASampleAlpha = 61, - OpenGLPFARendererID = 70, - OpenGLPFANoRecovery = 72, - OpenGLPFAAccelerated = 73, - OpenGLPFAClosestPolicy = 74, - OpenGLPFABackingStore = 76, - OpenGLPFAScreenMask = 84, - OpenGLPFAAllowOfflineRenderers = 96, - OpenGLPFAAcceleratedCompute = 97, - OpenGLPFAOpenGLProfile = 99, - OpenGLPFAVirtualScreenCount = 128, - - OpenGLPFAStereo = 6, - OpenGLPFAOffScreen = 53, - OpenGLPFAFullScreen = 54, - OpenGLPFASingleRenderer = 71, - OpenGLPFARobust = 75, - OpenGLPFAMPSafe = 78, - OpenGLPFAWindow = 80, - OpenGLPFAMultiScreen = 81, - OpenGLPFACompliant = 83, - OpenGLPFAPixelBuffer = 90, - OpenGLPFARemotePixelBuffer = 91, - - OpenGLProfileVersionLegacy = 0x1000, /* choose a Legacy/Pre-OpenGL 3.0 Implementation */ - OpenGLProfileVersion3_2Core = 0x3200, /* choose an OpenGL 3.2 Core Implementation */ - OpenGLProfileVersion4_1Core = 0x4100, /* choose an OpenGL 4.1 Core Implementation */ -}; - _NSGL_ENUM(NS::Integer, OpenGLContextParameter) { OpenGLContextParameterSwapInterval = 222, OpenGLContextParameterSurfaceOrder = 235, @@ -95,24 +58,6 @@ _NSGL_ENUM(NS::Integer, OpenGLContextParameter) { OpenGLContextParameterSurfaceSurfaceVolatile = 306, }; -class OpenGLPixelFormat : public NS::Referencing -{ - public: - static class OpenGLPixelFormat* alloc(); - - NSGL::OpenGLPixelFormat* init(const NSGL::OpenGLPixelFormatAttribute* attribs); - NSGL::OpenGLPixelFormat* init(NS::Data* attribs); - - NS::Data* attributes(NSGL::OpenGLPixelFormatAttribute attributes); - void getValues(NS::Integer* vals, NSGL::OpenGLPixelFormatAttribute attrib, NS::Integer screen); - - NS::Integer numberOfVirtualScreens() const; - void setFullScreen(); - void clearFullScreen(); - - void* CGLPixelFormatObj() const; -}; - class OpenGLContext : public NS::Referencing { public: @@ -147,10 +92,106 @@ class OpenGLContext : public NS::Referencing void clearFullScreen(); void setValues(const NS::Integer* vals, NSGL::OpenGLContextParameter param); - void getValues(NS::Integer* vals, NS::Integer count, NSGL::OpenGLContextParameter param); + void getValues(NS::Integer* vals, NSGL::OpenGLContextParameter param); NS::Integer currentVirtualScreen() const; void* CGLContextObj() const; }; -} // namespace NSGL \ No newline at end of file +} // namespace NSGL + +// static method: alloc +_NSGL_INLINE NSGL::OpenGLContext* NSGL::OpenGLContext::alloc() +{ + return NS::Object::alloc(_NSGL_PRIVATE_CLS(NSOpenGLContext)); +} + +// method: initWithFormat:shareContext: +_NSGL_INLINE NSGL::OpenGLContext* NSGL::OpenGLContext::init(const NSGL::OpenGLPixelFormat* format, NSGL::OpenGLContext* share) +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(initWithFormat_shareContext_), format, share); +} + +// method: pixelFormat +_NSGL_INLINE NSGL::OpenGLPixelFormat* NSGL::OpenGLContext::pixelFormat() const +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(pixelFormat)); +} + +// method: setOffScreen:width:height:rowbytes: +_NSGL_INLINE void NSGL::OpenGLContext::setOffScreen(void* baseaddr, NS::Integer width, NS::Integer height, NS::Integer rowbytes) +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(setOffScreen_width_height_rowbytes_), baseaddr, width, height, rowbytes); +} + +// method: clearDrawable +_NSGL_INLINE void NSGL::OpenGLContext::clearDrawable() +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(clearDrawable)); +} + +// method: update +_NSGL_INLINE void NSGL::OpenGLContext::update() +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(update)); +} + +// method: flushBuffer +_NSGL_INLINE void NSGL::OpenGLContext::flushBuffer() +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(flushBuffer)); +} + +// method: makeCurrentContext +_NSGL_INLINE void NSGL::OpenGLContext::makeCurrentContext() +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(makeCurrentContext)); +} + +// static method: clearCurrentContext +_NSGL_INLINE void NSGL::OpenGLContext::clearCurrentContext() +{ + Object::sendMessage(_NSGL_PRIVATE_CLS(NSOpenGLContext), _NSGL_PRIVATE_SEL(clearCurrentContext)); +} + +// static method: currentContext +_NSGL_INLINE NSGL::OpenGLContext* NSGL::OpenGLContext::currentContext() +{ + return Object::sendMessage(_NSGL_PRIVATE_CLS(NSOpenGLContext), _NSGL_PRIVATE_SEL(currentContext)); +} + +// method: setFullScreen +_NSGL_INLINE void NSGL::OpenGLContext::setFullScreen() +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(setFullScreen)); +} + +// method: clearFullScreen +_NSGL_INLINE void NSGL::OpenGLContext::clearFullScreen() +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(clearFullScreen)); +} + +// method: setValues:forParameter: +_NSGL_INLINE void NSGL::OpenGLContext::setValues(const NS::Integer* vals, NSGL::OpenGLContextParameter param) +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(setValues_forParameter_), vals, param); +} + +// method: getValues:forParameter: +_NSGL_INLINE void NSGL::OpenGLContext::getValues(NS::Integer* vals, NSGL::OpenGLContextParameter param) +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(getValues_forParameter_), vals, param); +} + +// method: currentVirtualScreen +_NSGL_INLINE NS::Integer NSGL::OpenGLContext::currentVirtualScreen() const +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(currentVirtualScreen)); +} + +// method: CGLContextObj +_NSGL_INLINE void* NSGL::OpenGLContext::CGLContextObj() const +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(CGLContextObj)); +} diff --git a/Sources/Apple/include/OpenGL/NSGLDefines.hpp b/Sources/Apple/include/OpenGL/NSGLDefines.hpp index b5869688..6754204c 100644 --- a/Sources/Apple/include/OpenGL/NSGLDefines.hpp +++ b/Sources/Apple/include/OpenGL/NSGLDefines.hpp @@ -1,22 +1,32 @@ -//------------------------------------------------------------------------------------------------------------------------------------------------------------- -// -// Metal/MTLDefines.hpp -// -// Copyright 2020-2023 Apple Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------------------------------------------------------------------------------------- +/* ---------------------------------------------------------------- + * :: : M E T A V E R S E : :: + * ---------------------------------------------------------------- + * This software is Licensed under the terms of the Apache License, + * version 2.0 (the "Apache License") with the following additional + * modification; you may not use this file except within compliance + * of the Apache License and the following modification made to it. + * Section 6. Trademarks. is deleted and replaced with: + * + * Trademarks. This License does not grant permission to use any of + * its trade names, trademarks, service marks, or the product names + * of this Licensor or its affiliates, except as required to comply + * with Section 4(c.) of this License, and to reproduce the content + * of the NOTICE file. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND without even an + * implied warranty of MERCHANTABILITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the Apache License for more details. + * + * You should have received a copy for this software license of the + * Apache License along with this program; or, if not, please write + * to the Free Software Foundation Inc., with the following address + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright (C) 2024 Wabi Foundation. All Rights Reserved. + * ---------------------------------------------------------------- + * . x x x . o o o . x x x . : : : . o x o . : : : . + * ---------------------------------------------------------------- */ #pragma once diff --git a/Sources/Apple/include/OpenGL/NSGLPixelFormat.hpp b/Sources/Apple/include/OpenGL/NSGLPixelFormat.hpp new file mode 100644 index 00000000..bbd931ec --- /dev/null +++ b/Sources/Apple/include/OpenGL/NSGLPixelFormat.hpp @@ -0,0 +1,147 @@ +/* ---------------------------------------------------------------- + * :: : M E T A V E R S E : :: + * ---------------------------------------------------------------- + * This software is Licensed under the terms of the Apache License, + * version 2.0 (the "Apache License") with the following additional + * modification; you may not use this file except within compliance + * of the Apache License and the following modification made to it. + * Section 6. Trademarks. is deleted and replaced with: + * + * Trademarks. This License does not grant permission to use any of + * its trade names, trademarks, service marks, or the product names + * of this Licensor or its affiliates, except as required to comply + * with Section 4(c.) of this License, and to reproduce the content + * of the NOTICE file. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND without even an + * implied warranty of MERCHANTABILITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the Apache License for more details. + * + * You should have received a copy for this software license of the + * Apache License along with this program; or, if not, please write + * to the Free Software Foundation Inc., with the following address + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright (C) 2024 Wabi Foundation. All Rights Reserved. + * ---------------------------------------------------------------- + * . x x x . o o o . x x x . : : : . o x o . : : : . + * ---------------------------------------------------------------- */ + +#pragma once + +#include "NSGLDefines.hpp" +#include "NSGLPrivate.hpp" + +#include + +#include "OpenGL.hpp" + +namespace NSGL +{ +_NSGL_ENUM(NS::UInteger, OpenGLPixelFormatAttribute) +{ + OpenGLPFAAllRenderers = 1, + OpenGLPFATripleBuffer = 3, + OpenGLPFADoubleBuffer = 5, + OpenGLPFAAuxBuffers = 7, + OpenGLPFAColorSize = 8, + OpenGLPFAAlphaSize = 11, + OpenGLPFADepthSize = 12, + OpenGLPFAStencilSize = 13, + OpenGLPFAAccumSize = 14, + OpenGLPFAMinimumPolicy = 51, + OpenGLPFAMaximumPolicy = 52, + OpenGLPFASampleBuffers = 55, + OpenGLPFASamples = 56, + OpenGLPFAAuxDepthStencil = 57, + OpenGLPFAColorFloat = 58, + OpenGLPFAMultisample = 59, + OpenGLPFASupersample = 60, + OpenGLPFASampleAlpha = 61, + OpenGLPFARendererID = 70, + OpenGLPFANoRecovery = 72, + OpenGLPFAAccelerated = 73, + OpenGLPFAClosestPolicy = 74, + OpenGLPFABackingStore = 76, + OpenGLPFAScreenMask = 84, + OpenGLPFAAllowOfflineRenderers = 96, + OpenGLPFAAcceleratedCompute = 97, + OpenGLPFAOpenGLProfile = 99, + OpenGLPFAVirtualScreenCount = 128, + + OpenGLPFAStereo = 6, + OpenGLPFAOffScreen = 53, + OpenGLPFAFullScreen = 54, + OpenGLPFASingleRenderer = 71, + OpenGLPFARobust = 75, + OpenGLPFAMPSafe = 78, + OpenGLPFAWindow = 80, + OpenGLPFAMultiScreen = 81, + OpenGLPFACompliant = 83, + OpenGLPFAPixelBuffer = 90, + OpenGLPFARemotePixelBuffer = 91, + + OpenGLProfileVersionLegacy = 0x1000, /* choose a Legacy/Pre-OpenGL 3.0 Implementation */ + OpenGLProfileVersion3_2Core = 0x3200, /* choose an OpenGL 3.2 Core Implementation */ + OpenGLProfileVersion4_1Core = 0x4100, /* choose an OpenGL 4.1 Core Implementation */ +}; + +class OpenGLPixelFormat : public NS::Referencing +{ + public: + static class OpenGLPixelFormat* alloc(); + + NSGL::OpenGLPixelFormat* init(const NSGL::OpenGLPixelFormatAttribute* attribs); + NSGL::OpenGLPixelFormat* init(NS::Data* attribs); + + NS::Data* attributes(NSGL::OpenGLPixelFormatAttribute attributes); + void getValues(NS::Integer* vals, NSGL::OpenGLPixelFormatAttribute attrib, NS::Integer screen); + + NS::Integer numberOfVirtualScreens() const; + + void* CGLPixelFormatObj() const; +}; +} // namespace NSGL + +// static method: alloc +_NSGL_INLINE NSGL::OpenGLPixelFormat* NSGL::OpenGLPixelFormat::alloc() +{ + return NS::Object::alloc(_NSGL_PRIVATE_CLS(NSOpenGLPixelFormat)); +} + +// method: initWithAttributes: +_NSGL_INLINE NSGL::OpenGLPixelFormat* NSGL::OpenGLPixelFormat::init(const NSGL::OpenGLPixelFormatAttribute* attribs) +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(initWithAttributes_), attribs); +} + +// method: initWithData: +_NSGL_INLINE NSGL::OpenGLPixelFormat* NSGL::OpenGLPixelFormat::init(NS::Data* attribs) +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(initWithData_), attribs); +} + +// method: attributes +_NSGL_INLINE NS::Data* NSGL::OpenGLPixelFormat::attributes(NSGL::OpenGLPixelFormatAttribute attributes) +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(attributes), attributes); +} + +// method: getValues:forAttribute:forVirtualScreen: +_NSGL_INLINE void NSGL::OpenGLPixelFormat::getValues(NS::Integer* vals, NSGL::OpenGLPixelFormatAttribute attrib, NS::Integer screen) +{ + Object::sendMessage(this, _NSGL_PRIVATE_SEL(getValues_forAttribute_forVirtualScreen_), vals, attrib, screen); +} + +// property: numberOfVirtualScreens +_NSGL_INLINE NS::Integer NSGL::OpenGLPixelFormat::numberOfVirtualScreens() const +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(numberOfVirtualScreens)); +} + +// property: CGLPixelFormatObj +_NSGL_INLINE void* NSGL::OpenGLPixelFormat::CGLPixelFormatObj() const +{ + return Object::sendMessage(this, _NSGL_PRIVATE_SEL(CGLPixelFormatObj)); +} diff --git a/Sources/Apple/include/OpenGL/NSGLPrivate.hpp b/Sources/Apple/include/OpenGL/NSGLPrivate.hpp index d02078a7..1788d737 100644 --- a/Sources/Apple/include/OpenGL/NSGLPrivate.hpp +++ b/Sources/Apple/include/OpenGL/NSGLPrivate.hpp @@ -1,22 +1,32 @@ -//------------------------------------------------------------------------------------------------------------------------------------------------------------- -// -// Metal/NSGLPrivate.hpp -// -// Copyright 2020-2023 Apple Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------------------------------------------------------------------------------------- +/* ---------------------------------------------------------------- + * :: : M E T A V E R S E : :: + * ---------------------------------------------------------------- + * This software is Licensed under the terms of the Apache License, + * version 2.0 (the "Apache License") with the following additional + * modification; you may not use this file except within compliance + * of the Apache License and the following modification made to it. + * Section 6. Trademarks. is deleted and replaced with: + * + * Trademarks. This License does not grant permission to use any of + * its trade names, trademarks, service marks, or the product names + * of this Licensor or its affiliates, except as required to comply + * with Section 4(c.) of this License, and to reproduce the content + * of the NOTICE file. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND without even an + * implied warranty of MERCHANTABILITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the Apache License for more details. + * + * You should have received a copy for this software license of the + * Apache License along with this program; or, if not, please write + * to the Free Software Foundation Inc., with the following address + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright (C) 2024 Wabi Foundation. All Rights Reserved. + * ---------------------------------------------------------------- + * . x x x . o o o . x x x . : : : . o x o . : : : . + * ---------------------------------------------------------------- */ #pragma once @@ -118,6 +128,7 @@ namespace NSGL { namespace Class { + _NSGL_PRIVATE_DEF_CLS(NSOpenGLPixelFormat); _NSGL_PRIVATE_DEF_CLS(NSOpenGLContext); _NSGL_PRIVATE_DEF_CLS(NSOpenGLPixelBuffer); } // Class @@ -146,10 +157,48 @@ namespace NSGL { namespace Selector { - _NSGL_PRIVATE_DEF_SEL(initWithFormat_shareContext, + _NSGL_PRIVATE_DEF_SEL(initWithAttributes_, + "initWithAttributes:"); + _NSGL_PRIVATE_DEF_SEL(initWithData_, + "initWithData:"); + _NSGL_PRIVATE_DEF_SEL(attributes, + "attributes"); + _NSGL_PRIVATE_DEF_SEL(getValues_forAttribute_forVirtualScreen_, + "getValues:forAttribute:forVirtualScreen:"); + _NSGL_PRIVATE_DEF_SEL(numberOfVirtualScreens, + "numberOfVirtualScreens"); + _NSGL_PRIVATE_DEF_SEL(CGLPixelFormatObj, + "CGLPixelFormatObj"); + _NSGL_PRIVATE_DEF_SEL(initWithFormat_shareContext_, "initWithFormat:shareContext:"); + _NSGL_PRIVATE_DEF_SEL(pixelFormat, + "pixelFormat"); + _NSGL_PRIVATE_DEF_SEL(setOffScreen_width_height_rowbytes_, + "setOffScreen:width:height:rowbytes:"); + _NSGL_PRIVATE_DEF_SEL(clearDrawable, + "clearDrawable"); + _NSGL_PRIVATE_DEF_SEL(update, + "update"); + _NSGL_PRIVATE_DEF_SEL(flushBuffer, + "flushBuffer"); + _NSGL_PRIVATE_DEF_SEL(makeCurrentContext, + "makeCurrentContext"); + _NSGL_PRIVATE_DEF_SEL(clearCurrentContext, + "clearCurrentContext"); _NSGL_PRIVATE_DEF_SEL(currentContext, "currentContext"); + _NSGL_PRIVATE_DEF_SEL(setFullScreen, + "setFullScreen"); + _NSGL_PRIVATE_DEF_SEL(clearFullScreen, + "clearFullScreen"); + _NSGL_PRIVATE_DEF_SEL(setValues_forParameter_, + "setValues:forParameter:"); + _NSGL_PRIVATE_DEF_SEL(getValues_forParameter_, + "getValues:forParameter:"); + _NSGL_PRIVATE_DEF_SEL(currentVirtualScreen, + "currentVirtualScreen"); + _NSGL_PRIVATE_DEF_SEL(CGLContextObj, + "CGLContextObj"); } // Class } // Private } // NSGL diff --git a/Sources/Apple/include/OpenGL/OpenGL.hpp b/Sources/Apple/include/OpenGL/OpenGL.hpp index b525ab4c..3b17a5e1 100644 --- a/Sources/Apple/include/OpenGL/OpenGL.hpp +++ b/Sources/Apple/include/OpenGL/OpenGL.hpp @@ -1,22 +1,32 @@ -//------------------------------------------------------------------------------------------------------------------------------------------------------------- -// -// OpenGL/OpenGL.hpp -// -// Copyright 2020-2023 Apple Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//------------------------------------------------------------------------------------------------------------------------------------------------------------- +/* ---------------------------------------------------------------- + * :: : M E T A V E R S E : :: + * ---------------------------------------------------------------- + * This software is Licensed under the terms of the Apache License, + * version 2.0 (the "Apache License") with the following additional + * modification; you may not use this file except within compliance + * of the Apache License and the following modification made to it. + * Section 6. Trademarks. is deleted and replaced with: + * + * Trademarks. This License does not grant permission to use any of + * its trade names, trademarks, service marks, or the product names + * of this Licensor or its affiliates, except as required to comply + * with Section 4(c.) of this License, and to reproduce the content + * of the NOTICE file. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND without even an + * implied warranty of MERCHANTABILITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the Apache License for more details. + * + * You should have received a copy for this software license of the + * Apache License along with this program; or, if not, please write + * to the Free Software Foundation Inc., with the following address + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright (C) 2024 Wabi Foundation. All Rights Reserved. + * ---------------------------------------------------------------- + * . x x x . o o o . x x x . : : : . o x o . : : : . + * ---------------------------------------------------------------- */ #pragma once @@ -24,6 +34,7 @@ #include "NSGLDefines.hpp" #include "NSGLPrivate.hpp" +#include "NSGLPixelFormat.hpp" #include "NSGLContext.hpp" //-------------------------------------------------------------------------------------------------------------------------------------------------------------