#==============================================================================
#  Virtual_FullScreen  and FullScreen.dll v1.03
#------------------------------------------------------------------------------
# @̃XNvggpꍇ́AvWFNgSystemtH_
# uFullScreen.dllvĂB
#  
# @̃XNvg&DLL𓱓ƃcN[VX AceftHg̃tXN[؂
# ɂȂAF5L[(ftHg)ŉ𑜓x̂ȂztXN[[h
# EBhE[h̐؂ւs悤ɂȂ܂B
# 
# ӎ@
# @GfB^́utXN[ŋNṽIvV͎w肵ȂłB
# NɃWXgɃtXN[tO΂𖳌ċN܂A
# 肪\邩܂i؁j
# 
# @̃XNvg&DLL̗pɂēɃCZX\L͕Kv܂B
# Ĕzzꍇɂ͈ꎟzzihttp://inatsuka.com/)\LĂB
# ςčĔzzꍇɂ́Aϕł邱Ƃ𖾋LĂB
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@(C)Inatsuka Haru 2016~
#==============================================================================
module Virtual_FullScreen
  
  #DLLg
  @@Init = Win32API.new('System\\FullScreen.dll', 'Init', 'p i i', 'i')
  @@ScreenModeSwitch = Win32API.new('System\\FullScreen.dll', 'ScreenModeSwitch', 'v', 'i')
  @@FullScreen = Win32API.new('System\\FullScreen.dll', 'FullScreen', 'v', 'i')
  @@Window = Win32API.new('System\\FullScreen.dll', 'Window', 'v', 'i')

  module_function
  
  #cN[̃EBhEnh擾
  def GetHWND
    getPrivateProfileString = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
    findWindow = Win32API.new('user32', 'FindWindow', %w(p p), 'l')
    game_name = "\0"*256
    getPrivateProfileString.call("Game","Title","",game_name,255,".\\Game.ini")
    return findWindow.call("RGSS Player",game_name)
  end
  
  #֐
  def Init
    return @@Init.call(GetHWND(),Graphics.width,Graphics.height)
  end
  
  #EBhEԂȂtXN[ɁAtXN[ԂȂEBhEɂ
  def ScreenModeSwitch
    return @@ScreenModeSwitch.call()
  end
  
  #tXN[[hɂ֐
  def FullScreen
    return @@FullScreen.call()
  end

  #EBhE[hɂ֐
  def Window
    return @@Window.call()
  end
   
end

#^Cgʂn܂珉
class Scene_Title < Scene_Base
  alias window_init start
  def start
    window_init
    Virtual_FullScreen.Init
  end
end

#{^ƃXN[[h؂ւ
class Scene_Base
  alias mode_change_check update
  def update
    mode_change_check
    #XN[[h؂ւɎgpL[ύXꍇA
    #L̃{^V{ĂBftHg(:F5)
    if Input.trigger?(:F5)
      Virtual_FullScreen.ScreenModeSwitch()
    end
  end
end