Fabien R
unread,Jan 4, 2013, 3:49:21 AM1/4/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to andro...@googlegroups.com
On 02/01/2013 19:03, Mathieujofis wrote:
> Works:
>
> JNIEXPORT void JNICALL Java_blahblah_render(frame)
> {
> glGenTextures(1, &videoFrameTexture);
>
You should remove the above line from ther render loop...
> glBindTexture(GL_TEXTURE_2D, videoFrameTexture);
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
> glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 640, 480, 0, GL_RGB,
> GL_UNSIGNED_BYTE, NULL );
>
> glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 640, 480, GL_RGB,
> GL_UNSIGNED_BYTE, frame.ptr());
> }
>
>
Can you show the way you communicate with the shaders ?
> Does not work (with gl error 502 or 501):
>
> JNIEXPORT void JNICALL Java_blahblah_init()
> {
> glGenTextures(1, &videoFrameTexture);
> glBindTexture(GL_TEXTURE_2D, videoFrameTexture);
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
> glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 640, 480, 0, GL_RGB,
> GL_UNSIGNED_BYTE, NULL );
> }
>
> JNIEXPORT void JNICALL Java_blahblah_render(frame)
> {
> glBindTexture(GL_TEXTURE_2D, videoFrameTexture);
> glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 640, 480, GL_RGB,
> GL_UNSIGNED_BYTE, frame.ptr());
> }
>
>
Is it normal that you never unbind your textures ?
-
Fabien