Questions tagged [nsopenglview]

NSOpenGLView is an NSView subclass in the Apple Appkit framework. It provides an easy way to create an OpenGL context and embed it inside a Cocoa application.

Apple Documentation:

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSOpenGLView_Class/Reference/Reference.html

82 questions
2
votes
0 answers

NSOpenGLView: drawing from different thread, glitches / flickers when live resizing

I'm new to macOS development. Currently I'm implementing a NSOpenGLView with a third-party library. The update function is a callback from the library, which will be called when a new frame arrives. Since it's expected to return immediately, the…
00007chl
  • 91
  • 1
  • 6
2
votes
1 answer

NSOpenGLView with wantsLayer is slow on secondary display?

I am trying to use a layer-backed NSOpenGLView (wantsLayer = YES) and have noticed a performance issue when running the application on a secondary display. The issue is easiest reproduced with the GLEssentials example and adding self.wantsLayer=YES…
2
votes
1 answer

Problem exporting NSOpenGLView pixel data to some image file formats using ImageKit & CGImageDestination

Summary: exporting pixel data from NSOpenGLView to some file formats gives incorrect colours I am developing an application to visualise some experimental data. One of its functions is to render the data in an NSOpenGLView subclass, and allow the…
walkytalky
  • 9,453
  • 2
  • 36
  • 44
2
votes
1 answer

nsopenglview image zoom, scale to fit image in view

totally new to openGL. I have this code, which displays my image using OpenGl. #import "ImageView.h" #import #import @interface ImageView () @property (nonatomic, strong) CIContext *context; @property (nonatomic,…
spacecash21
  • 1,331
  • 1
  • 19
  • 41
2
votes
1 answer

NSOpenglView appears in front of NSView after deminimize window

I have a NSView displayed over a NSOpenGLView. I am using the 'setWantsLayer:YES' to force the NSView to appear over the opengl context. But when I minimize the window and deminimize it again, the NSView is no more over the NSOpenGLView. Is there a…
goe
  • 2,272
  • 1
  • 19
  • 34
2
votes
1 answer

Creating NSOpenGLView inside an NSDocument (OS X)

I am creating a music-eduaction app that reads in musical scores - not audio files - and will need to present an animated graphical screen. I created a document-based app to make file access easy, and I have it now reading and parsing the files, and…
2
votes
0 answers

Not visible NSOpenGLView slows down the whole system

I'm making a Mac OS X (10.8.3) OpenGL application using a NSOpenGLView and the CVDisplayLink to manage the calls to the render method. The application works fine but when the window gets covered or is in other space (basically when is not visible…
2
votes
1 answer

NSOpenGLView in NSScrollView?

I have zoom method for my NSOpenGLView. If image is zoomed in, NSOpenGLView frame size, view port and etc. is being increased. Same thing is happening if NSOpenGLView is being zoomed out (the frame size, view port and etc. is being decreased). So I…
hockeyman
  • 1,141
  • 6
  • 27
  • 57
2
votes
1 answer

GLSL example not working on mac

I am trying to create a GLSL example on Mac. I am trying to set up one color attribute per vertex. However, when the program runs, I just get a purple screen (the purple comes from glClearColor). I post the relevant code…
xBACP
  • 531
  • 1
  • 3
  • 17
1
vote
1 answer

Cocoa OpengGL: draw texture and round corners

If I use a standard NSWindow to host a NSOpenGLView which extends for all the window frame, the two bottom corners of the window are automatically rounded. When swithcing to NSBorderlessWindowMask I have to handle corner rounding myself. I have…
Andrea3000
  • 1,018
  • 1
  • 11
  • 26
1
vote
1 answer

OpenGL depth test problem

I've got a problem with OpenGL on mac, and I think the problem is the Depth test. So, to my problem: Rather than explaining, I made two screenshots: My scene from far:…
Ivorius
  • 160
  • 1
  • 8
1
vote
1 answer

NSOpenGLView drops its NSOpenGLContext on macOS 10.9

The NSOpenGLView class has a read/write property openGLContext, and as I read the documentation, the getter should never return nil: If the receiver has no associated context object, a new NSOpenGLContext object is created. The new object is…
JWWalker
  • 22,385
  • 6
  • 55
  • 76
1
vote
0 answers

NSOpenGLView subclass does not render on Mojave

I've encountered a very odd error when compiling with Xcode 10 against Mojave frameworks. It turns out that the OpenGL the stops showing. It appears that it's actually somewhere there (the backing layer overlays it?) as visible when rapidly updating…
Nuoji
  • 3,438
  • 2
  • 21
  • 35
1
vote
0 answers

NSOpenGLView subclass crash in _enableNeedsDisplayInRectNotifications

Updated: the crash doesn't occur on Sierra 10.12.6. But it does occur every time on my High Sierra 10.13.4 machie. So it seems like an AppKit issue introduced sometime in High Sierra. Logged a bug with Apple. I have created a minimal example…
TheNextman
  • 12,428
  • 2
  • 36
  • 75
1
vote
0 answers

Frame rate of NSOpenGLView

I have an NSOpenGLView displaying a SceneKit scene. When using an SCNView, I could simply call showStatistics to have it display statistics such as FPS. With NSOpenGLView, is there an easy way to measure and display FPS without using the OpenGL…
Oskar
  • 3,625
  • 2
  • 29
  • 37