Ejemplo n.º 1
0
  @Override
  public void init(GLAutoDrawable drawable) {
    GL2 gl = drawable.getGL().getGL2();

    AGLView.initGLContext(gl);

    ITextRenderer text_plain = createTextRenderer(ETextStyle.PLAIN);
    ITextRenderer text_bold = createTextRenderer(ETextStyle.BOLD);
    ITextRenderer text_italics = createTextRenderer(ETextStyle.ITALIC);
    IResourceLocator loader = createResourceLocator();
    TextureManager textures = new TextureManager(new ResourceLoader(loader));

    this.local = new GLContextLocal(text_plain, text_bold, text_italics, textures, loader);

    gl.glLoadIdentity();
    this.root.setParent(this);
    this.root.init(this);
  }
Ejemplo n.º 2
0
  @Override
  public void initRemote(
      final GL2 gl, final AGLView glParentView, final GLMouseListener glMouseListener) {

    // Register keyboard listener to GL2 canvas
    final Composite parentComposite = glParentView.getParentGLCanvas().asComposite();
    parentComposite
        .getDisplay()
        .asyncExec(
            new Runnable() {
              @Override
              public void run() {
                parentComposite.addKeyListener(glKeyListener);
              }
            });

    setMouseListener(glMouseListener);

    init(gl);
  }