home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "SpriteFuncs"
- Option Explicit
-
- Global Const PS_SOLID = 0 ' Solid pen style.
-
- #If Win32 Then ' 32-bit VB.
- Type POINTAPI
- x As Long
- y As Long
- End Type
-
- Type BITMAP ' 24 bytes
- bmType As Long
- bmWidth As Long
- bmHeight As Long
- bmWidthBytes As Long
- bmPlanes As Integer
- bmBitsPixel As Integer
- bmBits As Long
- End Type
- Global Const BITMAP_SIZE = 24
- Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
- Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
- Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
- Declare Function GetTickCount Lib "kernel32" () As Long
- Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
- Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
- Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
- Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
- Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
- #Else ' 16-bit VB.
- Type POINTAPI
- x As Integer
- y As Integer
- End Type
-
- Type BITMAP ' 14 bytes
- bmType As Integer
- bmWidth As Integer
- bmHeight As Integer
- bmWidthBytes As Integer
- bmPlanes As String * 1
- bmBitsPixel As String * 1
- bmBits As Long
- End Type
- Global Const BITMAP_SIZE = 14
- Declare Function GetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
- Declare Function SetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
- Declare Function GetObject Lib "GDI" (ByVal hObject As Integer, ByVal nCount As Integer, lpObject As Any) As Integer
- Declare Function GetTickCount Lib "User" () As Long
- Declare Function Polygon Lib "GDI" (ByVal hdc As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
- Declare Function CreatePen Lib "GDI" (ByVal nPenStyle As Integer, ByVal nWidth As Integer, ByVal crColor As Long) As Integer
- Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
- Declare Function SelectObject Lib "GDI" (ByVal hdc As Integer, ByVal hObject As Integer) As Integer
- Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
- #End If
-
- ' ************************************************
- ' Pause until GetTickCount shows the indicated
- ' time. This is accurate to within one clock tick
- ' (55 ms), not counting variability in DoEvents
- ' and Windows itself.
- ' ************************************************
- Sub WaitTill(next_time As Long)
- Do
- DoEvents
- Loop While GetTickCount() < next_time
- End Sub
-
-
-