Loffen
Well-known member
Cant get it workin (Crashes without errors)
My (VB.Net 2003) program crashes EVERYTIME i try to run it. I rewrote it a couple of times, I have read all posts from last page to page 5 (well, almost. I did exclude those not saying anything about errors). I ran some of the demos (theyre workin), I almost copyed and pasted the demo code (still no result). I am using dbmon.exe (dont understand what it want, so i attached a picture). Plus, I cant figure where the error(s) occurs, The window: opens, swaps to fullscreen (without changin color to Color.Navy), then crashes (withour errors).
Form1 code:
The engine:
My (VB.Net 2003) program crashes EVERYTIME i try to run it. I rewrote it a couple of times, I have read all posts from last page to page 5 (well, almost. I did exclude those not saying anything about errors). I ran some of the demos (theyre workin), I almost copyed and pasted the demo code (still no result). I am using dbmon.exe (dont understand what it want, so i attached a picture). Plus, I cant figure where the error(s) occurs, The window: opens, swaps to fullscreen (without changin color to Color.Navy), then crashes (withour errors).
Form1 code:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Show()
Engine = New Engine
Engine.FBackBufferWidth = 1280
Engine.FBackBufferHeight = 1024
Engine.FBackBufferFormat = Format.R5G6B5
Engine.FBackBufferCount = 1
Engine.FPresentInterval = PresentInterval.Immediate
Engine.FSwapEffect = SwapEffect.Copy
Engine.FCreateFlags = CreateFlags.SoftwareVertexProcessing
Engine.FDeviceType = DeviceType.Hardware
If Engine.InitDevice(Me) Then
FRunning = True
End If
While FRunning = True
Application.DoEvents()
Engine.Render()
Application.DoEvents()
End While
End
End Sub
The engine:
Code:
Public Class Engine
Public FBackBufferWidth As Integer
Public FBackBufferHeight As Integer
Public FBackBufferFormat As Format
Public FBackBufferCount As Integer
Public FPresentInterval As PresentInterval
Public FSwapEffect As SwapEffect
Public FCreateFlags As CreateFlags
Public FDeviceType As DeviceType
Private FRoot As Manager
Private FDevice As Device
Private FPP As PresentParameters
Private DeviceLost As Boolean
Public Function InitDevice(ByVal FTarget As System.Windows.Forms.Form)
FPP = New PresentParameters
FPP.BackBufferWidth = FBackBufferWidth
FPP.BackBufferHeight = FBackBufferHeight
FPP.BackBufferFormat = FBackBufferFormat
FPP.BackBufferCount = FBackBufferCount
FPP.Windowed = False
FPP.PresentationInterval = FPresentInterval
FPP.SwapEffect = FSwapEffect
FDevice = New Device(0, FDeviceType, FTarget, FCreateFlags, FPP)
DeviceLost = False
End Function
Public Function Render()
FDevice.Clear(ClearFlags.Target, Color.Navy, 1.0F, 0)
FDevice.BeginScene()
FDevice.EndScene()
FDevice.Present()
End Function
End Class
Attachments
Last edited by a moderator: