forked from libgdx/libgdx
-
Notifications
You must be signed in to change notification settings - Fork 0
Querying
badlogic edited this page Sep 14, 2013
·
4 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.getApplicationType()
method returns the platform the application is currently running on:
switch(Gdx.app.getApplicationType()) {
case ApplicationType.Android:
// android specific code
case ApplicationType.Desktop:
// desktop specific code
case ApplicationType.WebGl:
/// HTML5 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:
int javaHeap = Gdx.app.getJavaHeap();
int nativeHeap = Gdx.app.getNativeHeap();
Both methods return the number of bytes currently in use on the respective heap.
-
Developer's Guide
- Introduction
- Goals & Features
- Community & Support
- Contributing
- Games Built with Libgdx
- Prerequisites
- Gradle Project Setup, Running, Debugging and Packaging
- Project Setup, Running & Debugging
- Third Party Services
- Working from Source
- Using libgdx with other JVM languages
- 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
- OpenGL ES Support * Configuration & Querying OpenGL ?? * Direct Access ?? * Utility Classes * Rendering Shapes * Textures & TextureRegions * Meshes * Shaders * Frame Buffer Objects
- 2D Graphics * SpriteBatch, TextureRegions, and Sprite * 2D Animation * Clipping, with the use of ScissorStack * Orthographic camera * Mapping Touch Coordinates ?? * Viewports * NinePatches * Bitmap Fonts * Distance field fonts * Using TextureAtlases * Pixmaps * Packing Atlases Offline * Packing Atlases at Runtime * 2D Particle Effects * Tile Maps * scene2d * scene2d.ui * Skin
- 3D Graphics * Quick Start * Models * Material and environment * 3D animations and skinning * Importing Blender models in LibGDX * Perspective Camera ?? * Picking ??
- Managing Your Assets
- Utilities
-
Math Utilities
- Interpolation
- Vectors, Matrices, Quaternions
- Circles, Planes, Rays, etc.
- Path interface & Splines
- Bounding Volumes ??
- Intersection & Overlap Testing ??
- Physics
- Tools
- Extensions
- Deploying your Application
- Building Libgdx ??
- Known Issues
- Articles
- Deprecated (May be outdated)