Example usage for com.badlogic.gdx.graphics GL10 GL_MULTISAMPLE

List of usage examples for com.badlogic.gdx.graphics GL10 GL_MULTISAMPLE

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL10 GL_MULTISAMPLE.

Prototype

int GL_MULTISAMPLE

To view the source code for com.badlogic.gdx.graphics GL10 GL_MULTISAMPLE.

Click Source Link

Usage

From source file:org.interreg.docexplore.reader.ReaderApp.java

License:Open Source License

public void create() {
    try {/*  w w  w.j  av  a  2s  .c  o  m*/
        Gdx.graphics.setVSync(true);
        this.renderThread = Thread.currentThread();
        renderThread.setName("Render Thread");
        this.client = new ReaderClient(this, startup);
        client.start("127.0.0.1", 8787);
        this.renderTasks = new LinkedList<Runnable>();
        //this.sound = new SoundManager();

        client.registerStreamType(StreamedImage.class, StreamedImage.allocator);
        client.registerStreamType(StreamedTexture.class, StreamedTexture.allocator);
        //client.registerStreamType(StreamedSound.class, StreamedSound.allocator);
        client.registerStreamType(StreamedXML.class, StreamedXML.allocator);

        Gdx.gl10.glEnable(GL10.GL_BLEND);
        Gdx.gl10.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
        Gdx.gl10.glEnable(GL10.GL_COLOR_MATERIAL);
        Gdx.gl10.glEnable(GL10.GL_DEPTH_TEST);
        Gdx.gl10.glEnable(GL10.GL_MULTISAMPLE);
        Gdx.gl10.glCullFace(GL10.GL_BACK);

        this.modules = new LinkedList<Module>();
        modules.add(shelf = new ShelfEngine(this));
        modules.add(bookEngine = new BookEngine(this, 1, .7f));
        modules.add(parchmentEngine = new ParchmentEngine(this));
        modules.add(gui = new GuiLayer(this));
        modules.add(input = new InputManager(this));
        modules.add(debugGfx = new DebugGraphics(this));
        input.addListenerFirst(gui);

        bookEngine.addRoiLayoutListener(new BookEngine.ROILayoutListener() {
            public void roiLayoutChanged(ROISpecification[] rois) {
                input.notifyLayoutChange(rois);
            }
        });

        List<PluginConfig> plugins = startup.filterPlugins(InputPlugin.class);
        for (PluginConfig config : plugins) {
            InputPlugin plugin = (InputPlugin) config.clazz.newInstance();
            plugin.setHost(input);
        }

        if (!startup.nativeCursor)
            try {
                Mouse.setNativeCursor(
                        new Cursor(1, 1, 0, 0, 1, BufferUtils.createIntBuffer(1).put(0, 0), null));
            } catch (Exception e) {
                e.printStackTrace();
            }

        emptyTex = new Texture(ImageUtils.read(Thread.currentThread().getContextClassLoader().getResource(
                BookSpecification.class.getPackage().getName().replace('.', '/') + "/emptyPageTex.png")),
                false);

        waitDialog = new Dialog(this);
        waitDialog.set(XMLResourceBundle.getBundledString("waitLabel"),
                XMLResourceBundle.getBundledString("imagesLabel"));
        gui.addWidget(waitDialog);

        this.logger = new ActivityLogger(new File(DocExploreTool.getHomeDir(), "activity.log"), 10000);
        logger.addEntry("Startup");

        this.mainTask = new ReaderMainTask(this);
        mainTask.start();
    } catch (Exception e) {
        ErrorHandler.defaultHandler.submit(e, false);
        System.exit(0);
    }
}