3

I want to develop a game that would be an Eclipse plugin. However I am not yet sure what Class should be used for drawing 2D and 3D objects. The issue is even more complicated as Eclipse shifts to 4.x APIs, that are render-neutral (SWT or JavaFX).

Some old list of RCP aplications is at http://www.eclipse.org/community/rcpos.php There is olso outdated page Using OpenGL in SWT Applications, though I heard that there is new development of linking with OpenGL.

What would be modern Canvas in Eclipse platform?

What API to use for drawing 2D & 3D inside Eclipse plugin/application ?

UPDATE: Found that http://www.eclipse.org/gef/ has Draw2d http://www.eclipse.org/gef/draw2d/index.php (org.eclipse.draw2d) - A layout and rendering toolkit for displaying graphics on an SWT Canvas.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • 1
    Although Eclipse 4.3 supports different renderers (SWT, JavaFX...) you still have to choose which want you want to use for the RCP and code using that for the contents of parts and dialogs. – greg-449 Oct 25 '13 at 16:05

2 Answers2

1

Found that http://www.eclipse.org/gef/ has Draw2d http://www.eclipse.org/gef/draw2d/index.php (org.eclipse.draw2d) - A layout and rendering toolkit for displaying graphics on an SWT Canvas.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332
0

I would use a browser-based view.

I.e. create a new view that hosts a browser:

    import org.eclipse.swt.browser.Browser;

    ...
    public class MyView extends ViewPart {
      ...
       @Override
       public void createPartControl(Composite parent) {
          browser = new Browser(parent, SWT.NONE);
          browser.setText("<html><body>Hello: <progress max=\"100\"></progress></body></html>");
       }
    }

Then you can go all out using html5

Jurgen Vinju
  • 6,393
  • 1
  • 15
  • 26
  • This solution is not very quick, that is required for game, also default Internet Explorer integration on Windows is not so stable. – Paul Verest Oct 31 '13 at 01:56
  • You could try OpenGL bindings for Javascript for speed. In any case, this solution is indeed best for portability and independence, and not for speed. – Jurgen Vinju Oct 31 '13 at 12:11