mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Compare commits
No commits in common. "a3fa7df1f37adc71c6613696cfe7dedb74dfac71" and "098380ce068d68a129ac99d22b81ab316bb0421e" have entirely different histories.
a3fa7df1f3
...
098380ce06
@ -29,12 +29,13 @@ import {{.JavaPkg}}.ebitenmobileview.RenderRequester;
|
||||
import {{.JavaPkg}}.{{.PrefixLower}}.EbitenView;
|
||||
|
||||
class EbitenSurfaceView extends GLSurfaceView implements RenderRequester {
|
||||
// As GLSurfaceView can be recreated, the states must be static (#3097).
|
||||
static private boolean errored_ = false;
|
||||
static private boolean onceSurfaceCreated_ = false;
|
||||
static private boolean contextLost_ = false;
|
||||
|
||||
private class EbitenRenderer implements GLSurfaceView.Renderer {
|
||||
|
||||
private boolean errored_ = false;
|
||||
private boolean onceSurfaceCreated_ = false;
|
||||
private boolean contextLost_ = false;
|
||||
|
||||
@Override
|
||||
public void onDrawFrame(GL10 gl) {
|
||||
if (errored_) {
|
||||
@ -99,7 +100,7 @@ class EbitenSurfaceView extends GLSurfaceView implements RenderRequester {
|
||||
}
|
||||
|
||||
private void onContextLost() {
|
||||
Log.e("Go", "The application was killed due to context loss");
|
||||
Log.v("Go", "Kill the application due to a context lost");
|
||||
// TODO: Relaunch this application for better UX (#805).
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
|
@ -81,8 +81,6 @@ type userInterfaceImpl struct {
|
||||
initWindowMaximized bool
|
||||
initWindowMousePassthrough bool
|
||||
|
||||
initUnfocused bool
|
||||
|
||||
// bufferOnceSwapped must be accessed from the main thread.
|
||||
bufferOnceSwapped bool
|
||||
|
||||
@ -1089,7 +1087,6 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error {
|
||||
return err
|
||||
}
|
||||
|
||||
u.initUnfocused = options.InitUnfocused
|
||||
focused := glfw.True
|
||||
if options.InitUnfocused {
|
||||
focused = glfw.False
|
||||
@ -1291,11 +1288,9 @@ func (u *UserInterface) update() (float64, float64, error) {
|
||||
if err = u.window.Show(); err != nil {
|
||||
return
|
||||
}
|
||||
if !u.initUnfocused {
|
||||
if err = u.window.Focus(); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user