- Home /
Semantic Issue Use of undeclared identifier 'GL_BGRA_EXT'
Help!!
im such a newbie to getting Unity to talk with Xcode. Ive signed up for a developers program and done all the necessary steps (i think) in this tutorial http://docs.unity3d.com/Manual/iphone-accountsetup.html however unity doesn't seem to pass on the build to xcode properly, i always have to reopen the project manually in xcode and secondly im getting the following error in xcode:
Semantic Issue Use of undeclared identifier 'GL_BGRA_EXT'
#include "CMVideoSampling.h"
#include "CVTextureCache.h"
#include "GLESHelper.h"
#include <OpenGLES/ES2/gl.h>
#include <AVFoundation/AVFoundation.h>
void CMVideoSampling_Initialize(CMVideoSampling* sampling)
{
::memset(sampling, 0x00, sizeof(CMVideoSampling));
if(CanUseCVTextureCache())
sampling->cvTextureCache = CreateCVTextureCache();
else
GLES_CHK(glGenTextures(2, (GLuint*)sampling->glTex));
}
void CMVideoSampling_Uninitialize(CMVideoSampling* sampling)
{
if(sampling->cvTextureCacheTexture)
{
CFRelease(sampling->cvTextureCacheTexture);
sampling->cvTextureCacheTexture = 0;
}
if(sampling->cvTextureCache)
{
CFRelease(sampling->cvTextureCache);
sampling->cvTextureCache = 0;
}
if(sampling->glTex[0])
{
GLES_CHK(glDeleteTextures(2, (GLuint*)sampling->glTex));
sampling->glTex[0] = sampling->glTex[1] = 0;
}
}
int CMVideoSampling_SampleBuffer(CMVideoSampling* sampling, void* buffer, int w, int h)
{
int retTex = 0;
CVImageBufferRef cvImageBuffer = CMSampleBufferGetImageBuffer((CMSampleBufferRef)buffer);
if(CanUseCVTextureCache())
{
if(sampling->cvTextureCacheTexture)
{
CFRelease(sampling->cvTextureCacheTexture);
FlushCVTextureCache(sampling->cvTextureCache);
}
sampling->cvTextureCacheTexture = CreateTextureFromCVTextureCache(sampling->cvTextureCache, cvImageBuffer, w, h, GL_BGRA_EXT, GL_RGBA, GL_UNSIGNED_BYTE);
if(sampling->cvTextureCacheTexture)
retTex = GetGLTextureFromCVTextureCache(sampling->cvTextureCacheTexture);
}
else
{
retTex = sampling->glTex[1];
CVPixelBufferLockBaseAddress(cvImageBuffer,0);
void* texData = CVPixelBufferGetBaseAddress(cvImageBuffer);
// TODO: provide unity interface?
GLES_CHK(glBindTexture(GL_TEXTURE_2D, retTex));
GLES_CHK(glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, texData));
CVPixelBufferUnlockBaseAddress(cvImageBuffer,0);
// swap read and draw textures
{
int __temp = sampling->glTex[0];
sampling->glTex[0] = sampling->glTex[1];
sampling->glTex[1] = __temp;
}
}
GLES_CHK(glBindTexture(GL_TEXTURE_2D, retTex));
GLES_CHK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
GLES_CHK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
GLES_CHK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
GLES_CHK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
GLES_CHK(glBindTexture(GL_TEXTURE_2D, 0));
return retTex;
}
int CMVideoSampling_LastSampledTexture(CMVideoSampling* sampling)
{
return sampling->cvTextureCacheTexture ? GetGLTextureFromCVTextureCache(sampling->cvTextureCacheTexture) : sampling->glTex[0];
}
Any ideas? ive started from scratch with a basic scene with just a cube in it to eliminate any other issues. please help
cheers
Hi!
We've got the exact same error. For our case, I guess that's because we are still using an old version of Unity (4.2) and we are building with a Xcode 6 / iOS 8 SD$$anonymous$$.
Those lines seem to be video related... since we don't have any video in our game, I took the freedom to edit the lines where the errors occurs. I simply replaced the GLBGRAEXT with GL_RGBA (there's only 2 occurrences). Just to pass the compilation :)
Then, to avoid to change those lines each time we build, I simply choose "Append" when the Unity Build process is asking what to do.
I'm searching for a proper fix to this. But for now it looks like we have a workaround.
What version of Unity and Xcode / iOS SD$$anonymous$$ are you using?
Hey I got the same error after updating to Xcode6. I am also using Unity for my project and everything is alright when I use the old Xcode.
Answer by unimechanic · Sep 29, 2014 at 07:53 PM
Your question has been answered here:
http://forum.unity3d.com/threads/newbie-help-errors-with-basic-ios-export.270347/
Your answer
![](https://koobas.hobune.stream/wayback/20220613163725im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Xcode error dyld: symbol not found: _glbeginquery 0 Answers
Converting project from Unity 3.3 to 3.4 ERRORS 0 Answers
Problems when building using Xcode 0 Answers
A node in a childnode? 1 Answer
Unity to Xcode Problem 1 Answer