本文整理匯總了Java中com.badlogic.gdx.Gdx.gl20方法的典型用法代碼示例。如果您正苦於以下問題:Java Gdx.gl20方法的具體用法?Java Gdx.gl20怎麽用?Java Gdx.gl20使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.Gdx
的用法示例。
在下文中一共展示了Gdx.gl20方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
@BeforeClass
public static void init() {
// Note that we don't need to implement any of the listener's methods
application = new HeadlessApplication(new ApplicationListener() {
@Override public void create() {}
@Override public void resize(int width, int height) {}
@Override public void render() {}
@Override public void pause() {}
@Override public void resume() {}
@Override public void dispose() {}
});
// Use Mockito to mock the OpenGL methods since we are running headlessly
Gdx.gl20 = Mockito.mock(GL20.class);
Gdx.gl = Gdx.gl20;
}
示例2: render
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
public void render(float deltaTime){
if (elapsed >= fadeTime)
return;
if (delay > 0){
delay -= deltaTime;
}
GL20 gl = Gdx.gl20;
gl.glEnable(GL20.GL_BLEND);
gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
color.a = delay > 0 ? 1f : 1f - Interpolation.fade.apply( elapsed / fadeTime);
if (shader==null)
createShader();
shader.begin();
shader.setUniformf(u_color, color);
mesh.render(shader, GL20.GL_TRIANGLE_FAN);
shader.end();
if (delay <= 0)
elapsed += deltaTime;
}
示例3: main
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
public static void main(String[] args)
{
SpringApplication.run(HeadlessServerLauncher.class, args);
ServerSettings.isHeadless = true;
LwjglNativesLoader.load();
Gdx.files = new LwjglFiles();
HeadlessNativesLoader.load();
MockGraphics mockGraphics = new MockGraphics();
Gdx.graphics = mockGraphics;
HeadlessNet headlessNet = new HeadlessNet();
Gdx.net = headlessNet;
Gdx.gl = new NullGL20();
Gdx.gl20 = new NullGL20();
Gdx.gl30 = new NullGL30();
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
new HeadlessApplication(new GameServer(), config);
}
示例4: init
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
@BeforeClass
public static void init() {
// Note that we don't need to implement any of the listener's methods
Gdx.app = new HeadlessApplication(new ApplicationListener() {
@Override
public void create() {
}
@Override
public void resize(int width, int height) {
}
@Override
public void render() {
}
@Override
public void pause() {
}
@Override
public void resume() {
}
@Override
public void dispose() {
}
});
// Use Mockito to mock the OpenGL methods since we are running headlessly
Gdx.gl20 = Mockito.mock(GL20.class);
Gdx.gl = Gdx.gl20;
}