

If you imported the project already, right-click on the project name in the Project Explorer pane, and click delete.

To learn how to create a project from scratch, let's go through the steps necessary to create the project we imported in the previous section. Try tapping the device display, and slide your finger along the display the solid color that is displayed should vary depending on the touch location. In the Android tab, make sure that the version selected is at least Android 4.0.3 (API 15):īuild the project (right-click SimpleNativeGL > Build Project), and run it on your device (right-click SimpleNativeGL > Run As > Android Application). In the Project Explorer, right-click on the project folder and choose Properties.

Sometimes the project might be imported with the wrong Android version. Select Project Type to be Makefile project and Toolchain to be Android GCC. The files and folders within the red rectangle are the ones you just imported, others were generated during the Import operation.Īs this is a native project, select the C/C++ perspective.īy default all Android projects are Java projects, let's convert ours to native by right-clicking the project in Package Explorer and selecting New > Convert to C/C++ Project. Open the project in the Package Explorer.

In this case, we'll use the name SimpleNativeGL. Its location may vary depending on the operating system, could be under Refactor). then you should rename the project (right-click the project and find the Rename option. If the project has the default name, like so: You can copy the files into the project directory in the workspace if you want by selecting one of the boxes. Open Eclipse, select File > Import > Android > Existing Android Code into Workspace*, and browse into the Root Directory ( /tutorials/SimpleNativeGL). Start by importing /tutorials/SimpleNativeGL project. Let's start the first GL application by importing an existing project to Eclipse. For the latter, we will follow similar steps to those described in Creating a NativeActivity, in case you need a more in-depth overview. We first show how to import an existing native GL project into your workspace, and then we show you how to create the same project from scratch. We also cover how to handle various Android events in a native program. From now on, we'll use GL as a shorthand for OpenGL ES 2.0. For 3D graphics, there are other tutorials available, as well as the NativeGlobe example provided in CodeWorks for Android. In this section, we only cover 2D graphics using OpenGL ES 2.0. OpenGL ES provides a fast way to display the camera images, possibly after some image processing, and allows building simple user interfaces.
