1

I'm trying to get a texture id from metal surface.

I have two problems 1. That function is not defined

GLint glTextureID = CGLTexImageIOSurface2D(self.mEAGLContext, GL_TEXTURE_2D, GL_RGBA , textureWidth, textureHeight, GL_RGBA , GL_UNSIGNED_BYTE, ioSurface, 0);

I tried to include it #import OpenGL/CGLIOSurface.h but xcode doesn't recognize it, it's not there.

Are there any other methods to obtain a texture id from an iosurface in ios, metal ?

andre
  • 731
  • 2
  • 13
  • 27
  • The title of this question says it is related Metal, but the question seems to have something to do with OpenGL and OpenCL. What are you asking about? – MoDJ Dec 28 '18 at 06:10

1 Answers1

0

In my software, the following line pulls in the requested function:

#include <OpenGL/CGLIOSurface.h>

This header file is at the following location in my xcode installation:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/CGLIOSurface.h

Note that I am using the MacOS SDK. Perhaps iOS doesn't support GL/IOSurface sharing?

Richard42
  • 11
  • 2