public abstract class

GLScreen

extends Screen
java.lang.Object
   ↳ com.neomades.app.Screen
     ↳ com.neomades.opengl.GLScreen

Class Overview

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

Summary

[Expand]
Inherited Constants
From class com.neomades.app.Screen
From interface com.neomades.app.Keys
From interface com.neomades.app.Orientation
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
[Expand]
Inherited Fields
From class com.neomades.app.Screen
Public Constructors
GLScreen()
Public Methods
final int getHeight()
Returns the height of the screen in pixels.
Rect getScreenRect()
Returns the rectangle corresponding to the screen.
final int getWidth()
Returns the width of the screen in pixels.
void startAutoRefresh(int timer)
Indicates that the screen will be refreshed at a regular interval.
void stopAutoRefresh()
Stops the screen from being automatically refreshed.
Protected Methods
View getContent()
Cannot be called for GLScreen.
abstract void onCreate(GL10 gl, EGLConfig config)
Override this method to initialize the OpenGL components of the screen.
void onSizeChanged(GL10 gl, int width, int height)
Called once Surface is created and each time the view is resized.
void onUpdate()
abstract void renderFrame(GL10 gl)
Override this method to do the drawing of a 3D model.
void setContent(View content)
Cannot be called for GLScreen.
[Expand]
Inherited Methods
From class com.neomades.app.Screen
From class java.lang.Object

Public Constructors

public GLScreen ()

Public Methods

public final int getHeight ()

Returns the height of the screen in pixels.

Returns
  • the height of the screen in pixels

public Rect getScreenRect ()

Returns the rectangle corresponding to the screen.

Returns
  • the rectangle corresponding to the screen

public final int getWidth ()

Returns the width of the screen in pixels.

Returns
  • the width of the screen in pixels

public void startAutoRefresh (int timer)

Indicates that the screen will be refreshed at a regular interval. this will create a timer that will refresh the screen. The timer is started when this method is called.

Parameters
timer the time between two refresh calls

public void stopAutoRefresh ()

Stops the screen from being automatically refreshed.

Protected Methods

protected View getContent ()

Cannot be called for GLScreen.

Returns
  • null

protected abstract void onCreate (GL10 gl, EGLConfig config)

Override this method to initialize the OpenGL components of the screen. This method will be called once when the screen is created.

Parameters
gl the OpenGL state
config the OpenGL configuration

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 screen width
height the new screen height

protected void onUpdate ()

protected abstract void renderFrame (GL10 gl)

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

Parameters
gl the OpenGL state

protected void setContent (View content)

Cannot be called for GLScreen.

Parameters
content the content of this screen