Ejemplo n.º 1
0
  public static VideoSystem createCanvasVideoSystem(
      final Context aContext, final GameSystem aGameSystem) {
    final SurfaceProjection surfaceProjection = new SurfaceProjection();
    final AndroidGameView view =
        new AndroidGameView(
            aContext, SurfaceHolder.SURFACE_TYPE_HARDWARE, surfaceProjection, aGameSystem);

    final VideoSystem videoSystem = new VideoSystem();
    videoSystem.graphics = new SurfaceCanvasGraphics(surfaceProjection);
    videoSystem.screen = videoSystem.view = view;
    return videoSystem;
  }
Ejemplo n.º 2
0
  public static VideoSystem createOpenglVideoSystem(
      final Context aContext,
      final GameSystem aGameSystem,
      final PlatformContext aPlatformContext) {
    final SurfaceProjection surfaceProjection = new SurfaceProjection();

    final AndroidGameView view =
        new AndroidGameView(
            aContext, SurfaceHolder.SURFACE_TYPE_GPU, surfaceProjection, aGameSystem);

    final OpenglRenderer renderer =
        new OpenglRenderer(aGameSystem, aPlatformContext, surfaceProjection);

    final VideoSystem videoSystem = new VideoSystem();
    videoSystem.graphics = new OpenglGraphics(renderer);
    videoSystem.screen = videoSystem.view = view;
    return videoSystem;
  }