Witam, pisze małą grę przy użyciu bibliotek Kryonet oraz LWJGL i napotkałem problem. Przy wyświetlaniu napisu dostaję tylko biały prostokąt... Sprawdzałem wiele różnych opcji dodawania napisu i niestety cały czas uzyskuję ten sam efekt. Może miał ktoś podobny problem.

package mygame;

import java.awt.Color;
import java.awt.Font;
import java.util.HashMap;
import java.util.Map;

import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.TrueTypeFont;

import com.esotericsoftware.kryonet.Listener;

public class ClientProgram extends Listener {

    static Player player = new Player();
    static Network network = new Network();
    static Map<Integer, MPPlayer> players = new HashMap<Integer, MPPlayer>();
    private static TrueTypeFont font;
    private static Font awtFont;

    public static void main(String[] args) throws Exception {
        Display.setDisplayMode(new DisplayMode(512, 512));
        Display.setTitle("Uciekaj albo giń!");
        Display.create();

        // Init GL
        GL11.glMatrixMode(GL11.GL_PROJECTION);
        GL11.glLoadIdentity();
        GL11.glOrtho(0, Display.getWidth(), 0, Display.getHeight(), -1, 1);
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        awtFont = new Font("Time News Roman", Font.BOLD, 24);
        font = new TrueTypeFont(awtFont, true);
        network.connect();

        while (!Display.isCloseRequested()) {
            GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
            GL11.glLoadIdentity();
            update();
            render(null, null);

            Display.update();
            Display.sync(60);
        }

        Display.destroy();
        System.exit(0);
    }

    public static void update() {
        player.update();

        // Aktualizacja pozycji
        if (player.networkPosition.x != player.position.x) {
            // Wyslij pozycje X
            PacketUpdateX packet = new PacketUpdateX();
            packet.x = player.position.x;
            network.client.sendUDP(packet);

            player.networkPosition.x = player.position.x;
        }
        if (player.networkPosition.y != player.position.y) {
            // Wyslij pozycje Y
            PacketUpdateY packet = new PacketUpdateY();
            packet.y = player.position.y;
            network.client.sendUDP(packet);

            player.networkPosition.y = player.position.y;
        }
    }

    public static void render(GameContainer gc, Graphics g) {

        // Renderowanie gracza
        font.drawString(20.0f,20.0f,"Test drawing string.");
        GL11.glColor3f(0, 0, 1);
        GL11.glBegin(GL11.GL_TRIANGLE_FAN);
        GL11.glVertex2f(player.position.x - 8, player.position.y - 8);
        GL11.glVertex2f(player.position.x + 8, player.position.y + 8);
        GL11.glVertex2f(player.position.x - 8, player.position.y + 8);
        GL11.glVertex2f(player.position.x + 8, player.position.y - 8);
        GL11.glEnd();

        // Renderowanie innych graczy
        GL11.glColor3f(1, 0, 0);
        GL11.glBegin(GL11.GL_TRIANGLES);
        for (MPPlayer mpPlayer : players.values()) {
            if (player.position.x != mpPlayer.x || player.position.y != mpPlayer.y) {
                GL11.glColor3f(1, 0, 0);
                GL11.glBegin(GL11.GL_TRIANGLES);
                GL11.glVertex2f(mpPlayer.x, mpPlayer.y + 8);
                GL11.glVertex2f(mpPlayer.x + 8, mpPlayer.y - 8);
                GL11.glVertex2f(mpPlayer.x - 8, mpPlayer.y - 8);
            } else {
                GL11.glColor3f(0, 1, 0);
                GL11.glBegin(GL11.GL_TRIANGLES);
                GL11.glVertex2f(mpPlayer.x, mpPlayer.y + 20);
                GL11.glVertex2f(mpPlayer.x + 20, mpPlayer.y - 20);
                GL11.glVertex2f(mpPlayer.x - 20, mpPlayer.y - 20);
                Counter packet = new Counter();
                packet.counter += 1;
                network.client.sendTCP(packet);
            }

        }
        GL11.glEnd();
    }
}