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

Posts under OpenGL tag

12 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Are OpenGL and OpenCL supported on Apple silicon?
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.
5
0
9.4k
Oct ’23
OpenGL on future iPhones and Macs?
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?
15
0
5.5k
Dec ’23
OpenGL stutter on Apple Silicon
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?
0
0
627
Aug ’23
Leaking WebGLRenderer when rerendering on iOS
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?
0
0
754
Nov ’23
Mesa with LLVM on MacOS
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
1
0
458
Jan ’24
OpenGL and NSScreen.mainScreen.backingScaleFactor
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?
0
0
398
Feb ’24
segmentation error caused by libGL.dylib`(glViewport)
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?
0
0
343
Mar ’24
freeglut throws error "failed to open display''
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?
0
0
393
Apr ’24
Deferred Rendering Supported?
Using Unreal Engine 5.4 for Apple Vision Pro. Creating a fully immersive VR Experience. When deploying a VR Application, can you use deferred rendering for the Apple Vision Pro? Or do you need to use forward shading, like for mobile devices? My goal would be to use deferred rendering, because of the much better shader options and quality. And I hope that the Apple Vision Pro with the integrated CPU and GPU could handle deferred rendering, that like a MacBook or a powerful Gaming PC, Workstation. I couldn't find any information on that. Have been mainly developing VR Applications for Quest, but would love to create apps for the Apple Vision Pro. But I would need to know if defered rendering will work when deploying VR Apps from the Unreal Engine to the Apple Vision Pro system. Thanks a lot for any more information on that topic, appreciate it! all the best, Bernhard
0
0
331
May ’24