mi reputo anche piuttosto bravino con le directx è appunto quello che mi suscitava ilarità
poche dichiarazioni?
codice:
Option Explicit
Dim DX As New DirectX8
Dim D3D As Direct3D8
Dim device As Direct3DDevice8
Private Sub Form_Load()
Set D3D = DX.Direct3DCreate() 'crea D3d
Dim D3DWindow As D3DPRESENT_PARAMETERS 'descrive tutte le proprietà dello schermo
'sistema tutte le proprietà
D3DWindow.SwapEffect = D3DSWAPEFFECT_FLIP
D3DWindow.Windowed = 0
D3DWindow.BackBufferCount = 1
D3DWindow.BackBufferFormat = D3DFMT_R5G6B5 'bit di sistema
D3DWindow.BackBufferWidth = 1024
D3DWindow.BackBufferHeight = 768
D3DWindow.hDeviceWindow = Me.hWnd
D3DWindow.EnableAutoDepthStencil = 1
D3DWindow.AutoDepthStencilFormat = D3DFMT_D16 '16 bit Z-Buffer
'crea device
Set device = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Me.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)
Form1.Show
Call mainLoop
End Sub
Private Sub Form_DblClick()
'termina il programma
Set DX = Nothing
Set D3D = Nothing
Set device = Nothing
End
End Sub
Sub mainLoop()
1:
device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(0, 0, 255, 0), 1#, 0 'pulisce lo schermo
device.BeginScene 'inizia il rendering
device.EndScene 'fa terminare il rendering
device.Present ByVal 0, ByVal 0, 0, ByVal 0 'invia l'immagine al monitor
DoEvents
GoTo 1
End Sub
questo solo per creare lo schermo