LWJGL に問題があり、ビットマップの文字でクワッドをテクスチャリングします。大文字のTを表示したい。T は 6 行目の 5 列目にあります。こちらは左上からX:40、Y:32pxです。
次のコードを使用します。
GL11.glTexCoord2f((float) (Math.floor(charID / this.charsInRow) * charSize) / bitmapSize, (float) (Math.floor(charID % this.charsInRow) * charSize) / bitmapSize);
GL11.glVertex2f((charPosition * fontSize) + x, y);
GL11.glTexCoord2f((float) (Math.floor(charID / this.charsInRow) * charSize + charSize) / bitmapSize, (float) (Math.floor(charID % this.charsInRow) * charSize) / bitmapSize);
GL11.glVertex2f((charPosition * fontSize) + x + fontSize, y);
GL11.glTexCoord2f((float) (Math.floor(charID / this.charsInRow) * charSize + charSize) / bitmapSize, (float) (Math.floor(charID % this.charsInRow) * charSize + charSize) / bitmapSize);
GL11.glVertex2f((charPosition * fontSize) + x + fontSize, y + fontSize);
GL11.glTexCoord2f((float) (Math.floor(charID / this.charsInRow) * charSize) / bitmapSize, (float) (Math.floor(charID % this.charsInRow) * charSize + charSize) / bitmapSize);
GL11.glVertex2f((charPosition * fontSize) + x
,y + fontSize);
しかし、LWJGL は右下から数えるので変な ASCII 記号が表示されます。
Tが選択されるようにするにはどうすればよいですか?