home *** CD-ROM | disk | FTP | other *** search
/ Microsoft DirectX SDK 7.0 / Dx7.bin / DXF / samples / multimedia / vbsamples / ddraw / src / ddblend / satmainform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-07-26  |  2.7 KB  |  80 lines

  1. VERSION 5.00
  2. Begin VB.Form MainForm 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    BorderStyle     =   0  'None
  6.    Caption         =   "DDBlend Sample"
  7.    ClientHeight    =   3195
  8.    ClientLeft      =   0
  9.    ClientTop       =   0
  10.    ClientWidth     =   4680
  11.    BeginProperty Font 
  12.       Name            =   "Times New Roman"
  13.       Size            =   15.75
  14.       Charset         =   0
  15.       Weight          =   400
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    Icon            =   "satMainForm.frx":0000
  21.    LinkTopic       =   "Form1"
  22.    ScaleHeight     =   213
  23.    ScaleMode       =   3  'Pixel
  24.    ScaleWidth      =   312
  25.    StartUpPosition =   3  'Windows Default
  26. Attribute VB_Name = "MainForm"
  27. Attribute VB_GlobalNameSpace = False
  28. Attribute VB_Creatable = False
  29. Attribute VB_PredeclaredId = True
  30. Attribute VB_Exposed = False
  31. Dim BlitRect As RECT
  32. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  33.     Select Case KeyCode
  34.         Case vbKeyEscape
  35.             ExitLoop = True
  36.         Case vbKeyPageUp
  37.             BlurFactor = BlurFactor + 1
  38.         Case vbKeyPageDown
  39.             BlurFactor = BlurFactor - 1
  40.             If BlurFactor < 1 Then BlurFactor = 1
  41.         Case vbKeyHome
  42.             ParticleCount = ParticleCount + 1000
  43.             If ParticleCount > MaxParticles Then ParticleCount = MaxParticles
  44.         Case vbKeyEnd
  45.             ParticleCount = ParticleCount - 1000
  46.             If ParticleCount < 0 Then ParticleCount = 0
  47.         Case vbKeySpace
  48.             If PaletteNum = 0 Then PaletteNum = 1 Else PaletteNum = 0
  49.         Case vbKeyInsert
  50.             CurrentDisplayMode = CurrentDisplayMode + 1
  51.             If CurrentDisplayMode > UBound(DisplayMode) Then
  52.                 CurrentDisplayMode = 0
  53.             End If
  54.             TerminateDX
  55.             InitializeDX
  56.         Case vbKeyDelete
  57.             CurrentDisplayMode = CurrentDisplayMode - 1
  58.             If CurrentDisplayMode < 0 Then
  59.                 CurrentDisplayMode = UBound(DisplayMode)
  60.             End If
  61.             TerminateDX
  62.             InitializeDX
  63.     End Select
  64. End Sub
  65. Public Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  66.     MX = X
  67.     MY = Y
  68.     If MX < 1 Then MX = 1 Else If _
  69.         MX > ScreenWidth - 2 Then MX = ScreenWidth - 2
  70.     If MY < 1 Then MY = 1 Else If _
  71.         MY > ScreenHeight - 2 Then MY = ScreenHeight - 2
  72. End Sub
  73. Public Sub Form_Paint()
  74.     On Error Resume Next
  75.     BlitRect.Right = DDSBackDesc.lWidth
  76.     BlitRect.Bottom = DDSBackDesc.lHeight
  77.     DDSFront.Blt BlitRect, DDSBack, BlitRect, DDBLT_WAIT
  78.     DoEvents
  79. End Sub
  80.