二、应用举例
package com.example.groupactiontest; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.Input.Peripheral; import com.badlogic.gdx.graphics.GL10; public class MyGame implements ApplicationListener { @Override public void create() { boolean fullscreen = Gdx.graphics.isFullscreen();//判断当前屏幕是否支持全屏 System.out.println( "fullscreen: --------->" + fullscreen); Gdx.graphics.setDisplayMode(1280,720,true);// set resolution to HD ready (1280 x 720) and set full-screen to true // set resolution to default and set full-screen to true Gdx.graphics.setDisplayMode(Gdx.graphics.getDesktopDisplayMode().width, Gdx.graphics.getDesktopDisplayMode().height, true); Gdx.graphics.setVSync(true); } @Override public void dispose() { // TODO Auto-generated method stub } @Override public void pause() { // TODO Auto-generated method stub } @Override public void render() { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); } @Override public void resize(int arg0, int arg1) { // TODO Auto-generated method stub } @Override public void resume() { // TODO Auto-generated method stub } }
四、源码下载
http://download.csdn.net/detail/caihongshijie6/7052163
(libgdx学习)Fullscreen&vsync,布布扣,bubuko.com
原文:http://blog.csdn.net/hjd_love_zzt/article/details/21373233