Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I create my game element this way in my activity:

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  mGame = new Game(this);
  mGame.bootstrap();
  setContentView(CommonObject.sCommonParams.touch);
  mGame.loadTextures();
}

Then in my bootstrap I create my GLsurfaceView this way: (callingActivity is the this I passed when I created mGame)

CommonObject.sCommonParams.openGLView = new GLSurfaceView(callingActivity);
CommonObject.sCommonParams.openGLView.setRenderer(new GameRenderer());
CommonObject.sCommonParams.openGLView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);

Is it because I pass GLSurfaceView to a static object that it's not working?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Turns out I had to

setContentView(CommonObject.sCommonParams.openGLView);

for onSurfaceCreated to run. Which is sad since I was trying to avoid doing that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.