Java Code Examples for com.badlogic.gdx.Gdx#gl20()

The following examples show how to use com.badlogic.gdx.Gdx#gl20() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: uracer-kotd   File: ScreenManager.java    License: Apache License 2.0 5 votes vote down vote up
public ScreenManager (Rectangle viewport, ScreenFactory factory) {
	screenFactory = factory;
	transMgr = new TransitionManager(viewport, URacer.Game.isDesktop() /* 32bits */, true, true);
	current = null;
	next = ScreenType.NoScreen;
	quitPending = false;
	doSetScreenImmediate = false;
	justTransitioned = false;
	gl = Gdx.gl20;
}
 
Example 2
@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;
}
 
Example 3
Source Project: mini2Dx   File: IOSMini2DxGraphics.java    License: Apache License 2.0 5 votes vote down vote up
public void setGL20 (GL20 gl20) {
	this.gl20 = gl20;
	if (gl30 == null) {
		Gdx.gl = gl20;
		Gdx.gl20 = gl20;
	}
}
 
Example 4
Source Project: mini2Dx   File: IOSMini2DxGraphics.java    License: Apache License 2.0 5 votes vote down vote up
public void setGL30 (GL30 gl30) {
	this.gl30 = gl30;
	if (gl30 != null) {
		this.gl20 = gl30;

		Gdx.gl = gl20;
		Gdx.gl20 = gl20;
		Gdx.gl30 = gl30;
	}
}
 
Example 5
Source Project: mini2Dx   File: Lwjgl3Mini2DxWindow.java    License: Apache License 2.0 5 votes vote down vote up
void makeCurrent() {
	Gdx.graphics = graphics;
	Gdx.gl30 = graphics.getGL30();
	Gdx.gl20 = Gdx.gl30 != null ? Gdx.gl30 : graphics.getGL20();
	Gdx.gl = Gdx.gl30 != null ? Gdx.gl30 : Gdx.gl20;
	Gdx.input = input;

	GLFW.glfwMakeContextCurrent(windowHandle);
}