Like in topic. I have problem with angel code fonts (and any other kind of font, too). I have enabled GL_TEXTURE_2D, glEnable(GL_BLEND);, glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Below you can see how “Hello world!” is displayed, above placeholder ship:
http://img15.imageshack.us/img15/2848/screenshot017q.png
Here is part of my code:
public static AngelCodeFont font;
public static void main(String args[]) {
start();
makeFonts();
gameLoop();
}
static public void makeFonts() {
Font awtFont = new Font("Times New Roman", Font.BOLD, 72);
try {
glBindTexture(GL_TEXTURE_2D,2);
font = new AngelCodeFont("Jadro\\TimesNewRoman32.fnt", new Image("Jadro\\TimesNewRoman32.png"));
glBindTexture(GL_TEXTURE_2D,1);
} catch (SlickException ex) {
Logger.getLogger(Jadro.class.getName()).log(Level.SEVERE, null, ex);
}
}
Core.font.drawString(0, 0, "Hello World!", Color.white);
Just in case: OpenGL creation:
public void utworz() {
try {
Display.setDisplayMode(new DisplayMode(SCREEN_X,SCREEN_Y));
Display.setTitle("Silent Space 0.0.4 --- team work prototype");
Display.create(new PixelFormat(8,8,8));
Display.setVSyncEnabled(true);
} catch (LWJGLException e) {
System.exit(0);
}
glClearColor(0.0f,0.0f,0.0f,0.0f);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLoadIdentity();
glShadeModel(GL_SMOOTH);
glClearDepth(1.0f);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GEQUAL, 0.1f);
glEnable(GL_SCISSOR_TEST);
glEnable(GL_STENCIL_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, SCREEN_X, 0, SCREEN_Y, 1, -1);
glMatrixMode(GL_MODELVIEW);
}