I am currently facing an issue running my OpenGL App.
First i startet to use the GLUT functions to create my rendering Context (Window).
Inside the App I initialized textures using glGenTexture and glTexImage2D and so on.
Now I switched to NSOpenGLView and NSOpenGLPixelFormat.
I copied the whole Code that worked fine for me in my GLUT App but I am getting a white window.
When I take out my rendering and just clear the Color_Buffer to yellow I get a yellow window (as expected).
Even if I only draw on the right half of the screen it comes up white on the whole screen.
Now to my implementation
Inside the NSOpenglView drawrect function i call:
[[self openGLContext] clearDrawable]; [[self openGLContext] setView:self]; [[self openGLContext] makeCurrentContext]; NSRect backingBounds = [self convertRectToBacking:[self bounds]]; GLsizei backingPixelWidth = (GLsizei)(backingBounds.size.width), backingPixelHeight = (GLsizei)(backingBounds.size.height); glViewport(0, 0, backingPixelWidth, backingPixelHeight); glEnable(GL_TEXTURE_2D); glClearColor(1, 1, 0, 0); glClear(GL_COLOR_BUFFER_BIT); [interface draw]; [[self openGLContext] flushBuffer]; [NSOpenGLContext clearCurrentContext];
I create a normal window with an OpenGLContext.
Do I have to initiate my OpenGL Stuff anywhere special? Stuff like glEnable(GL_Texture_2D) ?
I hope someone of you already had this issue.
I appreciate any help