use of com.badlogic.gdx.Application in project libgdx by libgdx.
the class ShaderProgram method getManagedStatus.
public static String getManagedStatus() {
StringBuilder builder = new StringBuilder();
int i = 0;
builder.append("Managed shaders/app: { ");
for (Application app : shaders.keys()) {
builder.append(shaders.get(app).size);
builder.append(" ");
}
builder.append("}");
return builder.toString();
}
use of com.badlogic.gdx.Application in project libgdx by libgdx.
the class Controllers method initialize.
private static void initialize() {
if (managers.containsKey(Gdx.app))
return;
String className = null;
ApplicationType type = Gdx.app.getType();
ControllerManager manager = null;
if (type == ApplicationType.Android) {
if (Gdx.app.getVersion() >= 12) {
className = "com.badlogic.gdx.controllers.android.AndroidControllers";
} else {
Gdx.app.log(TAG, "No controller manager is available for Android versions < API level 12");
manager = new ControllerManagerStub();
}
} else if (type == ApplicationType.Desktop) {
if (Gdx.graphics.getType() == GraphicsType.LWJGL3) {
className = "com.badlogic.gdx.controllers.lwjgl3.Lwjgl3ControllerManager";
} else {
className = "com.badlogic.gdx.controllers.desktop.DesktopControllerManager";
}
} else if (type == ApplicationType.WebGL) {
className = "com.badlogic.gdx.controllers.gwt.GwtControllers";
} else {
Gdx.app.log(TAG, "No controller manager is available for: " + Gdx.app.getType());
manager = new ControllerManagerStub();
}
if (manager == null) {
try {
Class controllerManagerClass = ClassReflection.forName(className);
manager = (ControllerManager) ClassReflection.newInstance(controllerManagerClass);
} catch (Throwable ex) {
throw new GdxRuntimeException("Error creating controller manager: " + className, ex);
}
}
managers.put(Gdx.app, manager);
final Application app = Gdx.app;
Gdx.app.addLifecycleListener(new LifecycleListener() {
@Override
public void resume() {
}
@Override
public void pause() {
}
@Override
public void dispose() {
managers.remove(app);
Gdx.app.log(TAG, "removed manager for application, " + managers.size + " managers active");
}
});
Gdx.app.log(TAG, "added manager for application, " + managers.size + " managers active");
}
use of com.badlogic.gdx.Application in project libgdx by libgdx.
the class TextureArray method getManagedStatus.
public static String getManagedStatus() {
StringBuilder builder = new StringBuilder();
builder.append("Managed TextureArrays/app: { ");
for (Application app : managedTextureArrays.keySet()) {
builder.append(managedTextureArrays.get(app).size);
builder.append(" ");
}
builder.append("}");
return builder.toString();
}
use of com.badlogic.gdx.Application in project libgdx by libgdx.
the class Cubemap method getManagedStatus.
public static String getManagedStatus() {
StringBuilder builder = new StringBuilder();
builder.append("Managed cubemap/app: { ");
for (Application app : managedCubemaps.keySet()) {
builder.append(managedCubemaps.get(app).size);
builder.append(" ");
}
builder.append("}");
return builder.toString();
}
use of com.badlogic.gdx.Application in project libgdx by libgdx.
the class Mesh method getManagedStatus.
public static String getManagedStatus() {
StringBuilder builder = new StringBuilder();
int i = 0;
builder.append("Managed meshes/app: { ");
for (Application app : meshes.keySet()) {
builder.append(meshes.get(app).size);
builder.append(" ");
}
builder.append("}");
return builder.toString();
}
Aggregations