Hello again,
It has been some time I was playing around with hap blocks. The< all work fine with quicktime, but since there is no support, I went for a DirectShow solution. Openframeworks did it and it is working and since the implementation is pretty straight forward, I went and implemented a cinderHap player. The source is almost the same. After I almost finished with it, a wild error appeared.
I can’t use “glPushClientAttrib”, “GL_CLIENT_PIXEL_STORE_BIT” or “glPopClientAttrib”. They are in glew.h, but including it caused a few headaches. Can it be done? How?
Here is the snippet from openframeworks. Cinder implementation is almost the same.
if (!ofIsGLProgrammableRenderer())
{
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glEnable(GL_TEXTURE_2D);
}
glBindTexture(GL_TEXTURE_2D, texData.textureID);
GLint dataLength = 0;
if (textureFormat == HapTextureFormat_RGB_DXT1){
dataLength = width * height / 2;
}
else {
//dataLength = player->getBufferSize();
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &dataLength);
}
glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, texData.glInternalFormat, dataLength, pix.getPixels());
GLenum err = glGetError();
if (err != GL_NO_ERROR){
// printf("error %s\n", gluErrorString(err));
int error = 1;
}
if (!ofIsGLProgrammableRenderer())
{
glPopClientAttrib();
glDisable(GL_TEXTURE_2D);
}
I tried creating / updating current texture vid Surface (data gets fulled via STDMETHODIMP SampleCB(long Time, IMediaSample *pSample). The result is not ok:
Comparing both implementations side by side there were no differences whatsoever. Except those three defines so the solution probably lies in including glew.h without redefinitions, missing implementations, right? Or is there an alternative way to fix this.
I’ve used the samples from here.
Thank you