Search in sources :

Example 6 with Rectangle

use of com.jme3.font.Rectangle in project jmonkeyengine by jMonkeyEngine.

the class TestMultipleApplications method simpleInitApp.

@Override
public void simpleInitApp() {
    clContext = context.getOpenCLContext();
    if (clContext == null) {
        LOG.severe("No OpenCL context found");
        stop();
        return;
    }
    Device device = clContext.getDevices().get(0);
    clQueue = clContext.createQueue(device);
    clQueue.register();
    String source = "" + "__kernel void Fill(__global float* vb, float v)\n" + "{\n" + "  int idx = get_global_id(0);\n" + "  vb[idx] = v;\n" + "}\n";
    Program program = clContext.createProgramFromSourceCode(source);
    program.build();
    program.register();
    kernel = program.createKernel("Fill");
    kernel.register();
    buffer = clContext.createBuffer(4);
    buffer.register();
    flyCam.setEnabled(false);
    inputManager.setCursorVisible(true);
    BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt");
    infoText = new BitmapText(fnt, false);
    //infoText.setBox(new Rectangle(0, 0, settings.getWidth(), settings.getHeight()));
    infoText.setText("Device: " + clContext.getDevices());
    infoText.setLocalTranslation(0, settings.getHeight(), 0);
    guiNode.attachChild(infoText);
    statusText = new BitmapText(fnt, false);
    //statusText.setBox(new Rectangle(0, 0, settings.getWidth(), settings.getHeight()));
    statusText.setText("Running");
    statusText.setLocalTranslation(0, settings.getHeight() - infoText.getHeight() - 2, 0);
    guiNode.attachChild(statusText);
}
Also used : BitmapText(com.jme3.font.BitmapText) BitmapFont(com.jme3.font.BitmapFont)

Aggregations

BitmapText (com.jme3.font.BitmapText)5 BitmapFont (com.jme3.font.BitmapFont)4 Rectangle (com.jme3.font.Rectangle)4 Geometry (com.jme3.scene.Geometry)2 Quad (com.jme3.scene.shape.Quad)2 KeyTrigger (com.jme3.input.controls.KeyTrigger)1 Material (com.jme3.material.Material)1 PixelInputOutput (com.jme3.scene.plugins.blender.textures.io.PixelInputOutput)1 Image (com.jme3.texture.Image)1 Texture (com.jme3.texture.Texture)1 Texture2D (com.jme3.texture.Texture2D)1 Picture (com.jme3.ui.Picture)1 ByteBuffer (java.nio.ByteBuffer)1