Browse Source

Fixed VB Direct3D project template.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2607 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
313121fcc9
  1. 9
      data/templates/project/VBNet/Direct3DProject.xpt

9
data/templates/project/VBNet/Direct3DProject.xpt

@ -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

Loading…
Cancel
Save