Reputation: 479
When I load a texture using slick-util and render it using lwjgl's opengl, it is highly distorted unless the length and width of the texture are both powers of 2. Why is this?
Upvotes: 0
Views: 191
Reputation: 162164
My guess would be, that your unpack alignment is set improperly. The default alignment is 4 bytes. And power of 2 sized images usually fullfill that requirement.
Try what happens if you add a call glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
right before calling glTexImage
or glTexSubImage
.
Upvotes: 1