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

The following examples show how to use com.badlogic.gdx.Gdx#gl20() . 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 File: ScreenManager.java    From uracer-kotd with 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
Source File: ControllerMappingsTest.java    From gdx-controllerutils with Apache License 2.0 5 votes vote down vote up
@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 File: IOSMini2DxGraphics.java    From mini2Dx with 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 File: IOSMini2DxGraphics.java    From mini2Dx with 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 File: Lwjgl3Mini2DxWindow.java    From mini2Dx with 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);
}