mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Updated the Visual Basic example of SFML.Net
This commit is contained in:
parent
2d705fee04
commit
f85accc99f
@ -23,7 +23,7 @@ Module OpenGL
|
|||||||
|
|
||||||
' Create a text to display
|
' Create a text to display
|
||||||
Dim text = New Text("SFML / OpenGL demo")
|
Dim text = New Text("SFML / OpenGL demo")
|
||||||
text.Position = New Vector2(250.0F, 450.0F)
|
text.Position = New Vector2f(250.0F, 450.0F)
|
||||||
text.Color = New Color(255, 255, 255, 170)
|
text.Color = New Color(255, 255, 255, 170)
|
||||||
|
|
||||||
' Load an OpenGL texture.
|
' Load an OpenGL texture.
|
||||||
@ -70,8 +70,8 @@ Module OpenGL
|
|||||||
Gl.glClear(Gl.GL_DEPTH_BUFFER_BIT)
|
Gl.glClear(Gl.GL_DEPTH_BUFFER_BIT)
|
||||||
|
|
||||||
' We get the position of the mouse cursor, so that we can move the box accordingly
|
' We get the position of the mouse cursor, so that we can move the box accordingly
|
||||||
Dim x = window.Input.GetMouseX() * 200.0F / window.Width - 100.0F
|
Dim x = window.GetCursorPosition().X * 200.0F / window.Width - 100.0F
|
||||||
Dim y = -window.Input.GetMouseY() * 200.0F / window.Height + 100.0F
|
Dim y = -window.GetCursorPosition().Y * 200.0F / window.Height + 100.0F
|
||||||
|
|
||||||
' Apply some transformations
|
' Apply some transformations
|
||||||
time += window.GetFrameTime() / 1000.0F
|
time += window.GetFrameTime() / 1000.0F
|
||||||
@ -146,7 +146,7 @@ Module OpenGL
|
|||||||
''' </summary>
|
''' </summary>
|
||||||
Sub App_KeyPressed(ByVal sender As Object, ByVal e As KeyEventArgs) Handles window.KeyPressed
|
Sub App_KeyPressed(ByVal sender As Object, ByVal e As KeyEventArgs) Handles window.KeyPressed
|
||||||
Dim window = CType(sender, RenderWindow)
|
Dim window = CType(sender, RenderWindow)
|
||||||
If e.Code = KeyCode.Escape Then
|
If e.Code = Keyboard.Key.Escape Then
|
||||||
window.Close()
|
window.Close()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
Loading…
Reference in New Issue
Block a user