Asim’s Blog

Part 2: Integration with OpenGL and Designing a Splash Screen

Step 1: Creating an OpenGL View

In order to create an OpenGL activity we will need to create at least three new classes.

  1. GameActivity is the class that extends Activity. This class just creates the OpenGL view.
  2. VortexView is the class that extends GLSurfaceView. This is responsible for handling the view related functions of the OpenGL application. All the user inputs will be received by this class.
  3. Last but definitely not the least is the VortexRenderer class. This class implements GLSurfaceView.Renderer interface. This is responsible for rendering the OpenGL view.

The basic code for GameActivity.java looks like:

You can change the text color and text in the title bar by adding following two lines in the onCreate() function:
this.setTitleColor(Color.DKGRAY);
this.setTitle(“FunFight”);

If you want to hide the title bar you can make it full screen by:

this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: