#define GL_TEXTURE_EXTERNAL_OES 0x8D65
#endif
+/* GL_SAMPLER_EXTERNAL_OES */
+#ifndef GL_SAMPLER_EXTERNAL_OES
+#define GL_SAMPLER_EXTERNAL_OES 0x8D66
+#endif
#endif // __DALI_INTERNAL_GL_DEFINES_H__
// Create a color attachment.
if( texture->GetType() == TextureType::TEXTURE_2D )
{
- context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->GetId(), mipmapLevel );
+ if( !texture->IsNativeImage() )
+ {
+ context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->GetId(), mipmapLevel );
+ }
+ else
+ {
+ // If it's a native image we need to use GL_TEXTURE_EXTERNAL_OES as the texture target parameter
+ context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_EXTERNAL_OES, texture->GetId(), mipmapLevel );
+ }
}
else
{
return mType;
}
+ /**
+ * Check if the texture is a native image
+ * @return if the texture is a native image
+ */
+ bool IsNativeImage() const
+ {
+ return mNativeImage;
+ }
+
private:
/**
NativeImageInterfacePtr mNativeImage; ///< Pointer to native image
GLenum mInternalFormat; ///< The format of the pixel data
GLenum mPixelDataType; ///< The data type of the pixel data
- unsigned int mWidth; ///< Widht of the texture
+ unsigned int mWidth; ///< Width of the texture
unsigned int mHeight; ///< Height of the texture
bool mHasAlpha : 1; ///< Whether the format has an alpha channel
bool mIsCompressed : 1; ///< Whether the format is compressed
mGlAbstraction.GetActiveUniform( mProgramId, (GLuint)i, uniformMaxNameLength,
&nameLength, &number, &type, name );
- if( type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE ) /// Is there a native sampler type?
+ if( type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE || type == GL_SAMPLER_EXTERNAL_OES )
{
GLuint location = mGlAbstraction.GetUniformLocation( mProgramId, name );
samplerNames.push_back(name);