fullscreen.go 560 B

123456789101112131415161718192021222324252627282930313233343536
  1. package UI
  2. import (
  3. "github.com/cuu/gogame/surface"
  4. "github.com/veandco/go-sdl2/sdl"
  5. "github.com/cuu/gogame/rect"
  6. )
  7. type FullScreen struct {
  8. Widget
  9. CanvasHWND *sdl.Surface
  10. HWND *sdl.Surface
  11. }
  12. func NewFullScreen() *FullScreen {
  13. p := &FullScreen{}
  14. p.Width = Width
  15. p.Height = Height
  16. return p
  17. }
  18. func (self *FullScreen) SwapAndShow() {
  19. if self.HWND != nil {
  20. rect_ := rect.Rect(self.PosX, self.PosY, self.Width, self.Height)
  21. surface.Blit(self.HWND, self.CanvasHWND, &rect_, nil)
  22. DisplayFlip()
  23. }
  24. }
  25. func (self *FullScreen) Draw() {
  26. }