Skip to content

Commit

Permalink
Add new, more capable, CGL offscreen support (openscad#4734)
Browse files Browse the repository at this point in the history
  • Loading branch information
kintel authored Sep 6, 2023
1 parent 05b9621 commit bc167f5
Show file tree
Hide file tree
Showing 12 changed files with 2,107 additions and 12 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ target_include_directories(OpenSCAD PRIVATE
"src"
"src/core"
"src/core/customizer"
"src/ext"
"src/ext/json"
"src/ext/lexertl/include"
"src/ext/libtess2/Include"
Expand Down Expand Up @@ -572,15 +573,17 @@ else()
endif()
if(APPLE)
target_compile_definitions(OpenSCAD PRIVATE OPENSCAD_OS="Mac OS X")
message(STATUS "Offscreen OpenGL Context - using Apple NSOpenGL")
message(STATUS "Offscreen OpenGL Context - using Apple CGL/NSOpenGL")
set(PLATFORM_SOURCES src/platform/PlatformUtils-mac.mm src/io/imageutils-macosx.cc src/platform/CocoaUtils.mm)
if(NOT HEADLESS)
set(PLATFORM_SOURCES ${PLATFORM_SOURCES} src/gui/AppleEvents.cc)
endif()
if(NOT NULLGL)
target_compile_definitions(OpenSCAD PRIVATE GL_SILENCE_DEPRECATION)
set(OFFSCREEN_METHOD "Apple NSOpenGL")
set(PLATFORM_SOURCES ${PLATFORM_SOURCES} src/glview/offscreen-old/OffscreenContextNSOpenGL.mm)
set(OFFSCREEN_METHOD "Apple CGL/NSOpenGL")
set(PLATFORM_SOURCES ${PLATFORM_SOURCES}
src/glview/offscreen-old/OffscreenContextNSOpenGL.mm
src/glview/OffscreenContextCGL.cc)
endif()
find_library(COCOA_LIBRARY Cocoa)
target_link_libraries(OpenSCAD PRIVATE ${COCOA_LIBRARY})
Expand Down
2 changes: 1 addition & 1 deletion src/ext/glad/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Generated by https://github.com/Dav1dde/glad:

python -m glad --merge --api='gl:compatibility=4.6,gles2=3.2,egl=1.5,wgl=1.0' \
--extensions='GL_ARB_framebuffer_object,GL_EXT_framebuffer_object,GL_EXT_packed_depth_stencil,GL_ARB_occlusion_query,GL_NV_occlusion_query,GL_ARB_texture_cube_map,GL_ARB_texture_env_dot3,GL_EXT_depth_bounds_test,GL_ARB_occlusion_query2' \
--extensions='GL_ARB_framebuffer_object,GL_EXT_framebuffer_object,GL_EXT_packed_depth_stencil,GL_ARB_occlusion_query,GL_NV_occlusion_query,GL_ARB_texture_cube_map,GL_ARB_texture_env_dot3,GL_EXT_depth_bounds_test,GL_ARB_occlusion_query2,WGL_ARB_create_context,WGL_ARB_create_context_profile' \
--out-path=out c --alias --header-only --loader
2 changes: 1 addition & 1 deletion src/ext/glad/egl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Loader generated by glad 2.0.4 on Mon Jul 3 10:54:16 2023
* Loader generated by glad 2.0.4 on Wed Jul 5 09:31:25 2023
*
* SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0
*
Expand Down
2 changes: 1 addition & 1 deletion src/ext/glad/gl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Loader generated by glad 2.0.4 on Mon Jul 3 10:54:16 2023
* Loader generated by glad 2.0.4 on Wed Jul 5 09:31:25 2023
*
* SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0
*
Expand Down
Loading

0 comments on commit bc167f5

Please sign in to comment.