Planar DX/PCI, Dome M2/PCI, RX/PCI, Dome DX/PCI, Dome RX/PCI User Manual

Dome® Display Controllers
DX/PCI, M2/PCI, RX/PCI
Windows XP Windows 2000 Windows NT 4.0 Solaris 2.x
www.planar.com
Copyright © DOME® imaging systems, inc., 2002. All rights reserved. This document contains proprietary information of DOME imaging
systems, inc. It is the exclusive property of DOME. It may not be reproduced or transmitted, in whole or in part, without a written agreement from DOME. No patent or other license is granted to this information.
The software, if any, described in this document is furnished under a license agreement. The software may not be used or copied except as provided in the license agreement.
DOME imaging systems, inc. provides this publication as is without war­ranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability or fitness for a particular purpose. DOME may revise this document from time to time without notice. Some states or jurisdictions do not allow disclaimer of express or implied warran­ties in certain transactions; therefore, this statement may not apply to you.
Information in this document about products not manufactured by DOME is provided without warranty or representation of any kind, and DOME will not be liable for any damages resulting from the use of such information.
DOME imaging systems, inc. 400 Fifth Avenue Waltham, MA 02451-8738 (781) 895-1155 phone (781) 895-1133 fax Internet address for product information: Internet address for sales information: Internet address for technical support: World Wide Web site:
www.dome.com
info@dome.com sales@dome.com support@dome.com
Part No. 41-DEVM-01 Product No. 55-M2PCI2, 55-RXPCI2, 55-DXPCI2 June 2002
DOME is a registered trademark and Calibration TQA, DIMPL, DimplX, M2/PCI, RX/PCI, and DX/PCI are trademarks of DOME imaging systems, inc. Microsoft, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or in other countries. PS/2 is a trademark of International Business Machines Corpora­tion. Sun and Solaris are trademarks or registered trademarks of Sun Micro­systems, Inc. in the United States and other countries. X Window System is a trademark of The Open Group.
Contents
iii
About This Guide
1
Board Architecture
DX/PCI Board Architecture 2 M2/PCI Board Architecture 3 RX/PCI Board Architecture 4 Gamma Correction and the 10-Bit DAC 5
Gamma correction 5 Accessing the gamma correction tables 6
2
Dynamic-Link Library
DLL Data Types 8
DOME types 8
Windows types and structures 8 Windows NT DLL 9 Windows 2000 DLL 10
Windows 2000 DLL modes 10
Changing displays in the Windows 2000 virtual desktop 12
vii
1
7
Using Functions in Multi-Monitor and Windows NT 4.0­Compatible Modes 13
Using functions that require HDC and
screen-number parameters 13
Using functions that do not include HDC and
screen-number parameters 14
Specific Functions for Windows 2000 in the DLL 15
iv
| Contents
DLL Functions 16
DGetDriverVersion 18
DGetDriverVersionMM 19
DGetLibraryVersion 21
DGetBoardType 22
DGetBoardTypeMM 24
DGetNumBoards 26
DGetNumScreens 27
DGetMaxScreens 28
DGetScreenDimensions 29
DGetScreenPlacement 31
DSetBrightness 33
DGetBrightness 34
DSetContrast 35
DGetContrast 36
DGetNumGCTBits 37
DGetNumGCTBitsMM 38
DGetNumGDIBits 39
DGetNumGDIBitsMM 40
DGetSisterDisplayRegPathMM 42
DGetSisterDisplayNumberMM 43
DDirectBlt 44
DGetPaletteTypeMM 46
DSetGCT 47
DGetGCT 49
DSetStartupGCT 51
DCancelStartupGCT 53
DGetRefreshRate 54
DGetRefreshRateMM 55
DCalibratorInit 56
DCalibratorMeasure 59
DGetFtLamScale 61
DSerialCmd 62
Contents |
v
3
DOME MDlib API Function Reference
MDlib API Types 66 MDlib API Structures 67
DMdVersion Structure 67
DMdCopyRect Structure 69
DMdFillRect Structure 70
DMdDev Structure 71 MDlib API Functions 73
DMdOpen 74
DMdFdOpen 75
Close 76
RefreshRate 77
FbVideo 78
MapFb 79
UnmapFb 81
FbSize 82
FbWidth 83
FbHeight 84
FbPitch 85
FbType 86
BitsPerPixel 87
CopyRects 88
FillRects 90
InitCmap 92
WriteCmap 93
UpdateCmap 95
ReadCmap 96
InitGCT 98
WriteGCT 99
UpdateGCT 101
ReadGCT 102
65
Index 103
About This Guide
The
Product Developer’s Guide
the DOME DX/PCI™, M2/PCI™, and RX/PCI™ display controllers (boards), as well as the data types and functions specific to DOME and Windows types and structures used in the dynamic-link library and to the MDlib API types and structures for Solaris.
Purpose
This guide explains how to develop applications with these libraries:
vii
describes the architecture of
• DOME
operating systems
• DOME® MDlib application programming interface for
Solaris™ operating systems
Audience
This guide serves developers who are writing software applications for the DOME boards. You should have programming experience with either Windows or Solaris operating systems.
Use this table to find the section related to your operating system.
For this operating system… Go to this section…
• Windows XP
• Windows 2000
• Windows NT® 4.0
mdpcint
dynamic-link library for Windows
Chapter 2, “Dynamic-Link Library” on page 7
®
Solaris 2.x Chapter 3, “DOME MDlib API
Function Reference” on page 65
viii
| About This Guide
Conventions
This documentation uses the conventions shown in this table.
This convention... Indicates...
Monospaced type
Italic type
Bold type File -> Open
<Key>
Computer code or directory; backslash (\) indicates continuation of the previous line of UNIX® code.
New or technical term, book title, or variable such as
Menu selection: Select the
Key name such as A note of important information regarding a
particular topic or procedure. A caution that can prevent potential
damage to hardware or software.
A helpful tip or an alternative method of performing a procedure.
x.
File
menu, then
<Enter>.
Open
.
What’s Inside
This table summarizes the organization of this guide.
This chapter… Provides…
About This Guide |
ix
Chapter 1 Board Architecture
Chapter 2 Dynamic-Link Library (Windows)
Chapter 3 DOME MDlib API Function Reference
(Solaris)
• Architecture drawings for the DX/PCI, M2/PCI, and RX/PCI boards
• An explanation of gamma correction and 10-bit DACs
• Detailed descriptions of the data types and functions of the DOME DLL for Windows operating systems
• An explanation of the DOME data types and detailed descriptions of each DLL function
• Logical organization of the functions; for example,
DSetGCT
is followed by
DGetGCT
• Detailed descriptions of the types, structures, and functions of the DOME MDlib API (Use these functions with Solaris operating systems only.)
• Logical organization of the functions, in the order of their appearance as members of the
DMdDev
structure
x
| About This Guide
Related Documentation
For more information about your board or related DOME products, refer to these books:
• DX/PCI Display Controller Installation Guide
• M2/PCI Display Controller Installation Guide
• RX/PCI Display Controller Installation Guide
• Calibration TQA User’s Guide
• DIMPL Library Reference
Board Architecture
In This Chapter
• DX/PCI Board Architecture 2
• M2/PCI Board Architecture 3
• RX/PCI Board Architecture 4
• Gamma Correction and the 10-Bit DAC 5
2
| Board Architecture
DX/PCI Board Architecture
The DX/PCI™ display controller (board) is a single- or dual-headed, 8-bit framebuffer with an 8-bit digital interface.
The figure below shows these significant features of the board architecture:
• A highly optimized PCI local bus that provides 32-bit or 64-bit, 66 MHz transfers at speeds exceeding 500 MB per second
• 32 MB of DDR SDRAM (double data rate synchronous dynamic random access memory) that supports a 3-megapixel grayscale or pseudocolor display and a 5-megapixel grayscale display
• Can drive two digital displays in portrait or landscape mode on the C3 flat-panel system and two digital displays in portrait mode on the C5 flat-panel system
Digital Video
DVI
DVI
Digital Video
64
PCI Interface
64-bit 66 MHz
ROM
DX board architecture
DVI Driver
Mesquite V
64
DVI Driver
128
32 MB
DDR SDRAM
M2/PCI Board Architecture
The M2/PCI™ display controller (board) is a single­or dual-headed, 8-bit framebuffer with a 10-bit DAC (digital-to-analog converter).
The figure below shows these significant features of the board architecture:
• A highly optimized PCI local bus that provides 64-bit, 66 MHz transfers at speeds exceeding 500 MB per second
• 32 MB of DDR SDRAM that supports an 8 bits per pixel grayscale or pseudocolor display and a 32 bit per pixel truecolor display
• Supports double buffering, overlay, and stereo configurations
M2/PCI Board Architecture |
3
• Can drive two analog displays in portrait or landscape mode.
RGB DAC
64
PCI Interface
64-bit 66 MHz
ROM
M2 board architecture
64
Mesquite V
RGB DAC
128
32 MB
DDR SDRAM
Analog Video
DVI
Analog Video
DVI
4
| Board Architecture
RX/PCI Board Architecture
The RX display controller is a dual-headed, 8-bit frame­buffer with a 10-bit DAC.
The figure below shows these significant features of the board architecture:
• A highly optimized PCI local bus that provides 64-bit, 66 MHz transfers at speeds exceeding 500 MB per second
• 32 MB of DDR SDRAM supports a 4- or 5-megapixel grayscale display (as well as double-buffered and/or stereo display)
• Can drive two analog displays in portrait or landscape mode
64
RX board architecture
PCI Interface
64-bit 66 MHz
ROM
Video
DAC
Mesquite V
64
Video
DAC
128
32 MB
DDR SDRAM
Gamma Correction and the 10-Bit DAC |
Gamma Correction and the 10-Bit DAC
All DOME display controllers use a 10-bit DAC in their video output circuitry. Nearly all competitive display boards use 8-bit DACs.
The DAC converts the digital image data stored in the board’s video memory to an analog signal that drives the display. An 8-bit DAC can send no more than 256 different analog values to the display, while a 10-bit DAC can provide up to 1024 values. An 8-bit DAC can therefore result in as much as a 30% reduction in gray shades available to display an image. With such a reduction, critical image details can be lost.
Displays do not produce a linear response across the full range of pixel values. If there are 256 possible analog values, the change in luminance from value 0 (zero) to value 1 (one) differs from the change of value 127 to 128. Likewise, doubling the pixel value sent to the display does not precisely double the brightness emitted.
5
Gamma correction
This nonlinearity can be corrected using a method known as
gamma correction
table compensates for the nonlinearity by adjusting the values sent to the display.
An 8-bit DAC can produce only 256 such values, and a nonlinear translation must sacrifice some of these values. For this reason, gamma correction performed with an 8-bit DAC sends substantially fewer than 256 distinct values to the display.
. With this technique, the DAC’s lookup
6
| Board Architecture
Accessing the gamma correction tables
The 10-bit DAC on the DOME boards can produce up to 1024 distinct analog values. Thus, the board can perform gamma correction and send 256 distinct pixel values to the display, to produce a truer, more accurate grayscale image.
The flat-panel method is somewhat different but still allows more than 256 display value. The interface to the flat-panel driver is the same as that for the traditional display boards.
You can access the
gamma correction tables
(GCTs) in both
Windows® and Solaris™ operating systems.
GCTs in Windows
If you are running a Windows operating system, use the dynamic link library (DLL) provided with the DOME Windows driver to set the GCT. For more information, see “DSetGCT” on page 47.
The Windows operating system uses 8-bit color. Once you set the GCT, the DOME Windows driver translates all palette changes to the 10-bit value.
GCTs in Solaris
If you are running a Solaris operating system, initialize the GCT to a linear ramp and load it into the hardware with the
InitGCT
function (page 98) of the MDlib API (application
programming interface).
Dynamic-Link Library
In This Chapter
• DLL Data Types 8
• Windows NT DLL 9
• Windows 2000 DLL 10
• Using Functions in Multi-Monitor and Windows NT 4.0-Compatible Modes 13
• Specific Functions for Windows 2000 in the DLL 15
• DLL Functions 16
8
| Dynamic-Link Library
DLL Data Types
The
mdpcint
functions that provide an application interface to specific driver functionality. This section describes the data types specific to DOME and the Windows types and structures used in the DLL.
DOME types
dynamic link library (DLL) is a group of
The standard C types of
char, int
different things to different compilers. The DOME types, however, are strictly defined as signed or unsigned and by byte size, as shown in this table.
Size Signed Unsigned
1 byte 2 bytes 4 bytes
SBYTE UBYTE
SWORD UWORD
SDWORD UDWORD
Windows types and structures
The DLL uses standard Windows types and structures, as shown in this table.
, and
long
can mean
Type or Structure Denition
DWORD
HDC
SIZE
POINT
Unsigned 4 bytes Handle to display-device context
SIZE
structure as defined on page 29
POINT
structure as defined on page 31
Windows NT DLL
Windows NT DLL |
9
All DOME Windows drivers include the
mdpcint.dll
library. This DLL provides an application interface to the driver.
When you work in Windows NT® 4.0-compatible mode, use only those functions without the MM suffix.
Other functions listed in this chapter are not available for the Windows NT operating system; these functions all have the MM suffix.
10
| Dynamic-Link Library
Windows 2000 DLL
All DOME Windows drivers include the mdpcint.dll library. This DLL provides an application interface to the driver.
The Windows® 2000 DLL has some significant differences from previous versions of the DLL. For example, the new version of mdpcint.dll is not backward-compatible. It does not run on the Windows NT 4.0 operating system. But, given a Windows NT 4.0-compatible screen configuration, programs written for Windows NT 4.0 will work unchanged under Windows 2000 with the new DLL.
The Windows 2000 DLL also applies to the Windows XP operating system. For an XP system, follow the instructions for the Windows 2000 DLL using your operating system.
Windows 2000 DLL modes
Most functions in the Windows 2000 DLL have these three modes:
• Full Windows NT 4.0-compatible mode
• Partial Windows NT 4.0-compatible mode
• Multi-monitor mode
Each function’s parameters determine the mode. Where possible, function names and parameters in the Windows 2000 DLL use the same names and parameters that they used in previous versions. The main difference among the modes is in the way applications use the parameters.
Windows 2000 DLL | 11
Full Windows NT 4.0-compatible mode
A system that is fully compatible with the Windows NT 4.0 operating system meets these criteria:
• All screens are driven by the same type of DOME board, all at the same resolution.
• All screens combine to make a rectangle with no gaps.
• All screens are in nonnegative space.
Partial Windows NT 4.0-compatible mode
Partial Windows NT 4.0-compatible mode includes these features:
• One system can include both DOME and other brands of boards.
• One system can run different DOME board types simultaneously.
• Screens do not have to combine to make a rectangle.
• All DOME screens are in nonnegative space.
When running in partial Windows NT 4.0-compatible mode, these Get routines return an error, unless all DOME displays have the same value:
DGetBoardType
DGetDriverVersion
DGetNumGCTBits
DGetRefreshRate
DGetNumScreens
returns the number of DOME screens only
(in all modes).
12 | Dynamic-Link Library
Multi-monitor mode
Multi-monitor mode works with any Windows 2000 or Windows XP desktop. Multi-monitor mode includes these features:
• One system can include both DOME and other brands of boards.
• One system can run different DOME board types simultaneously.
• One board can support different palette types on each display.
• Screens do not have to combine to make a rectangle.
• Screens can be unattached from the Windows desktop.
Changing displays in the Windows 2000 virtual desktop
If you change any of the display properties in the W indows 2000 virtual desktop (for example, if you change resolution, place­ment, or detachment), you must unload and then reload the DLL as follows:
• To unload the DLL, exit all programs that are using the DLL, including the DOME tab.
• To reload the DLL, start any program that accesses the DLL.
Using Functions in Multi-Monitor and Windows NT 4.0-Compatible Modes | 13
Using Functions in Multi-Monitor and Windows NT
4.0-Compatible Modes
Multi-monitor and the Windows NT 4.0-compatible modes treat functions differently depending on the function’s parameters. This section describes how functions work in these modes.
Using functions that require HDC and screen-number parameters
For functions that require both an HDC (handle to display­device context) and screen number, the modes differ as follows:
• In Windows NT 4.0-compatible modes (full and partial), the HDC is from any screen display, and the screen number is the Windows NT 4.0 virtual screen number.
• Multi-monitor mode is signaled by combining the high bit in the screen-number parameter with the Windows 2000 display number. The application can create the hdc for the particular display and supply it as the first parameter to the functions. If the application wants the DLL to create the hdc, it uses NULL as the first parameter. Otherwise, the DLL creates an hdc using the display number. For an example of each method, see “DGetDriverVersionMM” on page 19.
• The hdc is always used for unattached displays.
The Windows NT 4.0 virtual screen number is the screen number assigned by the DLL; it is independent of the operating system. The DLL counts only DOME screens.
The Windows 2000 display number is the same as that passed to the GDI (graphical device interface) function EnumDisplay-
Devices
(the number shown via Identify minus one).
The GDI call uses 32-bit screen numbers, while the DOME DLL uses 16-bit screen numbers.
14 | Dynamic-Link Library
Example WIN2K_DISPLAY_NUMBER is defined in mdpcint.h as 0x8000.
This code sample shows how to cast the display number in the DLL:
nDisplay = (UWORD) Win2000DisplayNum |
Using functions that do not include HDC and screen-number parameters
Functions that did not previously include a screen-number parameter are obsolete in multi-monitor mode. Those that still provide useful information have been rewritten with the MM suffix and hdc and display-number parameters.
Example For example, Windows NT 4.0-compatible applications use
the DGetBoardType function like this:
WIN2K_DISPLAY_NUMBER;
DGetBoardType (HDC hdc, UWORD FAR * lpRetType)
Multi-monitor applications use DGetBoardType like this:
DGetBoardTypeMM (HDC hdc, UWORD nDisplay,
UWORD FAR * lpRetType)
DGetMaxScreens and DGetNumBoards are obsolete in
both modes.
DDirectBlt
is only available in Windows NT 4.0-compatible mode. Currently this function is not fully operational: although it splits the blt between screens correctly, GDI does not send the driver the correct clip, and the driver overdraws over­lapping windows.
Specific Functions for Windows 2000 in the DLL | 15
Specific Functions for Windows 2000 in the DLL
These functions exist only in multi-monitor mode and are only available in the Windows 2000 DLL:
DGetPaletteTypeMM
DGetSisterDisplayRegPathMM
DGetSisterDisplayNumberMM
A sister display is one of two displays being driven by the same DOME board.
This table lists each updated function and the obsolete function it replaces.
This new function Replaces this function
DGetBoardTypeMM DGetBoardType
DGetDriverVersionMM DGetDriverVersion
DGetNumGCTBitsMM DGetNumGCTBits
DGetNumGDIBitsMM DGetNumGDIBits
DGetRefreshRateMM DGetRefreshRate
All functions with the MM suffix are available only in Windows 2000 and work only in multi-monitor mode. The previous versions (without the MM suffix) work in Windows NT 4.0-compatible mode.
16 | Dynamic-Link Library
DLL Functions
Use the DLL functions described in this section to write applications. The functions are listed logically; for example,
DSetGCT
For a description of this function Go to page
is followed by DGetGCT.
DGetDriverVersion
DGetDriverVersionMM
DGetLibraryVersion
DGetBoardType
DGetBoardTypeMM
DGetNumBoards
DGetNumScreens
DGetMaxScreens
DGetScreenDimensions
DGetScreenPlacement
DSetBrightness
18 19 21 22 24 26 27 28 29 31 33
DGetBrightness
DSetContrast
DGetContrast
34 35 36
(Cont.)
DLL Functions | 17
For a description of this function Go to page
DGetNumGCTBits
DGetNumGCTBitsMM
DGetNumGDIBits
DGetNumGDIBitsMM
DGetSisterDisplayRegPathMM
DGetSisterDisplayNumberMM
DDirectBlt
DGetPaletteTypeMM
DSetGCT
DGetGCT
DSetStartupGCT
37 38 39 40 42 43 44 46 47 49 51
DCancelStartupGCT
DGetRefreshRate
DGetRefreshRateMM
DCalibratorInit
DCalibratorMeasure
DGetFtLamScale
DSerialCmd
53 54 55 56 59 61 62
18 | DGetDriverVersion
DGetDriverVersion
(Windows NT, Windows 2000 full Windows NT 4.0 compatible mode)
Purpose Use DGetDriverVersion to return the version number of
the DOME Windows driver.
Syntax
DWORD DGetDriverVersion (hdc, lpwDriverVersion)
Parameter T ype Name Description
HDC hdc
UWORD FAR * wDriverVer-
sion
Handle to the display­device context.
Pointer to UWORD. It is filled in with a hexadecimal value. The high byte is the version number, and the low byte is the revision number. For example, 0x108 is returned when youre using the version
1.8 driver.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the driver version in wDriverVersion.
#include <mdpcint.h> { HDC hdc; UWORD wDriverVersion; DWORD dwRetCode; dwRetCode = DGetDriverVersion (hdc,
&wDriverVersion); return dwRetCode; }
See also DGetLibraryVersion
DGetDriverVersionMM
(Windows 2000, multi-monitor mode only)
Purpose Use DGetDriverVersionMM to return the version of the
DOME Windows driver for your board.
DGetDriverVersionMM | 19
Syntax
DWORD DGetDriverVersionMM (hdc, nDisplay,
lpDriverVersion)
Parameter T ype Name Description
HDC hdc
UWORD nDisplay
UWORD FAR * lpDriverVersion
Handle to the display­device context.
Target display. Pointer to UWORD. It
is filled in with a hexadecimal value. The high byte is the version number, and the low byte is the revision number. For example, 0x500 is returned when youre using the version
5.0.0 driver.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
20 | DGetDriverVersionMM
Example This example returns the driver version in lpDriverVersion.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; UWORD DriverVersion; dwRetCode = DGetDriverVersionMM
(NULL, nDisplay, &DriverVersion); return dwRetCode; }
Or, for attached or unattached display 2:
DEVMODE dmMode; HDC hdc; /* Fill in relevant parts of dmMode */ hdc = CreateDC (“DISPLAY”, “\\\\.\\DISPLAY2”, NULL,
&dmMode); dwRetCode = DGetDriverVersionMM (hdc,
WIN2K_DISPLAY_NUMBER, &DriverVersion);
See also DGetLibraryVersion and the GetFileVersionInfo function
of the Microsoft SDK
DGetLibraryVersion | 21
DGetLibraryVersion
(Windows NT, Windows 2000 full Windows NT 4.0-compatible mode)
Purpose Use DGetLibraryVersion to return the version of the
DOME Windows DLL.
Syntax
DWORD DGetLibraryVersion (lpwLibraryVersion)
Parameter T ype Name Description
UWORD FAR * wLibraryVersion
Pointer to UWORD. It is filled in with a hexadecimal value. The high byte is the version number, and the low byte is the revision number. For example, 0x201 is returned when youre using the version
2.1 library.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the library version in
wLibraryVersion #include <mdpcint.h>
{ UWORD wLibraryVersion; DWORD dwRetCode; dwRetCode = DGetLibraryVersion
(&wLibraryVersion); return dwRetCode; }
See also DGetDriverVersion and the GetFileVersionInfo
function of the Microsoft SDK
.
22 | DGetBoardType
DGetBoardType
(Obsolete in multi-monitor mode, partial Windows NT 4.0-compatible mode)
Purpose Use DGetBoardType to return the board type.
Syntax DWORD DGetBoardType (hdc, lpwBoardType)
Parameter T ype Name Description
HDC hdc
UWORD FAR * wBoardType
Handle to the display-device context.
Pointer to UWORD; on successful return, it contains one of these values:
• DXPCI
• M2PCI
• R4PCI
• R5PCI
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the board type.
#include <mdpcint.h> /* has board definitions */ { HDC hdc; UWORD wBoardType; DWORD dwRetCode; dwRetCode = DGetBoardType (hdc, &wBoardType); return dwRetCode; }
See also DGetNumBoards
DGetBoardType | 23
24 | DGetBoardTypeMM
DGetBoardTypeMM
(Windows 2000, multi-monitor mode only)
Purpose Use DGetBoardTypeMM to return the board type.
Syntax DWORD DGetBoardTypeMM (hdc, nDisplay, lpwretType)
Parameter T ype Name Description
HDC hdc
UWORD nDisplay
UWORD FAR * retType
NULL
target display. Target display. Pointer to UWORD; on
successful return, it contains one of these values:
or hdc of
• DXPCI
• M2PCI
• R4PCI
• R5PCI
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the board type.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; UWORD retType; dwRetCode = DGetBoardTypeMM (NULL, nDisplay,
&retType); return dwRetCode; }
See also DGetNumBoards
DGetBoardTypeMM | 25
26 | DGetNumBoards
DGetNumBoards
(Obsolete in Windows 2000)
Purpose Use DGetNumBoards to return the number of DOME boards in
your system.
Syntax
DWORD DGetNumBoards (hdc, lpwNumBoards)
Parameter T ype Name Description
HDC hdc
UWORD FAR * wNumBoards
Handle to the display-device context.
Pointer to UWORD. It is always filled in with 1 (one) for Windows 2000 and with the actual number of DOME boards for Windows NT 4.0 on successful return.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
See also DGetBoardType
DGetNumScreens
Purpose Use DGetNumScreens to return the number of screens
controlled by the DOME Windows driver.
Syntax DWORD DGetNumScreens (hdc, lpwNumScreens)
Parameter T ype Name Description
DGetNumScreens | 27
HDC hdc
UWORD FAR * wNumScreens
Handle to the display­device context.
Pointer to UWORD. It is filled in with the number of screens controlled by the DOME Windows driver.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the number of screens controlled by
DOME Windows drivers.
#include <mdpcint.h> { HDC hdc; UWORD wNumScreens; DWORD dwRetCode; dwRetCode = DGetNumScreens (hdc,
&wNumScreens); return dwRetCode; }
See also DGetScreenDimensions, DGetScreenPlacement,
DGetRefreshRate, DGetRefreshRateMM
28 | DGetMaxScreens
DGetMaxScreens
(Obsolete in Windows 2000)
Purpose Use DGetMaxScreens to return the maximum number of
screens controlled by the DOME Windows driver.
Syntax
DWORD DGetMaxScreens (hdc, lpwNumScreens)
Parameter Type Name Description
HDC hdc
UWORD FAR * wNumScreens
Handle to the display-device context.
Pointer to UWORD. It is filled in with the maximum number of screens that can be controlled by the DOME Windows driver on the current system. In Windows NT, it is equiva­lent to the Windows 2000 function
DGetNumScreens.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the maximum number of screens
controlled by the DOME Windows driver.
#include <mdpcint.h> { HDC hdc; UWORD wNumScreens; DWORD dwRetCode; dwRetCode = DGetMaxScreens (hdc, &wNumScreens); return dwRetCode;
See also DGetNumScreens
DGetScreenDimensions
Purpose Use DGetScreenDimensions to return the dimensions of
a single screen.
Syntax DWORD DGetScreenDimensions (hdc, wScreenNumber,
lpszSize)
Parameter T ype Name Description
DGetScreenDimensions | 29
HDC hdc
UWORD wScreenNumber
SIZE FAR * szSize
Handle to the display­device context.
Target screen number (zero-based).
Pointer to a Microsoft Windows structure. It is filled in with the width height screen.
SIZE
(cx) and
(cy) of a single
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Structure This code fragment defines the SIZE structure.
typedef struct { LONG cx; LONG cy; } SIZE;
30 | DGetScreenDimensions
Example This example returns the dimensions of screen zero (0).
#include <windows.h> /* includes SIZE
#include <mdpcint.h> { HDC hdc; SIZE szSize; DWORD dwRetCode; dwRetCode = DGetScreenDimensions (hdc, 0, &szSize); return dwRetCode; }
Or, in Windows 2000 mode:
dwRetCode = DGetScreenDimensions (NULL,
WIN2K_DISPLAY_NUMBER | 0, &szSize);
definition */
Or, in Windows 2000 mode with an unattached display:
dwRetCode = DGetScreenDimensions (hdc,
WIN2K_DISPLAY_NUMBER, &szSize);
See also DGetNumScreens, DGetScreenPlacement, DGetRefreshRate,
DGetRefreshRateMM
DGetScreenPlacement
Purpose Use DGetScreenPlacement to return the x,y position of the
screen in Windows space.
Syntax DWORD DGetScreenPlacement (hdc, wScreenNumber,
lpptPoint)
Parameter T ype Name Description
DGetScreenPlacement | 31
HDC hdc
UWORD wScreenNumber
POINT FAR * ptPoint
Handle to the display­device context.
Target screen number (zero-based).
Pointer to a Windows
POINT
It is filled in with the placement of the screen.
structure.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
This function returns an error for unattached displays.
Structure This code fragment defines the POINT structure.
typedef struct
{
LONG x;
LONG y;
} POINT;
32 | DGetScreenPlacement
Example This example returns the x,y position of screen one (1) in the
Windows desktop.
#include <windows.h> /* includes POINT definition */ #include <mdpcint.h> { HDC hdc; POINT ptPosition; DWORD dwRetCode; dwRetCode = DGetScreenPlacement (hdc, 1, &ptPosition); return dwRetCode; }
See also DGetNumScreens, DGetScreenDimensions, DGetRefreshRate,
DGetRefreshRateMM
DSetBrightness
(Available for flat panel only)
Purpose Use DSetBrightness to set the brightness of the flat panel.
Syntax DWORD DSetBrightness (hdc, nDisplay, Brightness)
Parameter T ype Name Description
DSetBrightness | 33
HDC hdc
UWORD nDisplay
DWORD Brightness
NULL
device. Target display. Contains the new brightness
setting for the flat panel. Valid settings are 0 (zero) to 255, with 0 (zero) being full brightness.
or hdc of target
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example sets the brightness of the panel.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; DWORD dwBrightness = 0;/* Set to full
dwRetCode = DSetBrightness (NULL, nDisplay,
return dwRetCode; }
See also DGetBrightness
brightness */
dwBrightness);
34 | DGetBrightness
DGetBrightness
(Available for flat panel only)
Purpose Use DGetBrightness to return the current brightness
setting of the flat panel.
Syntax
DWORD DGetBrightness (hdc, nDisplay, pBrightness)
Parameter Type Name Description
HDC hdc
UWORD nDisplay
DWORD FAR * pBright-
ness
NULL
Target display. Pointer to DWORD. It is filled
with the current brightness setting of the flat panel (on successful return). Current values are 0 (zero) to 255, with 0 (zero) being full brightness.
or hdc of target device.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the brightness of a panel.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; DWORD dwBrightness; dwRetCode = DGetBrightness (NULL, nDisplay,
&dwBrightness); return dwRetCode; }
See also DSetBrightness
DSetContrast
(Available for flat panel only)
Purpose Use DSetContrast to set the contrast of the flat panel.
Syntax DWORD DSetContrast (hdc, nDisplay, Contrast)
Parameter T ype Name Description
DSetContrast | 35
HDC hdc
UWORD nDisplay
DWORD Contrast
NULL
Target display. Contains the new contrast
setting for the flat panel. Valid settings are 0 (zero) to 255. The panel powers up with a contrast value of 0x80.
or hdc of target device.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example sets the contrast of a panel.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; DWORD dwContrast = 0x80;/* Set to default
dwRetCode = DSetContrast (NULL, nDisplay,
return dwRetCode; }
See also DGetContrast
contrast */
dwContrast);
36 | DGetContrast
DGetContrast
(Available for flat panel only)
Purpose Use DGetContrast to return the current contrast setting of
the flat panel.
Syntax
DWORD DGetContrast (hdc, nDisplay, pContrast)
Parameter T ype Name Description
HDC hdc
UWORD nDisplay
DWORD FAR * pContrast
NULL
Target display. Pointer to DWORD. It is filled in
with the current contrast setting of the flat panel (on successful return). Current values are 0 (zero) to 255. The panel powers up with a contrast value of 0x80.
or hdc of target device.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the contrast of a panel.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; DWORD dwContrast; dwRetCode = DGetContrast (NULL, nDisplay,
&dwContrast); return dwRetCode; }
See also DSetContrast
DGetNumGCTBits | 37
DGetNumGCTBits
(Windows NT, Windows 2000 full Windows NT 4.0 compatible mode)
Purpose Use DGetNumGCTBits to return the number of gamma
correction bits.
Syntax
DWORD DGetNumGCTBits (hdc, lpNumRedBits,
lpNumGreenBits, lpNumBlueBits)
Parameter T ype Name Description
HDC hdc
DWORD FAR * lpNumRedBits
lpNumGreenBits lpNumBlueBits
Handle to the display­device context
Number of red GCT bits Number of green GCT bits Number of blue GCT bits
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the number of gamma correction bits.
#include <mdpcint.h> { HDC hdc DWORD dwRetCode; DWORD NumRedBits, NumGreenBits, NumBlueBits; dwRetCode = DGetNumGCTBits (hdc, &NumRedBits,
&NumGreenBits, &NumBlueBits); return dwRetCode; }
See also DGetScreenDimensions, DGetNumGDIBits
38 | DGetNumGCTBitsMM
DGetNumGCTBitsMM
(Windows 2000, multi-monitor mode only)
Purpose Use DGetNumGCTBitsMM to return the number of gamma
correction bits.
Syntax
DWORD DGetNumGCTBitsMM (hdc, nDisplay, lpNumRedBits,
lpNumGreenBits, lpNumBlueBits)
Parameter T ype Name Description
HDC hdc
UWORD nDisplay
DWORD FAR * lpNumRedBits
lpNumGreenBits lpNumBlueBits
Handle to the display­device context
Target display Number of red
GCT bits Number of green GCT bits Number of blue GCT bits
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the number of gamma correction bits.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay; DWORD dwRetCode; DWORD NumRedBits, NumGreenBits, NumBlueBits; dwRetCode = DGetNumGCTBitsMM (NULL, nDisplay,
&NumRedBits, &NumGreenBits, &NumBlueBits); return dwRetCode; }
See also DGetScreenDimensions, DGetNumGDIBitsMM
DGetNumGDIBits | 39
DGetNumGDIBits
(Windows NT, Windows 2000 full Windows NT 4.0 compatible mode)
Purpose Use DGetNumGDIBits to return the number of
Windows GDI (graphical device interface) bits.
Syntax
DWORD DGetNumGDIBits (hdc, lpNumRedBits,
lpNumGreenBits, lpNumBlueBits)
Parameter T ype Name Description
HDC hdc
DWORD FAR * lpNumRedBits
lpNumGreenBits
lpNumBlueBits
Handle to the display­device context
Number of red bits used by GDI Number of green bits used by GDI Number of blue bits used by GDI
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the number of GDI bits.
#include <mdpcint.h> { HDC hdc; DWORD dwRetCode; DWORD NumRedBits, NumGreenBits, NumBlueBits; dwRetCode = DGetNumGDIBits (hdc, &NumRedBits,
&NumGreenBits, &NumBlueBits); return dwRetCode; }
See also DGetScreenDimensions, DGetNumGCTBits
40 | DGetNumGDIBitsMM
DGetNumGDIBitsMM
(Windows 2000, multi-monitor mode only)
Purpose Use DGetNumGDIBitsMM to return the number of
Windows GDI bits.
Syntax
DWORD DGetNumGDIBitsMM (hdc, nDisplay, lpNumRedBits,
lpNumGreenBits, lpNumBlueBits)
Parameter T ype Name Description
HDC hdc
UWORD nDisplay
DWORD FAR * lpNumRedBits
lpNumGreenBits
lpNumBlueBits
Handle to the display­device context
Target display Number of red bits
used by GDI Number of green bits
used by GDI Number of blue bits
used by GDI
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
DGetNumGDIBitsMM | 41
Example This example returns the number of GDI bits.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay; DWORD dwRetCode; DWORD NumRedBits, NumGreenBits, NumBlueBits; dwRetCode = DGetNumGDIBitsMM (NULL, nDisplay,
&NumRedBits, &NumGreenBits, &NumBlueBits); return dwRetCode; }
See also DGetScreenDimensions, DGetNumGCTBitsMM
42 | DGetSisterDisplayRegPathMM
DGetSisterDisplayRegPathMM
(Windows 2000, multi-monitor mode only)
Purpose Use DGetSisterDisplayRegPathMM to return the registry
path of the Windows 2000 sister display.
Syntax
DWORD FAR PASCAL DGetSisterDisplayRegPathMM (hdc, nDisplay, *lpRegPath, szRegPath)
Parameter T ype Name Description
HDC hdc
UWORD nDisplay
char FAR *lpRegPath
int szRegPath
Handle to the display-device context
Target display On successful return, contains
the registry path of the sister display to
Size of supplied buffer; must be at least 256 bytes
wDisplay
Return value Zero (0) if successful; otherwise, an error message.
Example This example returns the registry path of the sister display to
the target display.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; char lpRegPath[256]; dwRetCode = DGetSisterDisplayRegPathMM
(NULL, nDisplay, lpRegPath, 256); return dwRetCode; }
See also DGetSisterDisplayNumberMM
DGetSisterDisplayNumberMM
(Windows 2000, multi-monitor mode only)
Purpose Use DGetSisterDisplayNumberMM to return the
Windows 2000 display number of the sister display.
Syntax DWORD FAR PASCAL DGetSisterDisplayNumberMM
(hdc, nDisplay, lpDisplayNum)
Parameter T ype Name Description
DGetSisterDisplayNumberMM | 43
HDC hdc
UWORD nDisplay
UWORD FAR *DisplayNum
Handle to the display­device context
Target display On successful return,
contains the Windows 2000 display number of the sister display
Return value Zero (0) if successful; otherwise, an error message.
Example This example returns the Windows 2000 display number of
the sister display.
#include <mdpcint.h> { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; UWORD nSisterDisplay; dwRetCode = DGetSisterDisplayNumberMM
(NULL, nDisplay, &nSisterDisplay); return dwRetCode; }
See also DGetSisterDisplayRegPathMM
44 | DDirectBlt
DDirectBlt
(Obsolete in Windows 2000)
Purpose Use DDirectBlt to provide a direct transfer of image data
from the host to the screen(s).
Syntax
DWORD DDirectBlt (hdc, DestX, DestY, SrcX, SrcY,
Width, Height, SrcStride, lpSrc)
Parameter Type Name Description
HDC hdc
int DestX,
DestY
int SrcX, SrcY
Handle to the display-device context.
Destination screen coordinates. The top-left corner of the top-left screen is 0,0. This function splits the transfer among screens, if necessary.
Pixel offsets into the source buffer where the transfer starts.
int Width
int Height
int SrcStride
void * lpSrc
Number of pixel columns to transfer.
Number of pixel rows to transfer.
Number of bytes from the beginning of one source line to the beginning of the next source line.
Pointer to the source buffer. The source buffer image must have the same bits per pixel as the screen.
When you use DDirectBlt, make sure that the values of
SrcX + Width
and SrcY + Height do not exceed the bounds of the source image. Otherwise, you risk a system memory access error.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example transfers image data from the host to
the screen.
#include <mdpcint.h> { HDC hdc; int DestX, DestY, SrcX, SrcY, Width, Height,
SrcStride;
DDirectBlt | 45
void *lpSrc DWORD dwRetCode;
. . .
dwRetCode = DDirectBlt (hdc, DestX, DestY, SrcX,
SrcY, Width, Height, SrcStride, lpSrc); return dwRetCode; }
46 | DGetPaletteTypeMM
DGetPaletteTypeMM
(Windows 2000, multi-monitor mode only)
Purpose Use DGetPaletteTypeMM to return the palette type of
the Windows 2000 display.
Syntax
DGetPaletteTypeMM (hdc, nDisplay, lppalType)
Parameter T ype Name Description
HDC hdc
UWORD nDisplay
UWORD FAR *palType
Handle to the display-device context
Target display Palette type of display; on
successful return, it contains one of these values:
• PALTYPE_PSEUDOCOLOR
• PALTYPE_DYNAMIC_GRAY
• PALTYPE_STATIC_GRAY
•PALTYPE_NONLINEAR_ STATIC_GRAY
• PALTYPE_TRUECOLOR
Return value Zero (0) if successful; otherwise, an error message.
Example This example returns the palette type of the display.
#include <mdpcint.h> /* has PALTYPE definitions */ { HDC hdc; UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; UWORD palType; dwRetCode = DGetPaletteTypeMM (NULL,
nDisplay, &palType); return dwRetCode; }
DSetGCT
Purpose Use DSetGCT to set the GCT for a particular screen.
Syntax DWORD DSetGCT (hdc, wScreenNumber, lpgct)
DSetGCT | 47
Parameter T ype Name Description
HDC hdc
UWORD wScreenNumber
GAMMA_
gct CORRECTION_ TABLE FAR *
Handle to the display­device context.
Target screen number (zero-based).
Pointer to GCT.
ArraySize
the number of entries in each color array. For current versions of the DLL,
ArraySize must
be 256. The tables color values are 16-bit values. The DLL shifts these values down if the DAC doesnt support the full 16 bits.
specifies
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Grayscale boards use green values only.
48 | DSetGCT
Structure This code fragment defines the only valid structure for the
GAMMA_CORRECTION_TABLE in this version of the library. typedef struct
{ UWORD Reserved1; UWORD Reserved2; UWORD ArraySize; UWORD Red[256]; UWORD Green[256]; UWORD Blue[256]; } GAMMA_CORRECTION_TABLE;
DSetGCT
overwrites the Reserved1 and Reserved2 fields in the GAMMA_CORRECTION_ TABLE. The ArraySize field must be 256.
Example This example sets the GCT for screen zero (0).
#include <mdpcint.h> /* includes
GAMMA_ CORRECTION_TABLE
definition */ { HDC hdc; GAMMA_CORRECTION_TABLEgct; DWORD dwRetCode; gct.ArraySize = 256; /* Set Red, Green, and Blue values of gct */
. .
. dwRetCode = DSetGCT (hdc, 0, &gct); return dwRetCode; }
See also DGetGCT, DSetStartupGCT, DCancelStartupGCT
DGetGCT
Purpose Use DGetGCT to return the GCT for a particular screen.
DGetGCT | 49
Syntax
DWORD DGetGCT (hdc, wScreenNumber, lpgct)
Parameter T ype Name Description
HDC hdc
UWORD wScreenNumber
GAMMA_ CORRECTION_ TABLE FAR *
gct
Handle to the display­device context.
Target screen number (zero-based).
Pointer to GCT. Color values in the table are full 16-bit values.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Structure The code fragment on page 48 defines the GAMMA_
CORRECTION_TABLE
structure.
DGetGCT overwrites the Reserved1 and Reserved2 fields
in the GAMMA_CORRECTION_ TABLE. The ArraySize field must be 256.
50 | DGetGCT
Example This example returns the GCT for screen zero (0).
See also DSetGCT, DSetStartupGCT, DCancelStartupGCT
#include <mdpcint.h> /* includes
GAMMA_ CORRECTION_TABLE
definition */ { HDC hdc; GAMMA_CORRECTION_TABLEgct; DWORD dwRetCode; dwRetCode = DGetGCT (hdc, 0, &gct); return dwRetCode; }
DSetStartupGCT
Purpose Use DSetStartupGCT to set the initial GCT for a particular
screen. This table loads whenever you start the Windows operating system. The GCT supplied to this function takes effect only when you restart Windows. DSetStartupGCT can also replace a previous startup table.
Syntax DWORD DSetStartupGCT (wScreenNumber, lpFileName)
Parameter T ype Name Description
DSetStartupGCT | 51
UWORD wScreenNumber
SBYTE FAR * FileName
Target screen number (zero-based).
Full path of the file containing the GCT. The colors in the file are full 16-bit values. must equal 0xD03E9A3A. You must set to 1 (one) for current versions of the dynamic link library.
IdGCT
Version
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
DSetStartupGCT copies the GCT file to a system directory.
Delete the original GCT file to preserve disk space.
52 | DSetStartupGCT
Structure This code fragment defines the GCT_FILE_FORMAT structure.
typedef struct
The ArraySize field must be 256.
Example This example sets the initial GCT for screen zero (0).
#include <mdpcint.h>
{ UDWORD IdGCT; UWORD Version; UWORD ArraySize; UWORD Red[256]; UWORD Green[256]; UWORD Blue[256]; } GCT_FILE_FORMAT;
{ DWORD dwRetCode; dwRetCode = DSetStartupGCT (0, "screen0.gct"); return dwRetCode; }
See also DCancelStartupGCT, DGetGCT, DSetGCT
DCancelStartupGCT
Purpose Use DCancelStartupGCT to cancel the startup GCT for a
particular screen. When you start the Windows operating system after setting this function, the default (linear) GCT loads for the indicated screen. This function takes effect only when you restart the Windows operating system.
Syntax DWORD DCancelStartupGCT (wScreenNumber)
Parameter T ype Name Description
DCancelStartupGCT | 53
UWORD wScreenNumber
Target screen number (zero-based)
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example cancels the initial GCT for screen zero (0).
#include <mdpcint.h> { DWORD dwRetCode; dwRetCode = DCancelStartupGCT (0); return dwRetCode; }
See also DSetStartupGCT
54 | DGetRefreshRate
DGetRefreshRate
(Obsolete in multi-monitor mode)
Purpose Use DGetRefreshRate to return the screen’s refresh rate.
Syntax DWORD DGetRefreshRate (hdc, lpwRefreshRate)
Parameter T ype Name Description
HDC hdc
UWORD FAR * wRefreshRate
Handle to the display­device context.
Pointer to UWORD. It is filled in with the refresh rate in Hertz * 100.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the refresh rate of the screen.
#include <mdpcint.h> { HDC hdc; UWORD wRefreshRate; DWORD dwRetCode; dwRetCode = DGetRefreshRate (hdc, &wRefreshRate); return dwRetCode; }
See also DGetNumScreens, DGetScreenDimensions,
DGetScreenPlacement
DGetRefreshRateMM
(Windows 2000, multi-monitor mode only)
Purpose Use DGetRefreshRateMM to return the screen’s
refresh rate.
DGetRefreshRateMM | 55
Syntax
DWORD DGetRefreshRateMM (hdc, nDisplay,
lpRefreshRate)
Parameter T ype Name Description
HDC hdc
UWORD nDisplay
UWORD FAR * lpRefreshRate
Handle to the display­device context.
Target display. Pointer to UWORD FAR.
It is filled in with the refresh rate in Hertz * 100.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Example This example returns the refresh rate of the screen.
#include <mdpcint.h> { HDC hdc UWORD nDisplay = (UWORD) Win2000DisplayNum |
WIN2K_DISPLAY_NUMBER; DWORD dwRetCode; UWORD RefreshRate; dwRetCode = DGetRefreshRateMM (NULL,
nDisplay, &lpRefreshRate); return dwRetCode; }
See also DGetScreenDimensions, DGetScreenPlacement
56 | DCalibratorInit
DCalibratorInit
Purpose Use DCalibratorInit to initialize the Calibration TQA™
system from DOME and prepare it to take measurements.
Syntax DWORD DCalibratorInit (hdc, wScreenNumber,
lpInitStruct)
Parameter T ype Name Description
HDC hdc
UWORD wScreenNumber
INIT_ CALIBRATOR_ STRUCT FAR *
InitStruct
Handle to the display­device context
Target screen number (zero-based)
Pointer to INIT_
CALIBRATOR_ STRUCT
structure
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
Structure This code fragment defines the INIT_CALIBRATOR_STRUCT
structure.
typedef struct
{
UWORD Version;
SDWORD MeasurementTime;
DWORD ReadTimeout;
UDWORD Reserved;
} INIT_CALIBRATOR_STRUCT;
You must set Version to 2.
DCalibratorInit | 57
MeasurementTime is the number of microseconds over which
the sample is taken in DCalibratorMeasure (page 59). This parameter must be greater than 17 and less than 1,179,630.
When measuring a periodic source such as a display, sample at an integer number of periods. Setting the proper integration time for a display at a specific frequency is essential to obtaining accurate, repeatable measurements. Each value set in MeasurementTime is equal to one (1) microsecond. Use this equation to find the integration time:
period of
one cycle
-------------------- =
integration time for one cycle
00010600
Multiply the integration time by the number of cycles you want to measure (31 cycles are recommended). For example, with a 75 Hz display, use this calculation:
1
----- -
6
10
× 31× 413333=
75
Thus, the integration time is: 413,333 microseconds = .413 seconds
ReadTimeout is the number of milliseconds to wait for data
when reading from the calibrator port. You can still use Version 1 (one) of the structure, which does
not include ReadTimeout. If you do use Version 1 (one), the
ReadTimeout
value defaults to 2000 (2 seconds), and you
must set Version to 1 (one).
58 | DCalibratorInit
Example This example initializes the DOME Calibration TQA system
and prepares it to take measurements on screen one (1).
#include <mdpcint.h> /* includes
INIT_ CALIBRATOR_STRUCT
definition */ { HDC hdc; INIT_CALIBRATOR_STRUCTInitStruct; DWORD dwRetCode; InitStruct.Version = 2; InitStruct.ReadTimeout = 2000; /* Set InitStruct.MeasurementTime using the
calculation on page 57 */
. . .
dwRetCode = DCalibratorInit (hdc, 1,
&InitStruct); return dwRetCode; }
See also DCalibratorMeasure, DGetFtLamScale
DCalibratorMeasure
Purpose Use DCalibratorMeasure to take a measurement from the
DOME Calibration TQA system and return the result.
Syntax DWORD DCalibratorMeasure (hdc, wScreenNumber,
lpdwMeasure)
Parameter T ype Name Description
DCalibratorMeasure | 59
HDC hdc
UWORD wScreenNumber
DWORD FAR * dwMeasure
Handle to the display­device context.
Target screen number (zero-based).
Pointer to DWORD. It is filled in with the measurement result, in the range from 0 (zero) to 65534. The number 65535 indicates a saturation error. Higher numbers indicate greater light striking the pod.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
60 | DCalibratorMeasure
Example This example returns the screen luminance on screen one (1),
as measured by the calibration system.
#include <mdpcint.h> { HDC hdc; DWORD dwMeasure; DWORD dwRetCode; dwRetCode = DCalibratorMeasure (hdc, 1,
&dwMeasure); return dwRetCode; }
See also DCalibratorInit, DGetFtLamScale
DGetFtLamScale
Purpose Use DGetFtLamScale to get the scale factor used to convert
calibration measurement units to foot Lamberts.
Syntax DWORD DGetFtLamScale (hdc, wScreenNumber, lpdScale)
Parameter T ype Name Description
DGetFtLamScale | 61
HDC hdc
UWORD wScreenNumber
double * dScale
Handle to the display­device context.
Target screen number (zero-based).
Pointer to scale factor. It is filled in with the value used to convert calibrator measurement units to foot Lamberts.
Return value DWORD – zero (0) if the function completed successfully;
otherwise, operating system error code.
Example This example returns the scale factor to convert the
calibration measurement units to foot Lamberts.
#include <mdpcint.h> { HDC hdc; UWORD wScreenNumber; DWORD dwRetCode; double dScale; dwRetCode = DGetFtLamScale (hdc,
wScreenNumber, &dScale); return dwRetCode; }
See also DCalibratorInit, DCalibratorMeasure
62 | DSerialCmd
DSerialCmd
Purpose Use DSerialCmd to write command bytes to the PS/2® serial
port and then read back the specified number of response bytes from the port.
Syntax
DWORD DSerialCmd (hdc, wScreenNumber, wnumCmdBytes,
lpCmdBuffer, wnumResponseBytes, lpResponseBuffer,
dwTimeout)
Parameter T ype Name Description
HDC hdc
UWORD wScreenNumber
UWORD wnumCmdBytes
Handle to the display­device context.
Target screen number (zero-based). This determines which boards serial port to write to.
Number of bytes to write to the command buffer. If this is zero (0), the function reads the response bytes without writing any command bytes.
UBYTE FAR * CmdBuffer
Buffer that contains the command bytes that are written to the port. This parameter can be
NULL if
wnumCmdBytes
is zero (0).
(Cont.)
DSerialCmd | 63
Parameter T ype Name Description
UWORD wnumResponseBytes
UBYTE FAR * ResponseBuffer
DWORD dwTimeout
Number of bytes to be read from the port after the If this value is zero (0), the function returns zero (0) without waiting for a response.
Buffer to receive the response bytes. If
Cmd is sent.
wnumResponseByte
is zero (0), this
s
can be Number of
milliseconds to wait for the response data. If this value is zero (0), the
Timeout
NULL.
Read-
value from
InitCalibrator
is used.
Return value DWORD – zero (0) if function completed successfully;
otherwise, operating system error code.
All structures are packed on 1-byte boundaries.
64 | DSerialCmd
Example This example writes a command byte to the PS/2 serial port
and then reads back the specified number of response bytes from the port.
#include <mdpcint.h> { HDC hdc; UWORD wnumCmdBytes, wnumResponseBytes; DWORD dwTimeout; UBYTE CmdBuffer, ResponseBuffer; DWORD dwRetCode; /* Put command bytes in CmdBuffer, and set number of
command bytes and response bytes */ . . .
dwRetCode = DSerialCmd (hdc, 0, wnumCmdBytes,
&CmdBuffer, wnumResponseBytes, &ResponseBuffer,
dwTimeout); return dwRetCode; }
DOME MDlib API Function Reference
In This Chapter
• MDlib API Types 66
• MDlib API Structures 67
• MDlib API Functions 73
66 | DOME MDlib API Function Reference
MDlib API Types
The standard C types of char, int, and long can mean different things to different compilers and machine types. The MDlib API types, however, are strictly defined as signed or unsigned and by byte size, as shown below.
Size Signed Unsigned
1 byte DChar DByte
2 bytes DShort DUShort
4 bytes DLong DULong
4 bytes DBool
4 bytes DFloat
8 bytes DDouble
A DBool value can have one of two values: either zero (FALSE) or nonzero (TRUE).
A DVoid value is equivalent to the C type void. When DVoid is a return value, it returns nothing.
DError values, shown below, are the return values of
functions that might fail.
#define D_OK 0
#define DMD_ERROR_BAD_VALUE 1
#define DMD_ERROR_BAD_DEVICE 2
#define DMD_ERROR_NO_MEMORY 3
#define DMD_ERROR_BAD_GCT 4
#define DMD_ERROR_BAD_IO 5
MDlib API Structures
Use this table to quickly locate the MDlib API structures described in this section.
For this structure Go to page
MDlib API Structures | 67
DMdVersion
DMdCopyRect
DMdFillRect
DMdDev
DMdVersion Structure
Purpose The DMdVersion structure returns the version of the DOME
MDlib API.
DMdVersion is a member of the DMdDev structure returned by
the DMdOpen or DMdFdOpen call. When the program runs, it checks to see if the version of the domeMd.h header file it has used to compile matches that of the MDlib API.
67 69 70 71
Full compatibility with the API exists only if both the major and minor version numbers match. The subversion number, however, does not need to match for full compatibility.
If the major version number does not match, the program is unable to operate. When the major version number changes, backward compatibility is not provided.
68 | DMdVersion Structure
If the major version number matches, but the minor version number does not, the API retains backward compatibility; a program compiled with an older version of domeMd.h runs correctly with a newer MDlib API.
Structure This table defines the DMdVersion structure.
DMdVersion Member Description
struct {
DShort major
DByte minor
DByte sub
Major version number Minor version number Subversion number
} DMdVersion
#define DMD_MAJOR_VERSION 1
#define DMD_MINOR_VERSION 0
#define DMD_SUB_VERSION 1
DMdCopyRect Structure
Purpose The DMdCopyRect structure accelerates screen-to-
screen copying.
Structure This table defines the DMdCopyRect structure.
DMdCopyRec t Member Description
struct {
DMdCopyRect Structure | 69
DULong srcx
DULong srcy
DULong dstx
DULong dsty
The x screen coordinate of the upper-left corner pixel of the source rectangle. The upper-left corner pixel of the screen has screen coordinates (0,0). The x screen coordinate increases to the right.
The y screen coordinate of the upper-left corner pixel of the source rectangle. The upper-left corner pixel of the screen has screen coordinates (0,0). The y screen coordinate increases downward.
The x screen coordinate of the upper-left corner pixel of the destination rectangle.
The y screen coordinate of the upper-left corner pixel of the destination rectangle.
DULong width
DULong height
} DMdCopyRect
Width in pixels of the rectangle to copy.
Height in pixels of the rectangle to copy.
70 | DMdFillRect Structure
DMdFillRect Structure
Purpose The DMdFillRect structure accelerates screen filling.
Structure This table defines the DMdFillRect structure.
DMdFillRect Member Description
struct {
DULong dstx
DULong dsty
DULong width
DULong height
} DMdFillRect
The x screen coordinate of the upper-left corner pixel of the destination rectangle
The y screen coordinate of the upper-left corner pixel of the destination rectangle
Width in pixels of the rectangle to fill
Height in pixels of the rectangle to fill
DMdDev Structure
Purpose The DMdDev structure provides a pointer to the structure
that accesses to the DOME MDlib device returned by DMdOpen or DMdFdOpen. DMdDev is also called the device handle.
Structure This table defines the DMdDev structure.
DMdDev Member Description
struct {
DMdDev Structure | 71
DMdVersion version
DLong fd
DVoid (*Close) ()
DLong (*RefreshRate) ()
DBool (*FbVideo) ()
DVoid (*MapFb) ()
DVoid (*UnmapFb) ()
DLong (*FbSize) ()
DLong (*FbWidth) ()
DOME MDlib API version
File descriptor of the opened DOME MDlib device
See page 76 See page 77 See page 78 See page 79 See page 81 See page 82 See page 83
DLong (*FbHeight) ()
DLong (*FbPitch) ()
struct fbtype *(*FbType) ()
DLong (*BitsPerPixel) ()
DError (*CopyRects) ()
See page 84 See page 85 See page 86 See page 87 See page 88
(Cont.)
72 | DMdDev Structure
DMdDev Member Description
DError (*FillRects) ()
DError (*InitCmap) ()
DError (*WriteCmap) ()
DError (*UpdateCmap) ()
DError (*ReadCmap) ()
DError (*InitGCT) ()
DError (*WriteGCT) ()
DError (*UpdateGCT) ()
DError (*ReadGCT) ()
DVoid (*reserve1)
DVoid (*reserve2)
See page 90 See page 92 See page 93 See page 95 See page 96 See page 98 See page 99 See page 101 See page 102 For future use For future use
DVoid (*reserve3)
DVoid (*reserve4)
DVoid (*reserve5)
DVoid (*reserve6)
DVoid (*reserve7)
DVoid (*reserve8)
DVoid (*reserve9)
For future use For future use For future use For future use For future use For future use For future use
} DMdDev
All structure members, except both version and fd, are pointers to functions that provide the remaining functionality of the DOME MDlib API. Those functions are described in the next section, “MDlib API Functions.”
MDlib API Functions
Use this reference to the DOME MDlib API functions to write applications. The two Open functions appear first, followed by the other functions in the order of their appearance as members of the DMdDev structure.
For a description of this function Go to page
MDlib API Functions | 73
DMdOpen DMdFdOpen Close RefreshRate FbVideo MapFb UnmapFb FbSize FbWidth FbHeight FbPitch FbType BitsPerPixel
74 75 76 77 78 79 81 82 83 84 85 86 87
CopyRects FillRects InitCmap WriteCmap UpdateCmap ReadCmap InitGCT WriteGCT UpdateGCT ReadGCT
88 90 92 93 95 96 98
99 101 102
74 | DMdOpen
DMdOpen
Purpose Use DMdOpen to gain access to a DOME device.
Syntax DMdDev DMdOpen (name)
Parameter T ype Name Description
DChar *name
Device file of the DOME device, for example,
"/dev/m2pci0.0"
Return value Device handle if successful; otherwise, NULL.
Description DMdOpen() opens the DOME device specified by name
and returns the device handle, which provides access to the device. To close the DOME device, use the Close() member function (page 76) of the returned device handle.
Errors If DMdOpen() returns NULL, an error message prints to
stderr
.
Example This example opens the DOME device /dev/m2pci0.0.
#include "domeMd.h" DMdDev dev; dev = DMdOpen ("/dev/m2pci0.0");
. . .
(*dev->Close) (dev);
See also DMdFdOpen, Close, DMdDev Structure
DMdFdOpen
Purpose Use DMdFdOpen to access a DOME device if the device file
is already open.
Syntax DMdDev DMdFdOpen (fd)
Parameter T ype Name Description
DMdFdOpen | 75
DLong fd
File descriptor of the opened device file
Return value Device handle if successful; otherwise, NULL.
Description DMdFdOpen() opens the DOME device specified by the
open file descriptor fd and returns the device handle that provides access to the device. To close the DOME device, use the Close() member function (page 76) of the returned device handle.
Errors If DMdFdOpen() returns NULL, an error message prints
to stderr.
Example This example opens the DOME device /dev/m2pci0.0.
#include "domeMd.h" DMdDev dev; DLong fd; fd = open ("/dev/m2pci0.0", O_RDWR); if (fd == -1)
exit (-1);
dev = DMdFdOpen (fd);
. . .
(*dev->Close) (dev);
See also DMdOpen, Close, DMdDev Structure
76 | Close
Close
Purpose Use Close to end access to a DOME device.
Syntax DVoid (*Close) (dev)
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value None.
Description Close() closes the DOME device previously opened with
either DMdOpen() or DMdFdOpen() . After you call Close() , you cannot access the DOME device using the old device handle.
Errors None.
Example This example closes the device handle dev.
#include "domeMd.h" DMdDev dev; dev = DMdOpen ("/dev/m2pci0.0");
. . .
(*dev->Close) (dev);
See also DMdOpen, DMdFdOpen, DMdDev Structure
RefreshRate
Purpose Use RefreshRate to get the refresh rate for a display
mode setting.
Syntax DLong (*RefreshRate) (dev)
RefreshRate | 77
Parameter T ype Name Description
DMdDev dev
Device handle for the DOME device
Return value An integer equal to 100 times the refresh rate in Hz, if
successful. If the display mode is not set to a supported mode, RefreshRate() returns zero.
Description RefreshRate() returns a long integer equal to 100 times
the refresh rate of the display mode setting.
Errors None.
Example This example returns the refresh rate of the display mode.
#include "domeMd.h" DMdDev dev; float refreshRate;
. . .
refreshRate = (*dev->RefreshRate) (dev) / 100.0;
See also DMdDev Structure
78 | FbVideo
FbVideo
Purpose Use FbVideo to turn video on or off.
Syntax DBool (*FbVideo) (dev, on)
Parameter T ype Name Description
DMdDev dev
DBool on
Device handle of the DOME device
Specifies whether to turn video on or off
Return value TRUE if video was on before the call; FALSE if video
was off.
Description FbVideo() turns the display video on if on is TRUE. It turns
the display video off if on is FALSE. It also returns the status of the video (on or off) before this call takes effect.
Errors None.
Example This example turns the display video off.
#include "domeMd.h" DMdDev dev; DBool videoOn;
. . .
videoOn = (*dev->FbVideo) (dev, FALSE);
See also DMdDev Structure
MapFb
Purpose Use MapFb to map the framebuffer. This function allows the
Syntax DVoid *(*MapFb) (dev)
MapFb | 79
program to access the framebuffer directly.
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value A pointer to the beginning of the framebuffer if successful;
otherwise, NULL.
Description MapFb() maps the framebuffer to the virtual address space of
the caller and returns a pointer to the beginning of that space. The caller can access the framebuffer directly through the pointer.
Attempts to access locations before the beginning of the framebuffer or beyond the size of the framebuffer will result in an error.
To get the framebuffer size, use the FbSize() member function of the device handle (page 82).
To unmap the framebuffer, use the UnmapFb() member function of the device handle (page 81).
Errors If MapFb() returns NULL, an error message prints to stderr.
80 | MapFb
Example This example maps the framebuffer.
See also UnmapFb, FbSize, DMdDev Structure
#include "domeMd.h" DMdDev dev; char *pFb;
. . .
pFb = (*dev->MapFb) (dev);
UnmapFb
Purpose Use UnmapFb to unmap the framebuffer.
Syntax DVoid (*UnmapFb) (dev)
UnmapFb | 81
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value None.
Description UnmapFb() unmaps the framebuffer from the virtual address
space of the caller, freeing up any system resources that have been allocated. Attempts to access the framebuffer using the pointer obtained from MapFb() will result in an error.
Errors If UnmapFb() fails, an error message prints to stderr.
Example This example unmaps the framebuffer.
#include "domeMd.h" DMdDev dev; char *pFb;
. . .
pFb = (*dev->MapFb) (dev);
. . .
(*dev->UnmapFb) (dev);
See also MapFb, DMdDev Structure
82 | FbSize
FbSize
Purpose Use FbSize to get the size of the framebuffer.
Syntax DLong (*FbSize) (dev)
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value Size of framebuffer in bytes.
Description FbSize() returns the framebuffer size in bytes. Attempts to
access locations beyond the size of the framebuffer will result in an error.
Errors None.
Example This example returns the framebuffer size.
#include "domeMd.h" DMdDev dev; DLong fbSize;
. . .
fbSize = (*dev->FbSize) (dev);
See also FbWidth, FbHeight, FbPitch, DMdDev Structure
FbWidth
Purpose Use FbWidth to get the width of the framebuffer.
Syntax DLong (*FbWidth) (dev)
FbWidth | 83
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value Width in pixels of the visible portion of the framebuffer.
Description FbWidth() returns the width, in pixels, of the visible portion
of the framebuffer. Access to locations beyond the visible portion of the frame-
buffer is reserved. To get the number of bits per pixel, use the
BitsPerPixel() member function (page 87) of the
device handle.
Errors None.
Example This example returns the width of the framebuffer.
#include "domeMd.h" DMdDev dev; DLong fbWidth;
. . .
fbWidth = (*dev->FbWidth) (dev);
See also FbSize, FbHeight, FbPitch, BitsPerPixel,
DMdDev Structure
84 | FbHeight
FbHeight
Purpose Use FbHeight to get the height of the framebuffer.
Syntax DLong (*FbHeight) (dev)
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value Height in pixels of the visible portion of the framebuffer.
Description FbHeight() returns the height, in pixels, of the visible portion
of the framebuffer. Access to locations beyond the visible portion of the frame-
buffer is reserved.
Errors None.
Example This example returns the height of the framebuffer.
#include "domeMd.h" DMdDev dev; DLong fbHeight;
. . .
fbHeight = (*dev->FbHeight) (dev);
See also FbWidth, FbSize, FbPitch, DMdDev Structure
FbPitch
Purpose Use FbPitch to get the pitch of the framebuffer.
Syntax DLong (*FbPitch) (dev)
FbPitch | 85
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value Pitch of framebuffer in pixels.
Description The pitch, sometimes called the stride, is the number of pixels
in one horizontal line of the framebuffer. It may be equal to or greater than the width of the visible portion of the frame­buffer. To get from one pixel to another immediately below it on the screen, skip forward in the framebuffer by the number of pixels returned by FbPitch().
To get the number of bits per pixel, use the BitsPerPixel() member function (page 87) of the device handle.
Example This example returns the pitch of the framebuffer in pixels
and bytes.
#include "domeMd.h" DMdDev dev; DLong pitchInPixels, pitchInBytes;
. .
. pitchInPixels = (*dev->FbPitch) (dev); pitchInBytes = pitchInPixels *
See also FbWidth, FbHeight, FbSize, BitsPerPixel,
DMdDev Structure
((*dev->BitsPerPixel) (dev) + 7) / 8;
86 | FbType
FbType
Purpose Use FbType to get the Sun™ fbtype structure information
Syntax struct fbtype *(*FbType) (dev)
about the framebuffer.
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value Pointer to Sun fbtype structure.
Description FbType() returns a pointer to a Sun fbtype structure
containing information about the framebuffer.
Errors None.
Example This example returns the Sun fbtype information about
the framebuffer.
#include "domeMd.h" DMdDev dev; struct fbtype*fbType
.
.
. fbType = (*dev->FbType) (dev);
See also FbSize, FbWidth, FbHeight, FbPitch,
DMdDev Structure
BitsPerPixel
Purpose Use BitsPerPixel to get the number of bits per pixel of
Syntax DLong (*BitsPerPixel) (dev)
BitsPerPixel | 87
the framebuffer.
Parameter T ype Name Description
DMdDev dev
Device handle of the DOME device
Return value Number of bits per pixel of the framebuffer.
Description BitsPerPixel() returns the number of bits per pixel of
the framebuffer.
Errors None.
Example This example returns the bits and bytes per pixel of
the framebuffer.
#include "domeMd.h" DMdDev dev; DLong bitsPerPixel, bytesPerPixel;
. .
. bitsPerPixel = (*dev->BitsPerPixel) (dev); bytesPerPixel = (bitsPerPixel + 7) / 8;
See also FbSize, FbWidth, FbHeight, FbPitch,
DMdDev Structure
88 | CopyRects
CopyRects
Purpose Use CopyRects to make a screen-to-screen copy of an array
Syntax DError (*CopyRects) (dev, rop, planeMask, r, nRects)
of rectangles.
Parameter T ype Name Description
DMdDev dev
DLong rop
DLong planeMask
DMdCopyRect *r
DLong nRects
Device handle of the DOME device
Raster operation to apply (currently copy)
Plane mask to apply (currently all ones [1s])
Array of rectangles to copy Number of rectangles to
copy
Return value D_OK if successful; otherwise, an error code.
Description CopyRects() takes an array of nRects structures of
DMdCopyRect,
containing pairs of source and destination rectangles, and copies each source rectangle to the destination, applying the specified rasterop and plane mask while doing so.
Even when the source and destination rectangles in each pair overlap, the copying will work correctly. The order in which pairs are copied matches the order of the rectangle pairs in the array.
Currently the only rasterop supported is copy; rop is ignored. Also, planeMask is ignored and all planes are written to the screen. For future compatibility, set rop to GXcopy (or 3), and
planeMask
Errors DMD_ERROR_BAD_DEVICE - Device failed to complete the
rectangle copy.
to ~0 (all ones [1s]).
CopyRects | 89
Example This example copies two rectangles from one location on
the screen to another.
#include "domeMd.h" DMdDev dev; DMdCopyRectrect[2]; DError error;
. .
. rect[0].srcx = 40; rect[0].srcy = 20; rect[0].dstx = 500; rect[0].dsty = 400; rect[0].width = 100; rect[0].height = 50; rect[1].srcx = 340;
. . .
error = (*dev->CopyRects) (dev, GXcopy, ~0,
rect, 2);
See also DMdDev Structure, DMdCopyRect Structure
90 | FillRects
FillRects
Purpose Use FillRects to draw an array of filled rectangles on
Syntax DError (*FillRects) (dev, rop, planeMask, value, r,
the screen.
nRects)
Parameter T ype Name Description
DMdDev dev
DLong rop
DLong planeMask
DLong value
DMdFillRect *r
DLong nRects
Device handle of the DOME device
Raster operation to apply (currently copy)
Plane mask to apply (currently all ones [1s])
Pixel value to fill rectangles with
Array of rectangles to draw Number of rectangles to
draw
Return value D_OK if successful; otherwise, an error code.
Description FillRects() takes an array of nRects structures of
DMdFillRect, containing rectangles to be filled, and draws
each rectangle on the screen using the pixel value value, applying the specified rasterop and plane mask while doing so.
Currently the only rasterop supported is copy; ignored. Also, planeMask is ignored, and all planes are written. For future compatibility, set rop to GXcopy (or 3), and planeMask to ~0 (all ones [1s]).
Errors DMD_ERROR_BAD_DEVICE - Device failed to complete
the rectangle fill.
rop is
Loading...