![]() |
|
Tipp 0145
|
Direct3D im Vollbild (Fullscreen Mode)
|
 |
|
Autor/Einsender: Datum: |
|
Alexander Csadek 03.11.2006 |
|
| Entwicklungsumgebung: |
|
VB.Net 2003 |
| DirectX-Version: |
|
DirectX 9 |
|
|
|
Um Direct3D im Vollbild laufen zu lassen, werden nur eine Handvoll Codezeilen benötigt.
Bei den PresentParameters wird die Eigenschaft Windowed auf False gestellt, der SwapEffect
gesetzt und die Bildschirmauflösung eingestellt. Dann kann schon der 3DDevice erzeugt werden und Direct3D läuft im Vollbild.
|
|
| |
Private Function InitializationDX() As Boolean
Dim myPresentParams As New PresentParameters
Try
'Darstellungsparameter einstellen für Vollbild
'der Übersichtlichkeit wegen wurde auf ZBuffer gänzlich
'verzichtet
myPresentParams.Windowed = False 'Vollbild
myPresentParams.SwapEffect = SwapEffect.Flip
myPresentParams.BackBufferFormat = Format.R5G6B5
myPresentParams.BackBufferWidth = 1024
myPresentParams.BackBufferHeight = 768
'Device erzeugen
gD3DDevice9 = New Device(0, DeviceType.Hardware, Me.Handle, _
CreateFlags.SoftwareVertexProcessing, myPresentParams)
Return True
Catch ex As Exception
Return False
End Try
End Function
|
|
|
|
|
|
Um diesen Tipp ausführen zu können, wird die DirectX 9 for Managed Code Runtime benötigt.
|
|
Dieses Beispiel funktioniert mit allen DirectX 9.0 SDK Versionen. Erstellt wurde es mit der folgenden Version:
|
|
Update DirectX 9.0 SDK (October 2005)
|
Pfad: C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.dll
Laufzeitversion: v1.1.4322
Assemblyversion: 1.0.2902.0
|
Pfad: C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.Direct3D.dll
Laufzeitversion: v1.1.4322
Assemblyversion: 1.0.2902.0
|
|
| Windows-Version |
| 98/SE |
 |
|
| ME |
 |
|
| NT |
 |
|
| 2000 |
 |
|
| XP |
 |
|
| Vista |
 |
|
| Win
7 |
 |
|
|
|
Download (7,3
kB)
|
Downloads bisher: [ 369 ]
|
|
|