I have changed the texture and vertex order, thanks for pointing that out. I have also put the glEnable(GL_TEXTURE_2D) call in the loop, just in case, but it hasn't helped. I have also put in calls to Util.checkGLError() but that hasn't thrown any errors.
I have just checked with the buffer order being to BIG_ENDIAN and LITTLE_ENDIAN and both didn't throw any errors and gave the same result as before.
I shall make a new project with just this functionality and nothing else to try and narrow down the possibilities.
Here is a self contained project which shows everything I am doing. In a hopefully readable fashion. Help would be appreciated, as I still cannot see what is wrong. Only thing I know I'm not sure is right is the position of glBindTexture related to glTexImage2D..
import static org.lwjgl.opengl.GL11.*;
public class Main
public static int screenwidth = 1024;
public static int screenheight = 1024;
private int textureid;
private ByteBuffer texturebuffer;
public void start()
Display.setDisplayModeAndFullscreen(new DisplayMode(screenwidth, screenheight));
glOrtho(-2, 2, 2, -2, -5, 500);
public void setTexture() //Should make an entirely yellow texture?
textureid = glGenTextures();
texturebuffer = BufferUtils.createByteBuffer(screenwidth*screenheight*3/4);
for(int i=0; i<screenwidth*screenheight/4; i++)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, screenwidth/2, screenheight/2, 0, GL_RGB, GL_UNSIGNED_BYTE, texturebuffer);
public void render()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(1.0f, 0.0f, 1.0f, 1.0f);
public static void main(String args)
Main screen = new Main();