Greetings. I have programmed off-and-on in OpenGL since 2009. I consider myself a newbie, but I do have a functional simple graphics engine for 3D geometry. It works well with stand-alone textures and colors. I’m moving on to non-stand-alone textures and am running into a problem.
I have a bitmap that’s created and rendered in memory using existing non-OpenGL algorithms. It changes per user interaction 5 to 30 fps. Some of the changes are minor (an area near the top or corner is updated), and other itmes it re-renders the entire image. The texture is about 1700 x 900 with 24-bit color depth.
How should I be updating the texture in OpenGL so that it updates with my live bitmap changes each time the raw bits change? I have been trying this:
glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); gluBuild2DMipmaps(GL_TEXTURE_2D, ...);
at each iteration, where I also delete the old texture. This process works, of course, but it is very slow. The updates lag behind and I only get about 1 fps.
Is there some way to dynamically update the texture already loaded (by obtaining a pointer to its bits and BitBlt()-ing the new image data over the top)? Can I tell OpenGL to use the bits from my existing buffer without it building 2D mipmaps? Is there something else I should be doing entirely?
I’ve also observed that no matter how much I scale in or out, the image is always somewhat blurry compared to the original bitmap data. Is there some way to obtain a sharper bitmap image with gluBuild2DMipmaps? I look at tools like Blender, for example, and I see how clear their text is when zooming in and out. I’d like to achieve something like that if possible (he said laughingly).
Thank you in advance for any assistance.
Rick C. Hodgin