OpenGL: fix Mac crashing on startup
On Apple we use OpenGL 2.1 + an ARB extension for framebuffers. The glFramebufferTexture function is part of OpenGL 3.0 but not part of the ARB extension. This commit fills that gap. All other platforms are using GL 3.0+ already so it's not an issue there. All platforms (Mac too) will use GL 3.3+ soon so this workaround will be removed.
This commit is contained in:
@@ -143,7 +143,12 @@ bool GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slo
|
||||
else
|
||||
attachment = GL_COLOR_ATTACHMENT0 + slot;
|
||||
|
||||
#if defined(__APPLE__) && defined(WITH_GL_PROFILE_COMPAT)
|
||||
/* Mac workaround, remove after we switch to core profile */
|
||||
glFramebufferTextureEXT(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0);
|
||||
#else
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0);
|
||||
#endif
|
||||
|
||||
if (GPU_texture_depth(tex))
|
||||
fb->depthtex = tex;
|
||||
|
Reference in New Issue
Block a user