VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 5250 ClientLeft = 60 ClientTop = 345 ClientWidth = 6300 LinkTopic = "Form1" ScaleHeight = 5250 ScaleWidth = 6300 StartUpPosition = 3 'Windows Default End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim bRunning As Boolean Private Sub Form_Click() bRunning = False End Sub Private Sub Form_Load() Dim Dx As DirectX8 Dim D3D As Direct3D8 Dim D3DDevice As Direct3DDevice8 Dim DispMode As D3DDISPLAYMODE Dim D3DWindow As D3DPRESENT_PARAMETERS Set Dx = New DirectX8 Set D3D = Dx.Direct3DCreate() D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode D3DWindow.Windowed = 1 D3DWindow.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC D3DWindow.BackBufferFormat = DispMode.Format Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, _ D3DDEVTYPE_HAL, hWnd, _ D3DCREATE_SOFTWARE_VERTEXPROCESSING, _ D3DWindow) Me.Show bRunning = True Do While bRunning D3DDevice.Clear 0, ByVal 0, _ D3DCLEAR_TARGET, _ &HCCCCFF, 1#, 0 D3DDevice.BeginScene D3DDevice.EndScene D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0 DoEvents Loop Set D3DDevice = Nothing Set D3D = Nothing Set Dx = Nothing Unload Me End Sub