eclipsemethodsconfigandengine

error method of getConfigChooserOptions


I am using AndEngine and Box2D in Eclipse. I use AndEngine GLES2 AnchorCenter.

public EngineOptions onCreateEngineOptions() {
    EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new FillResolutionPolicy(), new Camera(0, 0, cameraWidth, cameraHeight));
    engineOptions.getRenderOptions().setDithering(true);
    engineOptions.getRenderOptions().getConfigChooserOptions().setRequestedMultiSampling(true);
    engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
    return engineOptions;

The problem is I get an error for getConfigChooserOptions() and I have to make the method or add cast to method receiver. I tried looking for the answer and somebody said that AndEngine GLES2 branch doesn't have this method and it could be found in AndEngine GLES2 AnchorCenter. But I use AnchorCenter already. Do I have to create the method? I did reimport AndEngine GLES2 AnchorCenter, but now the error is I have to add cast to method receiver. How to solve this problem?


Solution

  • The answer you have found was correct. The method is available in GLES2 AnchorCenter branch and it works out of the box. Even though you believe you are using AnchorCenter branch, it seems you are not.

    Here's the RenderOptions class in GLES2:

    https://github.com/nicolasgramlich/AndEngine/blob/GLES2/src/org/andengine/engine/options/RenderOptions.java

    And here's the same class in the AnchorCenter branch:

    https://github.com/nicolasgramlich/AndEngine/blob/GLES2/src/org/andengine/engine/options/RenderOptions.java

    Make sure you are using the correct branch from GitHub and not some outdated JAR. Your code doesn't contain anything from any extension, so the basic project should be fine.

    Follow this tutorial when in doubt.