"cTV3DEngine" is a custom class made by me. it is not the same name as
TVEngineAnywhay here is my cTV3DEngine:
Imports MTV3D65
Public Class cTV3DEngine
Public Sub InitTVEngine()
TV = New TVEngine
TVdi = New TVDeviceInfo
Scene = New TVScene
Mat = New TVMaterialFactory
Tex = New TVTextureFactory
Inp = New TVInputEngine
GraphicFX = New TVGraphicEffect
Atmos = New TVAtmosphere
LightEngine = New TVLightEngine
Screen2D = New TVScreen2DImmediate
Text2D = New TVScreen2DText
Globals = New TVGlobals
Maths = New TVMathLibrary
CameraFactory = New TVCameraFactory
InitTVEngineWindow()
End Sub
Private Sub InitTVEngineWindow()
With TV
If MySettings.MISC_IsDebug = 1 Then
.SetDebugMode(True)
.SetDebugFile(Windows.Forms.Application.StartupPath & "\DebugLog.txt")
Else
.SetDebugMode(False)
End If
.SetAngleSystem(CONST_TV_ANGLE.TV_ANGLE_DEGREE)
.SetSearchDirectory(Windows.Forms.Application.StartupPath)
'.DisplayFPS(False)
.SetWatermarkParameters(CONST_TV_WATERMARKPLACE.TV_WATERMARK_TOPRIGHT, 0.5)
If MySettings.VIDEO_IsFullScreen = 0 Then
frmMain.Width = MySettings.VIDEO_ResX
frmMain.Height = MySettings.VIDEO_ResY
.Init3DWindowed(frmMain.Handle)
Else
.Init3DFullscreen(MySettings.VIDEO_ResX, MySettings.VIDEO_ResY, 32, True, False, CONST_TV_DEPTHBUFFERFORMAT.TV_DEPTHBUFFER_BESTBUFFER, 1, frmMain.Handle)
End If
If MySettings.VIDEO_AA = 0 Then
.SetAntialiasing(False, CONST_TV_MULTISAMPLE_TYPE.TV_MULTISAMPLE_NONE)
ElseIf MySettings.VIDEO_AA = 2 Then
.SetAntialiasing(True, CONST_TV_MULTISAMPLE_TYPE.TV_MULTISAMPLE_2_SAMPLES)
ElseIf MySettings.VIDEO_AA = 3 Then
.SetAntialiasing(True, CONST_TV_MULTISAMPLE_TYPE.TV_MULTISAMPLE_3_SAMPLES)
ElseIf MySettings.VIDEO_AA = 4 Then
.SetAntialiasing(True, CONST_TV_MULTISAMPLE_TYPE.TV_MULTISAMPLE_4_SAMPLES)
End If
If MySettings.VIDEO_VSync = 1 Then
.SetVSync(True)
Else
.SetVSync(False)
End If
.ShowWinCursor(True)
End With
Inp.Initialize(True, True)
With Scene
.SetAutoTransColor(CONST_TV_COLORKEY.TV_COLORKEY_USE_ALPHA_CHANNEL)
.SetDepthBuffer(CONST_TV_DEPTHBUFFER.TV_WBUFFER)
.SetRenderMode(CONST_TV_RENDERMODE.TV_SOLID)
.SetBackgroundColor(0, 0, 0)
.SetTextureFilter(CONST_TV_TEXTUREFILTER.TV_FILTER_ANISOTROPIC)
End With
GraphicFX.ChangeGamma(1.0!)
Screen2D.Settings_SetTextureFilter(CONST_TV_TEXTUREFILTER.TV_FILTER_ANISOTROPIC)
Tex.SetTextureMode(CONST_TV_TEXTUREMODE.TV_TEXTUREMODE_BETTER)
Text2D.TextureFont_Create("font_tex1", "Arial", 10, True, False, False, False)
Text2D.TextureFont_Create("font_tex2", "Arial", 30, True, False, False, False, True)
End Sub
Public Sub EndEngine()
TV = Nothing
End
End Sub
End Class
There are 2 Subs:
InitTVEngine and
InitTVEngineWindow. First time this 2 functions were called when I had a
New sub:
Public Sub New()
InitTVEngine()
InitTVEngineWindow()
End Sub
But when I have tried to Init in fullscreen... a blank black screen was shown.