本文整理汇总了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;
}