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

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

Introduction

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

Prototype

int GL_RGB

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

Click Source Link

Usage

From source file:com.agateau.utils.ScreenshotCreator.java

License:Apache License

private static Pixmap takeScreenshot() {
    int width = Gdx.graphics.getWidth();
    int height = Gdx.graphics.getHeight();
    if (sPixmap == null) {
        init();//from  w  w w .  ja va2s.c o m
    }
    Gdx.gl.glReadPixels(0, 0, width, height, GL20.GL_RGB, GL20.GL_UNSIGNED_BYTE, sPixmap.getPixels());
    return sPixmap;
}