- Joined
- Jul 11, 2020
- Messages
- 0
- Reaction score
- 26
- Points
- 0
Hallo ich bin gerade dabei einen startscreen zu schreiben aber er ist verzehrt : http://prntscr.com/lpoyvu
ich rendere das bild so:
ich glaube der fehler ligt bei glOrtho(320 - w / 2, 320 + w / 2, 240 + h / 2, 240 - h / 2, -1, 1);
kann mir jemand helden das zu fixen
ich rendere das bild so:
Code:
glClear(GL_COLOR_BUFFER_BIT);
//setup Matrix
int w = Display.getWidth();
int h = Display.getHeight();
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(320 - w / 2, 320 + w / 2, 240 + h / 2, 240 - h / 2, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor4f(1f, 1f, 1f, 1f);
glEnable(GL_TEXTURE_2D);
glPushMatrix();
//render
float x = w / 2 - 100, y = h / 2, width = 400, height = 400;
glTranslatef(x, y, 0);
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("Aura/black.png"));
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(-width / 2, height / 2);
glTexCoord2f(0, 1);
glVertex2f(-width, -height / 2);
glTexCoord2f(1, 1);
glVertex2f(width / 2, -height / 2);
glTexCoord2f(1, 0);
glVertex2f(width / 2, height / 2);
glEnd();
// glFlush();
//sync
glPopMatrix();
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D)
Display.update();
Display.sync(100);
kann mir jemand helden das zu fixen