Glitch
Glitch

Reputation: 31

Can GWT ignore some lines of code?

I'm actually working on a project with LibGDX, and for some reason, I have to use some java code that can't be used by GWT. (Example : c.newInstance() or java.util.Timer)

I would like GWT to ignore some lines, and pass directly to the correct line for it.

For example :

@GWTignore  
nodeModel.newInstance(); <--- will be ignored
@GWTcorrect
ClassReflection.newInstance(nodeModel); <--- will be accepted

I precise, it's lines of code that I want to ignore, not classes. Do you think it is possible?

Thank you

Upvotes: 1

Views: 243

Answers (1)

dfour
dfour

Reputation: 1376

You can use Gdx.app.GetType()

if(Gdx.app.getType() == ApplicationType.WebGL){
        //do webgl stuff
    }else{
        //do non webgl stuff
    }

Upvotes: 1

Related Questions