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
11
votes
7 answers

NSTextField over NSOpenGLView

I have made a window with an NSOpenGLView that I am rendering openGL content into. I want to add some buttons and text fields to the view: I can add NSTextFields and NSButtons using interface builder (or code) but they do not appear. NSOpenGLView is…
Chris Becke
  • 34,244
  • 12
  • 79
  • 148
11
votes
3 answers

Assist me to understand OpenGL glGenBuffers()

Here is the deal: If I leave the code with glGenBuffers(1, vertexBuffers), the code compiles and works. But, I thought that it should be 2 since vertexBuffers is of size two. Am I missing something? Code below: -(void)drawRect:(NSRect)dirtyRect { …
xBACP
  • 531
  • 1
  • 3
  • 17
9
votes
1 answer

Layer-backed OpenGLView redraws only if window is resized

I have a window with a main view of type NSView and a subview which is a subclass of NSOpenGLView whose name is CustomOpenGLView. The subclass of NSOpenGLView is obtained through a Custom View in Interface Builder and by setting its class to…
Andrea3000
  • 1,018
  • 1
  • 11
  • 26
7
votes
1 answer

OpenGL 3.2 w/ NSOpenGLView

How would I create a core profile in a custom implementation of NSOpenGLView? Which method should I override and what code should I put there? So far I have this code: // Header File #import @interface TCUOpenGLView :…
Oskar
  • 1,321
  • 9
  • 19
6
votes
3 answers

OpenGL not rendering on macOS Mojave

If you create an NSView and a custom NSOpenGLContext on macOS Mojave, the window is not being rendered to until it is being resized. But everything works if you use NSOpenGLView instead. I see lots of hacks that resize the window programmatically…
Elviss Strazdins
  • 1,404
  • 14
  • 30
5
votes
2 answers

Creating an OpenGL View without Interface Builder

So im trying to create an openGL view (in my window). Im making a Cocoa app. Ive managed to create one through Interface Builder, but for educational purposes i want to go on and make one without it. Just on papers. And here is the point im telling…
apoiat
  • 576
  • 2
  • 5
  • 16
5
votes
1 answer

Initializing NSOpenGLPixelFormat in Swift

Apparently I'm the only one to attempt this, as none of my Google searches turned up anything helpful. Assume I'm initializing an attribute array like this: let glPFAttributes = [ NSOpenGLPFAAccelerated, NSOpenGLPFADoubleBuffer, …
Peter W.
  • 2,323
  • 4
  • 22
  • 42
5
votes
1 answer

OpenGL / OpenCL Interop Performance in glBindTexture(), glBegin()

I'm working on an OS X app in a multi-GPU setup (Mac Pro late-2013) that uses OpenCL (on the secondary GPU) to generate a texture which is later drawn to the screen with OpenGL (on the primary GPU). The app is CPU-bound due to calls to…
senojsitruc
  • 370
  • 2
  • 11
4
votes
1 answer

What exactly is shared between two NSOpenGLContexts?

I'm trying to create an NSOpenGLContext, initialize my rendering engine, then create new NSOpenGLContexts using the share parameter from the first context. This doesn't work, and before I go on, what exactly is shared between a context? The…
Ryan Nichols
  • 298
  • 1
  • 8
4
votes
3 answers

NSOpenGLView with OpenGL 3.2 Core

I apologies in advance if this question will be trivial or a nonsense...this is one of the first app that I'm developing. (Unfortunatley) I'm not a developer. I have a NSWindow which contains a custom View which is a subclass of NSOpenGLView. Since…
Andrea3000
  • 1,018
  • 1
  • 11
  • 26
4
votes
1 answer

Unable to retrieve an error message from glGetShaderInfoLog

I am attempting to build a simple OpenGL 3.2 program which consists of a single fragment shader, but I do not seem to be able to actually compile the shader. I'm fairly sure that my shader syntax is correct, but even if it's not, I am unable to…
Steve Rukuts
  • 9,167
  • 3
  • 50
  • 72
3
votes
1 answer

Draw from a separate thread with NSOpenGLLayer

I'm working on an app which needs to draw with OpengGL at a refresh rate at least equal to the refresh rate of the monitor. And I need to perform the drawing in a separate thread so that drawing is never locked by intense UI actions. Actually I'm…
Andrea3000
  • 1,018
  • 1
  • 11
  • 26
3
votes
1 answer

OpenGL on multiple displays

I'm using multiple NSOpenGLViews. All are set as the contentView of an NSWindow that is displayed on it's own screen. All NSOpenGLViews call a method -(void)render:(NSOpenGLView *)sender; declared in the class Scene. This class draws all the…
Fatso
  • 1,278
  • 16
  • 46
3
votes
2 answers

Cocoa / CoreGraphics / Quartz - borderless Quicktime X like window with rounded edges

I am developing a document based application for Mac OS X. It's a kind of media player, but instead of playing audio or video files it is supposed to open text-files containing meta-data specifying OpenGL animations. I would like to mimic Apples…
cargath
  • 832
  • 8
  • 18
3
votes
1 answer

-setWantsLayer causes distortion to NSOpenGLView

This is what I want to do with my NSOpenGLView. Currently the NSOpenGLView covers the entire area of the window and I would like to add buttons, nsviews, and images on top of the NSOpenGLView. I looked through the web and I discovered that…
lab12
  • 6,400
  • 21
  • 68
  • 106
1
2 3 4 5 6