If you are trying to draw a white rectangle, you need to either disable texturing or (preferably) use a white texture. Otherwise, your vertex color will be multiplied with the texture color, and you might end up with an unexpected result.
So it looks like this:
1 2 3 4 5 6 7 8 9 10 11
| Texture white = TextureLoader.getTexture(... "white.png" ...); Texture myImg = TextureLoader.getTexture(... "img.png" ...);
... in render ...
white.bind();
...
myImg.bind();
|
The problem here, obviously, is that it leads to an extra texture bind. The solution is to use sprite sheets,
which you should already be using, instead of a separate Texture for your white 2x2 rectangle.
I'd strongly recommend you to
avoid using SlickUtil -- it isn't well maintained, it's buggy, and it forces you into bad practices (i.e. immediate mode). Instead you should write your own texture loading code, through which you will learn a lot more than if you just continue to use SlickUtil.
Check out my display tutorial here to get a better idea of how to write your application lifecycle:
https://github.com/mattdesl/lwjgl-basics/wiki/DisplayThen you can move on to writing your own texture loader:
https://github.com/mattdesl/lwjgl-basics/wiki/TexturesYou can see other tutorials here:
https://github.com/mattdesl/lwjgl-basics/wikiFeel free to use the API as a replacement to SlickUtil. It is more minimal and works better with modern GL, has better support for fonts, texture regions, shaders, etc.