mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-24 01:42:05 +01:00
parent
f63a757b1e
commit
6940435c03
61
run.go
61
run.go
@ -297,25 +297,6 @@ type RunGameOptions struct {
|
|||||||
|
|
||||||
// X11InstanceName is an instance name in the ICCCM WM_CLASS window property.
|
// X11InstanceName is an instance name in the ICCCM WM_CLASS window property.
|
||||||
X11InstanceName string
|
X11InstanceName string
|
||||||
|
|
||||||
// StrictContextRestration indicates whether the context lost should be restored strictly by Ebitengine or not.
|
|
||||||
//
|
|
||||||
// StrictContextRestration is available only on Android. Otherwise, StrictContextRestration is ignored.
|
|
||||||
// Thus, StrictContextRestration should be used with mobile.SetGameWithOptions, rather than RunGameWithOptions.
|
|
||||||
//
|
|
||||||
// In Android, Ebitengien uses `GLSurfaceView`'s `setPreserveEGLContextOnPause(true)`.
|
|
||||||
// This works in most cases, but it is still possible that the context is lost in some minor cases.
|
|
||||||
//
|
|
||||||
// When StrictContextRestration is true, Ebitengine tries to restore the context more strictly
|
|
||||||
// for such minor cases.
|
|
||||||
// However, this might cause a performance issue since Ebitengine tries to keep all the information
|
|
||||||
// to restore the context.
|
|
||||||
//
|
|
||||||
// When StrictContextRestration is false, Ebitengine does nothing special to restore the context and
|
|
||||||
// relies on the OS's behavior.
|
|
||||||
//
|
|
||||||
// The default (zero) value is false.
|
|
||||||
StrictContextRestration bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunGameWithOptions starts the main loop and runs the game with the specified options.
|
// RunGameWithOptions starts the main loop and runs the game with the specified options.
|
||||||
@ -734,17 +715,39 @@ func toUIRunOptions(options *RunGameOptions) *ui.RunOptions {
|
|||||||
if options.X11InstanceName == "" {
|
if options.X11InstanceName == "" {
|
||||||
options.X11InstanceName = defaultX11InstanceName
|
options.X11InstanceName = defaultX11InstanceName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ui.RunOptions.StrictContextRestoration is not used so far (#3098).
|
||||||
|
// This might be reused in the future.
|
||||||
|
// The original comment for StrictContextRestration is as follows:
|
||||||
|
//
|
||||||
|
// StrictContextRestration indicates whether the context lost should be restored strictly by Ebitengine or not.
|
||||||
|
//
|
||||||
|
// StrictContextRestration is available only on Android. Otherwise, StrictContextRestration is ignored.
|
||||||
|
// Thus, StrictContextRestration should be used with mobile.SetGameWithOptions, rather than RunGameWithOptions.
|
||||||
|
//
|
||||||
|
// In Android, Ebitengien uses `GLSurfaceView`'s `setPreserveEGLContextOnPause(true)`.
|
||||||
|
// This works in most cases, but it is still possible that the context is lost in some minor cases.
|
||||||
|
//
|
||||||
|
// When StrictContextRestration is true, Ebitengine tries to restore the context more strictly
|
||||||
|
// for such minor cases.
|
||||||
|
// However, this might cause a performance issue since Ebitengine tries to keep all the information
|
||||||
|
// to restore the context.
|
||||||
|
//
|
||||||
|
// When StrictContextRestration is false, Ebitengine does nothing special to restore the context and
|
||||||
|
// relies on the OS's behavior.
|
||||||
|
//
|
||||||
|
// The default (zero) value is false.
|
||||||
|
|
||||||
return &ui.RunOptions{
|
return &ui.RunOptions{
|
||||||
GraphicsLibrary: ui.GraphicsLibrary(options.GraphicsLibrary),
|
GraphicsLibrary: ui.GraphicsLibrary(options.GraphicsLibrary),
|
||||||
InitUnfocused: options.InitUnfocused,
|
InitUnfocused: options.InitUnfocused,
|
||||||
ScreenTransparent: options.ScreenTransparent,
|
ScreenTransparent: options.ScreenTransparent,
|
||||||
SkipTaskbar: options.SkipTaskbar,
|
SkipTaskbar: options.SkipTaskbar,
|
||||||
SingleThread: options.SingleThread,
|
SingleThread: options.SingleThread,
|
||||||
DisableHiDPI: options.DisableHiDPI,
|
DisableHiDPI: options.DisableHiDPI,
|
||||||
ColorSpace: graphicsdriver.ColorSpace(options.ColorSpace),
|
ColorSpace: graphicsdriver.ColorSpace(options.ColorSpace),
|
||||||
X11ClassName: options.X11ClassName,
|
X11ClassName: options.X11ClassName,
|
||||||
X11InstanceName: options.X11InstanceName,
|
X11InstanceName: options.X11InstanceName,
|
||||||
StrictContextRestoration: options.StrictContextRestration,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user