Пример #1
0
func (c *graphicsContext) needsRestoring(context *opengl.Context) (bool, error) {
	// FlushCommands is required because c.offscreen.impl might not have an actual texture.
	if err := graphics.FlushCommands(context); err != nil {
		return false, err
	}
	return c.offscreen.impl.isInvalidated(context), nil
}
Пример #2
0
func (c *graphicsContext) drawToDefaultRenderTarget(context *opengl.Context) error {
	if err := c.screen.Clear(); err != nil {
		return err
	}
	if err := drawWithFittingScale(c.screen, c.offscreen2); err != nil {
		return err
	}
	if err := graphics.FlushCommands(context); err != nil {
		return err
	}
	return nil
}