In the screen initialization code (before the main loop) write the following code:
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, Display.getWidth(), Display.getHeight(), 0, 1, -1); GL11.glMatrixMode(GL11.GL_MODELVIEW); Texture i4 = TextureLoader.getTexture("PNG", new FileInputStream("textures" + File.separator + "myTexture.png"));
And in the main loop the following:
while (!Display.isCloseRequested()) { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); i4.bind(); GL11.glBegin(GL11.GL_QUADS); // Координаты и разрешение текстуры GL11.glTexCoord2f(0F, 0F); GL11.glVertex2f(100F, 100F); GL11.glTexCoord2f(1F, 0F); GL11.glVertex2f(100F + (float) i4.getTextureWidth(), 100F); GL11.glTexCoord2f(1F, 1F); GL11.glVertex2f(100F + (float) i4.getTextureWidth(), 100F + (float) i4.getTextureHeight()); GL11.glTexCoord2f(0F, 1F); GL11.glVertex2f(100F, 100F + (float) i4.getTextureHeight()); GL11.glEnd(); }