Imports System.Drawing

Imports AgkSharp


Friend Class Window

    #Region "Constructor(s)"

        Friend Sub New()

        End Sub

    #End Region


    #Region "Friend Methods"

        Friend Sub Initialze_Window(ByVal piWidth As Integer,
                                    ByVal piHeight As Integer,
                                    ByVal psWindowTitle As String,
                                    ByVal piClearColorR As Integer,
                                    ByVal piClearColorG As Integer,
                                    ByVal piClearColorB As Integer)

            ' set the window's dimensions
            If (piWidth.Equals(0) And piHeight.Equals(0)) Then
                AgkSharp.Agk.SetWindowSize(0, 0, 1)
            Else
                AgkSharp.Agk.SetWindowSize(piWidth, piHeight, 0)
            End If

            ' set the window's title
            AgkSharp.Agk.SetWindowTitle(psWindowTitle)

            ' set the aspect ration
            AgkSharp.Agk.SetDisplayAspect(1.0 * piWidth / piHeight)

            ' clear the screen to initial color
            AgkSharp.Agk.SetClearColor(piClearColorR, piClearColorG, piClearColorB)
            AgkSharp.Agk.ClearScreen()

            ' use vector fonts
            AgkSharp.Agk.UseNewDefaultFonts(1)
        End Sub


        Friend Function Create_WindowForm(ByVal piWidth As Integer,
                                          ByVal piHeight As Integer,
                                          ByVal psWindowTitle As String) As Windows.Forms.Form

            Dim loForm As New Windows.Forms.Form()


            loForm.ClientSize = New Size(piWidth, piHeight)
            loForm.Text = psWindowTitle
            loForm.StartPosition = Windows.Forms.FormStartPosition.CenterScreen

            If (piWidth.Equals(0) And piHeight.Equals(0)) Then
                loForm.WindowState = Windows.Forms.FormWindowState.Normal
                loForm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
                loForm.Bounds = Windows.Forms.Screen.PrimaryScreen.Bounds
            End If

            loForm.Show()

            Return (loForm)
        End Function

    #End Region

End Class
