I have a C++ api which draws onto a bitmap.
the bitmap is converted to an array with pixel data in my DLL and transferred to Java using JNA.
all is fine thus far, and it is quite fast (<20ms).
now I load the image data into a jogl texture, this is really slow.
the first time i create the jogl texture like this;
img = new BufferedImage(wd, ht, BufferedImage.TYPE_INT_RGB);
texdata = TextureIO.newTextureData(img, false);
texdata.setBuffer(buffer_from_cpp);
tex = TextureIO.newTexture(texdata);
this takes ~400ms for an image sized 1400x1000.
after creation i update the texture periodically using;
texdata.setBuffer(buffer_from_cpp);
tex.updateImage(texdata);
this takes ~200ms for an image sized 1400x800.
i can understand the initial creation is slow, but i dislike the slow updating of the jogl texture while i have the data ready.
is there anything i’m doing wrong? are there ways to speedup this code?
alternatively, can i access/manipulate the jogl texture from the C++ DLL in order
to achieve more speed?
my system;
Pentium mobile 1600MHz
768MB Ram
Mobility radeon 9000
jogl debug info;
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: MOBILITY RADEON 9000 DDR x86/SSE2
GL_VERSION: 1.3.3967 WinXP Release