frmSplash.frm
资源名称:DirectX3D.rar [点击查看]
上传用户:tjgy203
上传日期:2013-07-04
资源大小:621k
文件大小:5k
源码类别:
DirextX编程
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmSplash
- BorderStyle = 1 'Fixed Single
- Caption = "游戏初始化"
- ClientHeight = 2820
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 3660
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2820
- ScaleWidth = 3660
- StartUpPosition = 2 '屏幕中心
- Begin VB.ComboBox cmbDetail
- Height = 315
- Left = 0
- Style = 2 'Dropdown List
- TabIndex = 5
- Top = 1800
- Width = 3615
- End
- Begin VB.ComboBox cmbRenderer
- Height = 300
- ItemData = "frmSplash.frx":0000
- Left = 0
- List = "frmSplash.frx":0002
- TabIndex = 2
- Text = "cmbRenderer"
- Top = 360
- Width = 3615
- End
- Begin VB.ComboBox cmbDisplay
- Height = 315
- Left = 0
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 1080
- Width = 3615
- End
- Begin VB.CommandButton cmdProceed
- Caption = "继续(&P)"
- Height = 375
- Left = 1080
- TabIndex = 0
- Top = 2280
- Width = 1335
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "选择游戏级别:"
- Height = 180
- Left = 0
- TabIndex = 6
- Top = 1560
- Width = 1170
- End
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "选择加速:"
- Height = 255
- Left = 0
- TabIndex = 4
- Top = 120
- Width = 3735
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "选择显示模式:"
- Height = 180
- Left = 0
- TabIndex = 3
- Top = 840
- Width = 1170
- End
- End
- Attribute VB_Name = "frmSplash"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '****************************************************************************
- '人人为我,我为人人
- '枕善居汉化收藏整理
- '发布日期:05/05/06
- '描 述:DirectX游戏编程-----3D机器人模型
- '网 站:http://www.mndsoft.com/
- 'e-mail:mnd@mndsoft.com
- 'OICQ : 88382850
- '****************************************************************************
- Dim e_Dx As New DirectX7
- Dim e_Dd As DirectDraw7
- Dim e_D3d As Direct3D7
- Dim e_Enum As Direct3DEnumDevices
- Dim I As Integer, sRenderer As String
- Dim e_DModes As DirectDrawEnumModes
- Dim e_ddsd As DDSURFACEDESC2
- Dim DisplayModesRef() As Byte
- Private Sub cmdProceed_Click()
- Dim sGuid As String, bDetail As Byte, Width As Integer, Height As Integer, BPP As Integer
- Select Case cmbRenderer.Text
- Case "硬件加速"
- sGuid = "IID_IDirect3DHALDevice"
- Case "软件加速"
- sGuid = "IID_IDirect3DRGBDevice"
- Case "未知设备"
- MsgBox "请选择设备."
- End Select
- Select Case cmbDetail.Text
- Case "低 (快速)"
- bDetail = 0
- Case "高 (慢)"
- bDetail = 1
- End Select
- e_DModes.GetItem DisplayModesRef(cmbDisplay.ListIndex), e_ddsd
- frmMain.init_dx CInt(e_ddsd.lWidth), CInt(e_ddsd.lHeight), CInt(e_ddsd.ddpfPixelFormat.lRGBBitCount), sGuid, CInt(bDetail) ', chkBuffer.Value
- End Sub
- Private Sub Form_Load()
- '''''''''GET RENDERER INFO
- Set e_Dd = e_Dx.DirectDrawCreate("")
- Set e_D3d = e_Dd.GetDirect3D
- Set e_Enum = e_D3d.GetDevicesEnum
- For I = 1 To e_Enum.GetCount()
- sRenderer = e_Enum.GetGuid(I)
- Select Case sRenderer
- Case "IID_IDirect3DRGBDevice"
- cmbRenderer.AddItem "软件加速", 0
- cmbRenderer.Text = "软件加速"
- Case "IID_IDirect3DHALDevice"
- cmbRenderer.AddItem "硬件加速", 0
- cmbRenderer.Text = "硬件加速"
- Case Else
- cmbRenderer.AddItem "未知设备", 0
- End Select
- Next I
- ''''''''''''''DETAIL LEVELS
- cmbDetail.AddItem "低 (快速)", 0
- cmbDetail.AddItem "高 (慢)", 1
- cmbDetail.Text = "高 (慢)"
- ''''''''''''''''RESOLUTIONS
- 'Dim DisplayModesEnum As DirectDrawEnumModes
- 'Dim ddsd2 As DDSURFACEDESC2
- 'Dim dd As DirectDraw7
- 'Set dd = m_dx.DirectDrawCreate(sGuid)
- e_Dd.SetCooperativeLevel Me.hWnd, DDSCL_NORMAL
- Dim Curr As Integer
- Set e_DModes = e_Dd.GetDisplayModesEnum(0, e_ddsd)
- For I = 1 To e_DModes.GetCount()
- e_DModes.GetItem I, e_ddsd
- If e_ddsd.lWidth > 600 And e_ddsd.lWidth <= 1024 Then
- If e_ddsd.lHeight > 400 And e_ddsd.lHeight <= 768 Then
- If e_ddsd.ddpfPixelFormat.lRGBBitCount >= 16 Then
- cmbDisplay.AddItem CStr(e_ddsd.lWidth) & "x" & CStr(e_ddsd.lHeight) & "x" & CStr(e_ddsd.ddpfPixelFormat.lRGBBitCount)
- cmbDisplay.Text = CStr(e_ddsd.lWidth) & "x" & CStr(e_ddsd.lHeight) & "x" & CStr(e_ddsd.ddpfPixelFormat.lRGBBitCount)
- ReDim Preserve DisplayModesRef(Curr)
- DisplayModesRef(Curr) = I
- Curr = Curr + 1
- End If
- End If
- End If
- Next
- End Sub