black borderof 2 texture when scaling

Started by
0 comments, last by Geometrian 14 years, 2 months ago
Hello i am using openg for 2d only textures.l my texture are png files. I noticed at some scale there i a small black line located at the bottom border of the png (it seems to blink). it is not a big problem but is a bit ugly. with no scale no issue. Most of the scales are ok, only some value are messing opengl. here is my code for the texture. creation: glBindTexture(GL_TEXTURE_2D, work->textureID); 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_T,GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, work->w, work->h , 0, GL_RGBA, GL_UNSIGNED_BYTE, work->data); and then during blitting there is a translate(), a scale() if new dim are not the same than original png dim, and a simple begin() end() with vertex stuff.
Advertisement
Try putting the clamp and filter statements after glTexImage2D(...).

[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]

This topic is closed to new replies.

Advertisement