Create and manage OpenGL rendering contexts for use in macOS, and perform operations on drawable objects.

OpenGL Documentation

Posts under OpenGL tag

12 Posts
Sort by:
Post not yet marked as solved
0 Replies
149 Views
Sorry for my rudimentary question. Environment: ・Xcode 15.3 ・C++ ・Freeglut 3.4.0 ・XQuartz 2.8.6_beta2 (already started) Current status: The following problems occurred at the time of upgrading from Xcode 14.2 to Xcode 15.3. Despite setting DISPLAY appropriately in the user environment variable, an error message " failed to open display '' " is thrown when RUN with Xcode. However, if I run the binary built with Xcode directly in the terminal, it works fine. Question: Why is the DISPLAY environment variable not being passed to Xcode internals properly when RUN in Xcode?
Posted Last updated
.
Post not yet marked as solved
0 Replies
157 Views
OS: Sonoma 14.2.1 (23C71), I am porting a linux code (that uses C++, QT) to mac OS. after compiling the code on mac, I get segmentation error due to libGL.dylib. My question is how to avoid the segmentation error. debug messages when I run it using lldb: 2024-03-21 13:13:17.957964+0530 EdgeMarker[10094:150997] SecTaskCopyDebugDescription: EdgeMarker[10094]/0#-1 LF=0 2024-03-21 13:13:18.962117+0530 EdgeMarker[10094:150997] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=10094 2024-03-21 13:13:18.962246+0530 EdgeMarker[10094:150997] SecTaskCopyDebugDescription: EdgeMarker[10094]/0#-1 LF=0 Process 10094 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xa80) frame #0: 0x00007ffa1c1295a4 libGL.dylib`glViewport + 22 libGL.dylib`glViewport: -> 0x7ffa1c1295a4 <+22>: movq 0xa80(%rax), %r9 0x7ffa1c1295ab <+29>: movq (%rax), %rdi 0x7ffa1c1295ae <+32>: popq %rbp 0x7ffa1c1295af <+33>: jmpq *%r9 Target 0: (EdgeMarker) stopped. Backtrace snippet: * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xa80) * frame #0: 0x00007ffa1c1295a4 libGL.dylib`glViewport + 22 frame #1: 0x000000010000c427 EdgeMarker`MyGLCanvas::initializeGL(this=0x00007f8e4f857710) at MyGLCanvas.cpp:33:2 The error occurs when initializing an opengl window: void MyGLCanvas::initializeGL() { m_width = this->frameGeometry().width(); m_height = this->frameGeometry().height(); m_initialized = true; m_Eye[0] = 0.0f; m_Eye[1] = 0.0f; m_Eye[2] = -2.0f; //Actual code m_PerspectiveAngleDegrees = 45.0f; m_NearPlane = 0.01f; m_FarPlaneOffset = 100.0f; glViewport(0, 0, (GLint)m_width, (GLint)m_height); Before calling MyGLcanvas::initializeGL() there is a call to setFocus() function. SetFocus is a function used in GUI programming to give focus to a specific window or control within a window. My second question : Is setFocus valid is mac OS or is there an equivalent?
Posted
by shomedas.
Last updated
.
Post not yet marked as solved
0 Replies
270 Views
I init openGL now i wanna set glPixelZoom(pixelSizeX, -pixelSizeY); to dispaly a image with width and height to the entire window for this I do: rect:= window.frame; WindowBackingRect := window.convertRectToBacking(rect); pixelSizeX := WindowBackingRect.size.width / width / NSScreen.mainScreen.backingScaleFactor; pixelSizeY := WindowBackingRect.size.height / height / NSScreen.mainScreen.backingScaleFactor; under High Sierra 10.13.6 on an intel mac from 2011 NSScreen.mainScreen.backingScaleFactor return 1 because there is no retina. under Sonoma 14.3 an an intel mac from 2020 NSScreen.mainScreen.backingScaleFactor return 2 because of retina. this works correct. under Venture 13.6 on an aarch64 mac from 2020 NSScreen.mainScreen.backingScaleFactor returns 2 BUT the image is only half so big as it should be. (if i let the scale factor away on the new intel mac, the image is twice big as it should be. On the new AArch64 mac it is correct.) what to do?
Posted
by Key-Real.
Last updated
.
Post not yet marked as solved
1 Replies
275 Views
Hi, I have a MacBook Pro with an Intel Iris Plus Graphics 640, which gives maximum 4.1 OpenGL context. Thus, I would like to use Mesa as an alternative for getting higher contexes e.g. 4.5 or 4.6. I don’t care about performance in this phase. I have built Mesa with LLVM (llvm-config… etc…) but even by placing the built libGL.dylib in the same folder with executable or setting DYLD_LIBRARY_PATH or DYLD_INSERT_LIBRARIES, I am not able to get the Mesa renderer. Does Apple support this overriding of libGL with a custom one? Any help/guidance would be really appreciated. Thanks
Posted Last updated
.
Post not yet marked as solved
15 Replies
4.6k Views
Hello everyone! After some time to think about I proceed with graphics api, I figured opengl will be my first since I'm completely new to graphics programming. As in my last post you may find, I was speaking on moltenvk and might just use metal instead, along with the demos I found using metal. So for now, and I know this is said MANY TIMES, apple deprecated opengl but wish to use it because I'm new to graphics programming and want to develop an app(a rendering engine really) for the iPhone 14 Pro Max and macOS Ventura 13.2(I think this is the latest). So what do you guys think? Can I still use opengl es on the 14 max, along with opengl 4+ on latest macOS even though is deprecated?
Posted Last updated
.
Post not yet marked as solved
0 Replies
569 Views
I have created a react-three-fiber web-app which uses webgl canvas. When the canvas is forced to rerender due to external change, a new canvas context is being created and the previous one is not lost. This leads to safari refresh and crash as the no of active canvas contexts goes beyond the max limit alongwith the memory. This issue is specific to Safari only and (chrome only on iOS). Does Safari have a different garbage collection mechanism and not include webgl context clear automatically? If it doesnt, is there an API to invoke the same?
Posted Last updated
.
Post not yet marked as solved
5 Replies
8.0k Views
OpenGL is deprecated for new development, and Apple's docs no longer even acknowledge the existence of OpenCL. However, many legacy MacOS apps contain modules written in those languages, and they have been building with Xcode and running on Intel Macs just fine. I need to know if they are also tacitly supported on M1 Macs, and if so, whether there is a known kill date.
Posted Last updated
.
Post not yet marked as solved
0 Replies
504 Views
We use an in-house OpenGL app to provide the out-the-window visuals for our flight simulators. The app is cross platform, but until now the Mac version was only used by desktop researchers, not in our primary sim labs. Now we are attempting to replace some Windows boxes with Apple Studios. We can easily maintain high framerate, and visual quality is excellent, but we are finding the graphics have a bit of stutter during high yaw rates (which quickly forces new assets into view). I've eliminating unnecessary processes, tried raising my priority via pthread_set_qos_class_self_np() or thread_policy_set(), and reducing textures quality, all of which helped, but it didn't eliminate the problem. For background, we are using framebuffers, we have a very large texture database (90 GB), and the render code runs in the main thread (not a secondary thread). What might I be missing?
Posted
by Jeff Ray.
Last updated
.
Post not yet marked as solved
0 Replies
577 Views
I am looking for clarification as to whether the App Store will accept apps with OpenGL as the rendering framework. We just took over maintenance of an app whose UI layer is written in OpenGL. We are tasked with recompiling it for iOS16 and then resubmitting to the App Store. The cost of rewriting the UI layer in Metal will be very high.
Posted
by mh175.
Last updated
.
Post not yet marked as solved
0 Replies
546 Views
while i'm using opengl interface 'glReadPixels', i got the error: failed assertion temp_buffer != nil at line 507 in readFramebufferData. Temp image allocation failed. w=720, h =1280, rowbytes=2880, pixelbytes=4 glrFmt=0x024 mtex=0x283d16100 then my app crashed. backtrace as below thread #78, queue = 'com.apple.root.user-initiated-qos', stop reason = signal SIGABRT frame #0: 0x00000001f843e158 libsystem_kernel.dylib__pthread_kill + 8 frame #1: 0x00000002078845f8 libsystem_pthread.dylibpthread_kill + 208 frame #2: 0x00000001c4a344b8 libsystem_c.dylibabort + 124 frame #3: 0x00000001b89168b0 MetalMTLReleaseAssertionFailure + 184 frame #4: 0x000000023fd7e87c AppleMetalGLRenderergldReadFramebufferData + 1372 frame #5: 0x000000022cbe54ec GLEngineglReadPixels_Exec + 1108 i've no idea what happened
Posted
by pangdx.
Last updated
.
Post not yet marked as solved
2 Replies
1.3k Views
We recently observed antialiasing issues on iOS devices since this week. Works fine on desktop and Android. Refer to screenshots below. Is there a specific flag we need to enable/disable to fix this? we are using babylonjs as 3d renderer it work on webgl
Posted
by Vishal_23.
Last updated
.