我正在製作一款遊戲,並且我正在嘗試繪製我們的徽標,當我繪製它時有一個黑色邊框,下面是一些代碼(僅適用於徽標渲染)LWJGL/Slick-Util渲染圖
代碼繪製標誌在GuiLoading.java
@override
public void ex() throws IOException{
GL11.glColor3f(255, 255, 255);
drawRec(0, 0, Client.width, Client.height);
Texture logo = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("misc/hslogo.png"));
logo.bind();
drawRecWithTexture(Client.width/4 , Client.height/4, Client.width/4 + 400, Client.height/4 + 356);
}
和代碼爲 'drawRec' 和 'drawRecWithTexture' 空隙
public void drawRecWithTexture(int i, int j, int k, int l)
{
GL11.glPushMatrix();
GL11.glBegin(GL11.GL_QUADS);
GL11.glTexCoord2d(0, 0);
GL11.glVertex2i(i, j);
GL11.glTexCoord2d(0, 1);
GL11.glVertex2i(i, l);
GL11.glTexCoord2d(1, 1);
GL11.glVertex2i(k, l);
GL11.glTexCoord2d(1, 0);
GL11.glVertex2i(k, j);
GL11.glEnd();
GL11.glPopMatrix();
}
public void drawRec(int i, int j, int k, int l)
{
GL11.glPushMatrix();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2i(i, j);
GL11.glVertex2i(i, l);
GL11.glVertex2i(k, l);
GL11.glVertex2i(k, j);
GL11.glEnd();
GL11.glPopMatrix();
}
和輸出的圖像:
你是說它忽略了alhpa? –
你是什麼意思'alhpa' –
對不起,錯字,阿爾法..如在alpha通道。 –