public abstract class

GLView

extends View
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.opengl.GLView

Class Overview

A GL view is used to perform 3D drawing operations. By overriding the renderFrame(GL10) method, you can draw to the view.

Contrary to GLScreen, a GLView can be inserted in any kind of screen.

Summary

[Expand]
Inherited XML Attributes
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
GLView()
Creates a GLView.
Public Methods
abstract void onCreate(GL10 gl, EGLConfig config)
Called automatically on creation.
void onPause()
Inform the view that the screen is paused.
void onResume()
Inform the view that the screen is resumed.
void refresh()
Refresh the view.
abstract void renderFrame(GL10 gl)
Override this method to do the drawing of a 3D model.
Protected Methods
void onSizeChanged(GL10 gl, int width, int height)
Called once Surface is created and each time the view is resized.
[Expand]
Inherited Methods
From class com.neomades.ui.View
From class java.lang.Object

Public Constructors

public GLView ()

Creates a GLView.

Public Methods

public abstract void onCreate (GL10 gl, EGLConfig config)

Called automatically on creation. Initialize OpenGL basic states.

Parameters
gl the OpenGL state
config the OpenGL configuration

public void onPause ()

Inform the view that the screen is paused. The owner of this view must call this method when the screen is paused. Calling this method will pause the rendering.

public void onResume ()

Inform the view that the screen is resumed. The owner of this view must call this method when the screen is resumed. Calling this method will resume the rendering.

public void refresh ()

Refresh the view.

public abstract void renderFrame (GL10 gl)

Override this method to do the drawing of a 3D model.

Parameters
gl the OpenGL state

Protected Methods

protected void onSizeChanged (GL10 gl, int width, int height)

Called once Surface is created and each time the view is resized. Set the OpenGL states which change with resolution.

Parameters
gl the OpenGL state
width the new view width
height the new view height