Java 类com.badlogic.gdx.backends.gwt.GwtApplication 实例源码

项目:ns2-scc-profiler    文件:ScreenshotHelper.java   
public void screenshot(String filename) {
    CanvasElement canvas = ((GwtApplication) Gdx.app).getCanvasElement();
    // base64 encoded PNG file using data URL encoding! send this to your server
    String dataUrl = canvas.toDataUrl("image/png");
    // just opening it in a new window, replace this with whatever you want to do with the data
    Window.open(dataUrl, "_blank", "");
}
项目:libgdxcn    文件:FileHandleStream.java   
public FileHandleStream (String path) {
    super(((GwtApplication)Gdx.app).getPreloader(), path, FileType.Internal);
}
项目:TinyVoxel    文件:GwtConfig.java   
@Override
public void uploadPalette(int width, int height) {
    Gdx.graphics.getGL20().glPixelStorei(GL20.GL_UNPACK_ALIGNMENT, 1);
    WebGLRenderingContext.getContext(((GwtApplication) Gdx.app).getCanvasElement()).texImage2D(GL20.GL_TEXTURE_2D, 0, GL20.GL_RGBA, width, height, 0,
            GL20.GL_RGBA,
            GL20.GL_UNSIGNED_BYTE, paletteBuffer);
}
项目:TinyVoxel    文件:GwtConfig.java   
@Override
public void uploadSinglePalette(int paletteId) {
    Gdx.graphics.getGL20().glPixelStorei(GL20.GL_UNPACK_ALIGNMENT, 1);
    WebGLRenderingContext.getContext(((GwtApplication) Gdx.app).getCanvasElement()).texSubImage2D(GL20.GL_TEXTURE_2D, 0, 0, paletteId, Config.TINY_GRID_TOTAL, 1,
            GL20.GL_RGBA,
            GL20.GL_UNSIGNED_BYTE, tinyPaletteBuffer);
}
项目:ns2-scc-profiler    文件:ScreenshotHelper.java   
public void screenshot(String filename) {
    CanvasElement canvas = ((GwtApplication) Gdx.app).getCanvasElement();
    // base64 encoded PNG file using data URL encoding! send this to your server
    String dataUrl = canvas.toDataUrl("image/png");
    // just opening it in a new window, replace this with whatever you want to do with the data
    Window.open(dataUrl, "_blank", "");
}
项目:vtm    文件:GwtMap.java   
@Override
public void create() {

    GwtGdxGraphics.init();
    GdxAssets.init("");
    CanvasAdapter.textScale = 0.7f;
    GLAdapter.init((GL) Gdx.graphics.getGL20());
    GLAdapter.GDX_WEBGL_QUIRKS = true;
    MapRenderer.setBackgroundColor(0xffffff);

    JsMap.init(mMap);

    if (GwtApplication.agentInfo().isLinux() &&
            GwtApplication.agentInfo().isFirefox())
        GwtGdxGraphics.NO_STROKE_TEXT = true;

    MapConfig c = MapConfig.get();
    super.create();

    MapPosition p = new MapPosition();
    p.setZoomLevel(c.getZoom());
    p.setPosition(c.getLatitude(), c.getLongitude());

    MapUrl mapUrl = new MapUrl(mMap);
    mapUrl.parseUrl(p);
    mapUrl.scheduleRepeating(5000);
}