Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Loader{
- public void gl_load3D(int WIDTH, int HEIGHT) {
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- GLU.gluPerspective((float) 60, WIDTH/HEIGHT, 0.001f, 3500);
- //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glEnable(GL_TEXTURE_2D);
- glShadeModel(GL_SMOOTH);
- glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
- glClearDepth(100.0f);
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LEQUAL);
- glDisable(GL_BLEND);
- }
- public void gl_load2D(){
- // switch to 2d drawing
- glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- glClearDepth(1);
- glViewport(0,0,800,600);
- glMatrixMode(GL_MODELVIEW);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0, Main.width, Main.height, 0, 1, -1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glEnable(GL_BLEND);
- }
- }
- public class Gui {
- Loader loader = new Loader();
- TrueTypeFont font;
- public void renderGUI(int height, int width){
- loader.gl_load2D();
- font.drawString(200, 200, "HELLOOOOOOOOOO", Color.blue);
- loader.gl_load3D(Main.width, Main.height);
- }
- public void loadFont(){
- Font awtFont = new Font("Times New Roman", Font.BOLD, 100);
- font = new TrueTypeFont(awtFont, false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement