I Get this when i'm in fullscreen mode and eveything is loaded up and I want to close out the program.. i'll show the end code. I do, do a Scene.DestroyAll befor i go back in to the menu just because eveything was showing up. and just be for i close out the program I had to TV.SwitchWindowed() back to window just to see why it wouldn't close. be for i had to hit Alt F4 to close it out..
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Soure: "MTV3D65"
stackTrace: at CTVEngine.__dtor(CTVEngine* )
at MTV3D65.TVEngine.Finalize()
Do Until DoBoolean = False
TV.Clear(False)
Scene.RenderAll(True)
' With Screen2DImmediate
'.Action_Begin2D()
' .Draw_Box(1, 1, 100, 100, Utilities.RGBA(1, 0, 0, 1))
Select Case SElECT_MENUNAME
Case "MainMenu"
Main_Menu()
Case "Options"
Options()
Case "SinglePlayerGame"
SinglePlayer()
Case "HercBay"
Herc_Bay()
Case "HercPick"
HercPick()
Case "HercAddWP"
HercAddWP()
Case "Userpick"
Userpick()
Case "UserAddWP"
UserAddWP()
Case "BRIEFING"
BRIEFING()
Case "Start Mission"
CreateLandscape() 'P.S. This Is where I load eveything up
PlayBoolean = True
SElECT_MENUNAME = "STRAT"
Case "STRAT"
Do Until PlayBoolean = False
TV.Clear(False)
Scene.RenderAll(True)
UpdatePlayer()
Physics.Simulate(TV.AccurateTimeElapsed() * 0.005F)
If InputEngine.IsKeyPressed(CONST_TV_KEY.TV_KEY_F1) = True Then
TVP.CloseAllPackages()
Scene.DestroyAllActors()
Scene.DestroyAllLandscapes()
Scene.DestroyAllMeshes()
Scene.DestroyAllMinimeshes()
Scene.DestroyAllParticleSystems()
TV.Clear()
TV.RenderToScreen()
SElECT_MENUNAME = "HercBay"
PlayBoolean = False
End If
TV.RenderToScreen()
Loop
End Select
TV.RenderToScreen()
If InputEngine.IsKeyPressed(CONST_TV_KEY.TV_KEY_ESCAPE) = True Then
TV.SwitchWindowed()
'TV.Init3DWindowed(Me.Handle.ToInt64, False)
End If
Application.DoEvents()
Loop
TV.SwitchWindowed()
' Set TV to Nothing
' TV.ReleaseAll()
TV = Nothing
' End the application
End
End Sub