public void beforeRender() {
            // this is where the OpenGL rendering context is generated.
            if (context == NULL) {
                try {
                    context = platformCanvas.create(this, data, effective);
                } catch (AWTException e) {
                    listener.handleError("Exception while creating the OpenGL context", e);
                    return;
                }
            }
            
            /*
             * To start drawing on the AWT surface, the AWT threads must be locked to
             * avoid conflicts when drawing on the canvas.
             */
            try {
                platformCanvas.lock(); // <- MUST lock on Linux
            } catch (AWTException e) {
                listener.handleError("Failed to lock Canvas", e);
            }
            
            /*
             * The 'makeCurrent(long)' method converts the specified OpenGL rendering 
             * context to the current rendering context.
             */
            platformCanvas.makeCurrent(context);
        }
Called before <code>afterRender()</code> to prepare the AWT drawing surface.
jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java