本文整理匯總了Java中org.lwjgl.opengl.Display.wasResized方法的典型用法代碼示例。如果您正苦於以下問題:Java Display.wasResized方法的具體用法?Java Display.wasResized怎麽用?Java Display.wasResized使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.opengl.Display
的用法示例。
在下文中一共展示了Display.wasResized方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkWindowResize
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
protected void checkWindowResize()
{
if (!this.fullscreen && Display.wasResized())
{
int i = this.displayWidth;
int j = this.displayHeight;
this.displayWidth = Display.getWidth();
this.displayHeight = Display.getHeight();
if (this.displayWidth != i || this.displayHeight != j)
{
if (this.displayWidth <= 0)
{
this.displayWidth = 1;
}
if (this.displayHeight <= 0)
{
this.displayHeight = 1;
}
this.resize(this.displayWidth, this.displayHeight);
}
}
}
示例2: checkWindowResize
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
protected void checkWindowResize() {
if (!this.fullscreen && Display.wasResized()) {
int i = this.displayWidth;
int j = this.displayHeight;
this.displayWidth = Display.getWidth();
this.displayHeight = Display.getHeight();
if (this.displayWidth != i || this.displayHeight != j) {
if (this.displayWidth <= 0) {
this.displayWidth = 1;
}
if (this.displayHeight <= 0) {
this.displayHeight = 1;
}
this.resize(this.displayWidth, this.displayHeight);
}
}
}
示例3: render
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
private void render(){
if(Display.wasResized()) glViewport(0, 0, Display.getWidth(), Display.getHeight());
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
GLU.gluPerspective(70.0f, (float) Display.getWidth() / (float) Display.getHeight(), 0.01f, 1000.0f);
glEnable(GL_DEPTH_TEST);
glPopMatrix();
glPushAttrib(GL_TRANSFORM_BIT);
glRotatef(player.getLocation().getYaw(), 1, 0, 0);
glRotatef(player.getLocation().getPitch(), 0, 1, 0);
glTranslatef(-player.getLocation().getX(), -player.getLocation().getY(), -player.getLocation().getZ());
Renderer.renderWorld(world);
Renderer.renderRayCast(player);
glPopAttrib();
glPopMatrix();
glDisable(GL_DEPTH_TEST);
renderGUI();
}