Пример #1
0
  @Override
  public void initialize(Context context, ProgramManager programManager) {
    lineShaderProgram = programManager.getProgram(ProgramManager.PROGRAM.LINE);

    textureDataHandler = TextureLoader.loadTexture(context, R.drawable.game209, GLES20.GL_LINEAR);
    GLES20.glGenerateMipmap(GLES20.GL_TEXTURE_2D);

    int socketTextureDataHandler =
        TextureLoader.loadTexture(context, R.drawable.node_socket, GLES20.GL_LINEAR);
    GLES20.glGenerateMipmap(GLES20.GL_TEXTURE_2D);

    mCorrectNodeTextureHandle =
        TextureLoader.loadTexture(context, R.drawable.game209, GLES20.GL_LINEAR);
    GLES20.glGenerateMipmap(GLES20.GL_TEXTURE_2D);

    mWrongNodeTextureHandle =
        TextureLoader.loadTexture(context, R.drawable.game210, GLES20.GL_LINEAR);
    GLES20.glGenerateMipmap(GLES20.GL_TEXTURE_2D);

    mNodeBatch = new SpriteBatch(SpriteBatch.COLORED_VERTEX_3D, textureDataHandler);
    mNodeBatch.setFiltered(true);
    mNodeBatch.initialize(context, programManager);

    mSocketBatch = new SpriteBatch(SpriteBatch.VERTEX_3D, socketTextureDataHandler);
    mSocketBatch.setFiltered(true);
    mSocketBatch.useDepthTest(false);
    mSocketBatch.initialize(context, programManager);

    mConnectionsBatch = new Line3DBatch();
    mConnectionsBatch.initialize(context, programManager);

    mDottedBatch = new DottedLine3DBatch(0.7f, 0.8f);
    mDottedBatch.initialize(context, programManager);

    mSprite = new Sprite(Vector3f.getZero(), 2.0f, 2.0f);
    mSprite.setFiltered(true);
    mSprite.setTexture(textureDataHandler);
    mSprite.initialize(context, programManager);

    for (int i = 0; i < nodes.length; i++) {
      nodes[i].getSprite().setFiltered(true).initialize(context, programManager);
    }

    super.initialize(context, programManager);
  }
Пример #2
0
  @Override
  public void initialize(Context context, ProgramManager programManager) {
    this.mTextureHandle = TextureLoader.loadTexture(mBitmap);

    super.initialize(context, programManager);
  }