Hmm. I did not know that OpenGL managed itself that way, last thing I want is to mess up the VSync. But anyways, I realize that using a game engine would make this significantly easier, but where's the fun in that? But I am stumped, please explain to me how I could create the surface before I make the calls.
On Thu, Jun 20, 2013 at 12:54 AM, a1 <[email protected]> wrote: > You are queening events from constructor so they may be executed before > context is created and bound (make current in render thread - if you check > GLSurfaceView you will notice that renderer thread is started when renderer > instance is set but egl will not be initialized until surface is attached, > but queued event may be processed anyway). Usually all resource > initialization is made in onSurfaceCreated callback. > > I also noticed this fragment: > > if (dt < 33) > > try { > > Thread.sleep(33 - dt); > > } catch (InterruptedException e) { > > System.err.println("Failed to limit FPS"); > > e.printStackTrace(); > > } > > else { > > > Never do that - openGL will throttle your rendering thread anyway (on > swap) and doing manual throttling is almost guarantee vsync miss. > > And last but not least - if you want to make game you should really use > some game engine (there are a lot of them: libgdx, andengine, jmonkeyengine > and probably more). Writing game engine is fun and all but it's much bigger > task than game itself. > > -- > Bart > > -- > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "Android Developers" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/android-developers/LLYWVT990y0/unsubscribe > . > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

