Create GWT application
Create a new Google Web Application Project in Eclipse (File -> New -> Other -> Google -> Web Application Project) Enter a project and package name. Check Use Google Web Toolkit (Version 2.2) Click Finish.
Delete generated files that are not needed
The Google Eclipse plugin generates a sample project with some stuff that you don't need in your GwtGL app, so we are going to delete some files. Delete the generated server package (e.g. com.example.gwtgl.server). We don't need any server code for this howto. In the client-package (e.g. com.example.gwtgl.client), delete the generated classes GreetingService.java and GreetingServiceAsync.java.
Now you have only files in the project that we actually need.
Configuration
Continue with some configuration.
Open the web.xml file in directory war/WEB-INF. Delete the generated greetServlet servlet by removing the following code from the file: ``` greetServlet com.example.gwtgl.server.GreetingServiceImpl
greetServlet /yourproject/greet ```
Your web.xml should now look like this: ```
YourProjectName.html
```
Add GwtGL to your project
Extract the GwtGL bin and src jar files from the zip download to the directory war/WEB-INF/lib in your project folder. Add these jars to the build path: right mouse click on your project -> Properties -> Java Build Path -> Tab Libraries-> Click Add JARs-> select the two GwtGL jar files -> click OK -> click OK.
Open file YourProjectName.html in war directory. Scroll to the body tag. Below the noscript tag you will find a headline and a sample, generated html table. replace the table with the following code: ```
``` This is our placeholder that will contain the WebGL canvas.
Open the gwt xml configuration file in the root package (e.g. your.package.structure.GwtGLBindingDemo.gwt.xml).
Add the following entry:
<inherits name='com.googlecode.gwtgl.binding'/>
This will make the WebGL binding available in your project.
Implement the entry point
In the client package, open the remaining class, e.g. YourProjectName.java. Replace any content in this file with the following code: ``` package com.example.gwtgl.client;
import com.google.gwt.core.client.EntryPoint;
public class GwtGLBindingDemo implements EntryPoint {
public void onModuleLoad() {
}
} ```
That's it. You can now start to build your GwtGL app.