|
|
@ -41,11 +41,14 @@ |
|
|
|
|
|
|
|
|
|
|
|
<PropertyGroup> |
|
|
|
<PropertyGroup> |
|
|
|
<OutputType>WinExe</OutputType> |
|
|
|
<OutputType>WinExe</OutputType> |
|
|
|
|
|
|
|
<StartupObject>${StandardNamespace}.MainClass</StartupObject> |
|
|
|
</PropertyGroup> |
|
|
|
</PropertyGroup> |
|
|
|
|
|
|
|
|
|
|
|
<Files> |
|
|
|
<Files> |
|
|
|
<File name="MainClass.vb"><![CDATA[${StandardHeader.VBNET} |
|
|
|
<File name="MainClass.vb"><![CDATA[${StandardHeader.VBNET} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Imports System.ComponentModel |
|
|
|
|
|
|
|
|
|
|
|
' This is the main class of my Direct3D application |
|
|
|
' This is the main class of my Direct3D application |
|
|
|
Public Class MainClass |
|
|
|
Public Class MainClass |
|
|
|
Inherits Form |
|
|
|
Inherits Form |
|
|
@ -104,7 +107,7 @@ Public Class MainClass |
|
|
|
|
|
|
|
|
|
|
|
' This method renders the scene |
|
|
|
' This method renders the scene |
|
|
|
Protected Overridable Sub Render() |
|
|
|
Protected Overridable Sub Render() |
|
|
|
If Not device Is Nothing |
|
|
|
If Not device Is Nothing Then |
|
|
|
device.Clear(ClearFlags.Target, Color.Blue, 1.0f, 0) |
|
|
|
device.Clear(ClearFlags.Target, Color.Blue, 1.0f, 0) |
|
|
|
device.BeginScene() |
|
|
|
device.BeginScene() |
|
|
|
|
|
|
|
|
|
|
@ -131,7 +134,7 @@ Public Class MainClass |
|
|
|
|
|
|
|
|
|
|
|
Protected Overrides Sub OnKeyPress(e As KeyPressEventArgs) |
|
|
|
Protected Overrides Sub OnKeyPress(e As KeyPressEventArgs) |
|
|
|
MyBase.OnKeyPress(e) |
|
|
|
MyBase.OnKeyPress(e) |
|
|
|
If AscW(e.KeyChar) = CInt(Keys.Escape) |
|
|
|
If AscW(e.KeyChar) = CInt(Keys.Escape) Then |
|
|
|
Close() |
|
|
|
Close() |
|
|
|
End If |
|
|
|
End If |
|
|
|
End Sub |
|
|
|
End Sub |
|
|
@ -140,7 +143,7 @@ Public Class MainClass |
|
|
|
Shared Sub Main() |
|
|
|
Shared Sub Main() |
|
|
|
Dim mainClass As New MainClass() |
|
|
|
Dim mainClass As New MainClass() |
|
|
|
|
|
|
|
|
|
|
|
If Not mainClass.InitializeGraphics() |
|
|
|
If Not mainClass.InitializeGraphics() Then |
|
|
|
MessageBox.Show("Error while initializing Direct3D") |
|
|
|
MessageBox.Show("Error while initializing Direct3D") |
|
|
|
Return |
|
|
|
Return |
|
|
|
End If |
|
|
|
End If |
|
|
|