Example usage for com.badlogic.gdx.graphics GL20 GL_RENDERER

List of usage examples for com.badlogic.gdx.graphics GL20 GL_RENDERER

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL20 GL_RENDERER.

Prototype

int GL_RENDERER

To view the source code for com.badlogic.gdx.graphics GL20 GL_RENDERER.

Click Source Link

Usage

From source file:mobi.shad.s3lib.main.S3Screen.java

License:Apache License

public static void init() {
    graphics = Gdx.app.getGraphics();// w  w  w.  j a v  a2 s  .  c o m
    gl20 = graphics.getGL20();
    type = graphics.getType();
    density = graphics.getDensity();
    virtualScreen = S3.cfg.virtualScreen;

    S3Log.info(TAG, "GL_VENDOR=" + gl20.glGetString(GL20.GL_VENDOR));
    S3Log.info(TAG, "GL_VENDOR=" + gl20.glGetString(GL20.GL_VENDOR));
    S3Log.info(TAG, "GL_RENDERER=" + gl20.glGetString(GL20.GL_RENDERER));
    S3Log.info(TAG, "GL_VERSION=" + gl20.glGetString(GL20.GL_VERSION));
    S3Log.info(TAG, "GL_EXTENSIONS :\n" + gl20.glGetString(GL20.GL_EXTENSIONS).trim().replace(" ", " "));

    String[] screenSize = S3.cfg.screenSize.split("x");
    if (Integer.parseInt(screenSize[0]) > 0 && Integer.parseInt(screenSize[1]) > 0) {
        VIRTUAL_WIDTH = Integer.parseInt(screenSize[0]);
        VIRTUAL_HEIGHT = Integer.parseInt(screenSize[1]);
    }

    if (virtualScreen) {
        width = VIRTUAL_WIDTH;
        height = VIRTUAL_HEIGHT;
    } else {
        width = graphics.getWidth();
        height = graphics.getHeight();
    }

    //
    // Detect screen type
    //
    if (S3.cfg.multiResolution) {
        if ((width > height && width <= 481) || (height > width && height <= 481)) {
            resolution = ResolutionType.ldpi;
        } else if ((width > height && width < 721) || (height > width && height < 721)) {
            resolution = ResolutionType.mdpi;
        } else if (((width > height && width < 1301) || (height > width && height < 1301)) && density < 1.75f) {
            resolution = ResolutionType.hdpi;
        } else {
            resolution = ResolutionType.xhdpi;
        }
    } else {
        resolution = ResolutionType.hdpi;
    }
    resize(graphics.getWidth(), graphics.getHeight());
}

From source file:start.PlayLoop.java

License:Open Source License

/**  New GDX method overrides-
  *///from  w w  w. ja v  a2  s.c  o m
public void create() {
    //
    //  NOTE:  We perform some extra diagnostic printouts here, since the
    //  GL context wasn't obtainable earlier:
    I.say("Please send me this info" + "\n--- GL INFO -----------" + "\n   GL_VENDOR: "
            + Gdx.gl.glGetString(GL20.GL_VENDOR) + "\n GL_RENDERER: " + Gdx.gl.glGetString(GL20.GL_RENDERER)
            + "\n  GL_VERSION: " + Gdx.gl.glGetString(GL20.GL_VERSION) + "\nGLSL_VERSION: "
            + Gdx.gl.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION) + "\n-----------------------\n");
    shouldLoop = true;

    for (String assetPackage : initPackages) {
        Assets.compileAssetList(assetPackage);
    }
    rendering = new Rendering();
}