On Feb 2, 3:47 pm, "Wolfgang.Draxinger" <Wolfgang.Draxin...@physik.uni-
muenchen.de> wrote:
> glTexSubImage replaces only a specific part of the existing texture
> image. Of course the specific part may as well be the whole image. The
> advantage of using glTexSubImage over glTexImage is, that it writes
> into an existing, already initialized buffer.
Thanks for the explanation. Also, seeing your code changes makes it
even more clearer.
> I did a few changes, mostly about how the texture object is managed.
> It's not necessary to delete the texture if you want to create new one.
> Just reuse the existing ID.
Thanks a lot! I also saw that I don't need to update the texture on
each draw (for instance, when I zoom & pan, the texture does not need
to be reloaded). The performance wen't up by a few orders of magnitute
just disabling this. (for instance, I get up to 5 udpates per second,
but when you pan or zoom, you get 20 or even more redraws per second
so I wasted a lot of the CPU cycles updating the texture).
I still need to figure out a nice way to create tiles. Is it perhaps
possible to map multilpe textures to the same rectangle? Width
different UV mappings?
Also, currently, my plane is 1 wide and 1/ratio tall. I guess it could
be 100 wide and 100/ratio tall having adjusted the viewport
accordingly? Having tiles each 1 wide would help me scale it more
accurately - I think I might otherwise have problems with float
accuracy (i.e: tiling 2500 px wide image to 5 tiles each 1 wide and
applying 4x512 texture and 1x 512px texure UV mapped to 452/512.)
Thanks,
Miha.