forked from libgdx/libgdx
-
Notifications
You must be signed in to change notification settings - Fork 0
Querying
bss9 edited this page Jul 8, 2014
·
5 revisions
The Application
interface provides various methods to query properties of the run-time environment.
Sometimes it is necessary to special case specific parts of an application depending on the platform it is running on. The Application.getType()
method returns the platform the application is currently running on:
switch (Gdx.app.getType()) {
case Android:
// android specific code
break;
case Desktop:
// desktop specific code
break;
case WebGl:
// HTML5 specific code
break;
default:
// Other platforms specific code
}
On Android, one can also query the Android version the application is currently running on:
int androidVersion = Gdx.app.getVersion();
This will return the SDK level supported on the current device, e.g., 3 for Android 1.5.
For debugging and profiling purposes it is often necessary to know the memory consumption, for both the Java heap and the native heap:
long javaHeap = Gdx.app.getJavaHeap();
long nativeHeap = Gdx.app.getNativeHeap();
Both methods return the number of bytes currently in use on the respective heap.
-
Developer's Guide
- Introduction
- Setting up your Development Environment (Eclipse, Intellij IDEA, NetBeans)
- Creating, Running, Debugging and Packaging your Project
- Working from Source
- The Application Framework
- A Simple Game
- File Handling
- Networking
- Preferences
- Input Handling
- Memory Management
- Audio
-
Graphics
- Configuration & Querying Graphics ??
- Fullscreen & VSync
- Continuous & Non-Continuous Rendering
- Clearing the Screen
- Take a Screenshot
- Profiling
- Viewports
- OpenGL ES Support * Configuration & Querying OpenGL ?? * Direct Access ?? * Utility Classes * Rendering Shapes * Textures & TextureRegions * Meshes * Shaders * Frame Buffer Objects
- 2D Graphics * SpriteBatch, TextureRegions, and Sprites * 2D Animation * Clipping, with the use of ScissorStack * Orthographic camera * Mapping Touch Coordinates ?? * NinePatches * Bitmap Fonts * Distance field fonts * Color Markup Language * Using TextureAtlases * Pixmaps * Packing Atlases Offline * Packing Atlases at Runtime * 2D Particle Effects * Tile Maps * scene2d * scene2d.ui * Table * Skin
- 3D Graphics * Quick Start * Models * Material and environment * ModelBatch * ModelBuilder, MeshBuilder and MeshPartBuilder * 3D animations and skinning * Importing Blender models in LibGDX * 3D Particle Effects * Perspective Camera ?? * Picking ??
- Managing Your Assets
- Internationalization and Localization
- Utilities
-
Math Utilities
- Interpolation
- Vectors, Matrices, Quaternions
- Circles, Planes, Rays, etc.
- Path interface & Splines
- Bounding Volumes ??
- Intersection & Overlap Testing ??
- Tools
- Extensions
- Artificial Intelligence * Message Handling * State Machine
- gdx-freetype
-
Physics
* Box2D
* Bullet Physics * [Setup](../Bullet Wrapper - Setup) * [Using the wrapper](../Bullet Wrapper - Using the wrapper) * [Using models](../Bullet Wrapper - Using models) * [Contact callbacks](../Bullet Wrapper - Contact callbacks) * [Custom classes](../Bullet Wrapper - Custom classes) * [Debugging](../Bullet Wrapper - Debugging)
- Using libgdx with other JVM languages
- Third Party Services
- Articles