Display controller windows xp windows 2000 (9 pages)
Summary of Contents for Planar Dome Md2/PCI
Page 1
Dome Display Controller ® Md2/PCI, Md4/PCI, Md5/PCI, Md8/PCI PRODUCT DEVELOPER’S GUIDE Windows 2000 Windows NT 4.0 Solaris 2.x www.planar.com...
Page 2
October 2000 DOME is a registered trademark and DIMPL, DimplX, Calibration TQA, Md2/PCI, Md4/PCI, Md5/PCI, and Md8/PCI are trademarks of DOME imaging systems, inc. Microsoft, Windows, and Windows NT are trade- marks of Microsoft Corporation. PS/2 is a trademark of International Business Machines Corporation.
About This Guide Read this section for an overview of how to use this guide. Purpose This guide describes the architecture of the Md2/PCI,™ Md4/PCI,™ Md5/PCI,™ and Md8/PCI™ display control- lers (boards). It explains how to develop applications with these libraries: •...
About This Guide Conventions This table explains the conventions used in the guide. This convention... Monospaced type Italic type Bold type File -> Open <Key> Indicates... Computer code or directory; backslash (\) indicates continuation of previous line of UNIX code. New or technical term;...
Related documentation For more information about your board or related DOME products, refer to these books: • Md2/PCI Display Controller Installation Guide • Md4/PCI Display Controller Installation Guide • Md5/PCI Display Controller Installation Guide • Md8/PCI Display Controller Installation Guide •...
Md2/PCI Board Architecture This figure shows the Md2/PCI™ board architecture. Local Luminance Calibrat o i n Port Video Memory 4 MB VRAM GUI & Copy Accelerator (I-128) Masking Controller DRAM Md2/PCI board architecture Chapter 1 Video 10-bit DAC Video 10-bit DAC...
Board Architecture Md4/PCI Board Architecture This figure shows the Md4/PCI™ board architecture. Local Luminance Calibrat o i n Port* * PS/2 or access bus supported Video Memory 8 MB VRAM GUI & Copy Accelerator (I-128) Masking Controller DRAM DRAM Md4/PCI board architecture Video 10-bit DAC Video...
Md5/PCI Board Architecture This figure shows the Md5/PCI™ board architecture. GUI & Copy Local Accelerator (I-128) Luminance Calibrat o i n Port* * PS/2 or access bus supported Video Memory 8 MB VRAM DRAM Controller Md5/PCI board architecture Chapter 1 Video 10-bit DAC Optional VGA Video...
Gamma Correction and the 10-Bit DAC The Md2/PCI, Md4/PCI, Md5/PCI, and Md8/PCI display controllers (boards) use a 10-bit digital-to-analog converter (DAC) in their video output circuitry. Nearly all competi- tive 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...
Board Architecture The 10-bit DAC on the Md2/PCI, Md4/PCI, Md5/PCI, and Md8/PCI boards can produce up to 1024 distinct analog values. Thus, the boards can perform gamma correction and send 256 distinct pixel values to the monitor, to pro- duce a truer, more accurate grayscale image.
Dynamic Link Library Chapter 2 Dynamic Link Library In This Chapter • DLL Data Types • Windows NT DLL • Windows 2000 DLL • Using Functions in Multi-Monitor and Windows NT 4.0-Compatible Modes • New Functions in the Windows 2000 DLL •...
DLL Data Types mdpcint of functions that links Windows operating systems and DOME software applications. This section describes the data types specific to DOME as well as the Windows types and structures used in the DLL. DOME types The standard C types of different things to different compilers.
Dynamic Link Library Windows NT DLL All DOME Windows drivers include the library. This DLL provides an application interface to the driver. When working in Windows NT use only functions without the MM suffix. Other functions listed in this chapter are not available for the Windows NT operating system;...
Windows 2000 DLL All DOME Windows drivers include the library. This DLL provides an application interface to the driver. The Windows from previous versions of the DLL. For example, the new version of does not run on the Windows NT 4.0 operating system. But, given a Windows NT 4.0-compatible screen configura- tion, programs written for Windows NT 4.0 will work unchanged under Windows 2000 with the new DLL.
Page 21
Dynamic Link Library 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. •...
Multi-monitor mode Multi-monitor mode works with any Windows 2000 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 monitor.
Dynamic Link Library 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...
The Windows 2000 display number is the same as that passed to the GDI (graphical device interface) function EnumDisplayDevices minus one). The GDI call uses 32-bit numbers, while the DOME DLL uses 16-bit numbers. Example WIN2K_DISPLAY_NUMBER 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...
Page 25
Dynamic Link Library is only available in Windows NT 4.0- DDirectBlt compatible mode. Currently this function is not fully operational: although it splits the between screens correctly, GDI does not send the driver the correct clip, and the driver overdraws overlapping windows.
New Functions in the Windows 2000 DLL These functions exist only in multi-monitor mode and are new 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.
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… DGetDriverVersion DGetDriverVersionMM DGetLibraryVersion DGetBoardType DGetBoardTypeMM DGetNumBoards DGetNumScreens DGetMaxScreens DGetScreenDimensions DGetScreenPlacement DGetNumGCTBits DGetNumGCTBitsMM DGetNumGDIBits...
Page 28
For a description of this function… DCancelStartupGCT DGetRefreshRate DGetRefreshRateMM DCalibratorInit DCalibratorMeasure DGetFtLamScale DSerialCmd Description of DLL Functions (Cont.) Chapter 2 See page…...
DGetDriverVersion DGetDriverVersion Purpose Use DGetDriverVersion the DOME Windows driver. Syntax DWORD DGetDriverVersion (hdc, lpwDriverVersion) Parameter Type UWORD FAR * wDriverVersion Return value – zero (0) if function completed successfully; DWORD otherwise, operating system error code. to return the version number of DGetDriverVersion Parameters Name Description...
Page 30
Example This example returns the driver version in wDriverVersion #include <mdpcint.h> UWORD DWORD dwRetCode; dwRetCode + DGetDriverVersion (hdc, &wDriverVersion); return dwRetCode; See also DGetLibraryVersion hdc; wDriverVersion; DGetDriverVersion...
DGetDriverVersionMM DGetDriverVersionMM (Windows 2000, multi-monitor mode only) Purpose Use DGetDriverVersionMM DOME Windows driver for your board. Syntax DWORD DGetDriverVersionMM (hdc, nDisplay, lpDriverVersion) Parameter Type UWORD UWORD FAR * lpDriverVersion Pointer to UWORD. Return value DWORD – otherwise, operating system error code. to return the version of the DGetDriverVersionMM Parameters Name...
Page 32
Example This example returns the driver version in lpDriverVersion #include <mdpcint.h> UWORD WIN2K_DISPLAY_NUMBER; DWORD UWORD 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", dwRetCode = DGetDriverVersionMM (hdc, See also...
DGetLibraryVersion DGetLibraryVersion Purpose Use DGetLibraryVersion DOME Windows DLL. Syntax DWORD DGetLibraryVersion (lpwLibraryVersion) Parameter Type UWORD FAR * Return value DWORD – otherwise, operating system error code. Example This example returns the library version in wLibraryVersion #include <mdpcint.h> UWORD DWORD dwRetCode = DGetLibraryVersion (&wLibraryVersion);...
DGetBoardType (Obsolete in multi-monitor mode) Purpose Use DGetBoardType (Md2/PCI, Md4/PCI, Md5/PCI, or Md8/PCI). Syntax DWORD DGetBoardType (hdc, lpwBoardType) Parameter Type UWORD FAR * Return value DWORD – otherwise, operating system error code This function is valid with version 1.08 and later of the DLL.
Page 35
DGetBoardType Example This example returns the board type. #include <mdpcint.h> /* has board definitions */ UWORD DWORD dwRetCode = DGetBoardType (hdc, &wBoardType); return dwRetCode; See also DGetNumBoards hdc; wBoardType; dwRetCode;...
DGetNumBoards (Obsolete in Windows 2000) Purpose Use DGetNumBoards PCI boards in your system. Syntax DWORD DGetNumBoards (hdc, lpwNumBoards) Parameter Type UWORD FAR * wNumBoards Pointer to UWORD. It is always Return value DWORD – otherwise, operating system error code. See also DGetBoardType to return the number of DOME DGetNumBoards Parameters...
DGetNumScreens DGetNumScreens Purpose Use DGetNumScreens controlled by the DOME Windows driver. Syntax DWORD DGetNumScreens (hdc, lpwNumScreens) Parameter Type UWORD FAR * wNumScreens Return value DWORD – otherwise, operating system error code. Example This example returns the number of screens controlled by DOME Windows drivers.
DGetMaxScreens (Obsolete in Windows 2000) Purpose Use DGetMaxScreens of Md2/PCI, Md4/PCI, Md5/PCI, or Md8/PCI screens controlled by the DOME Windows driver. Syntax DWORD DGetMaxScreens (hdc, lpwNumScreens) Parameter Type UWORD FAR * wNumScreens Return value DWORD – otherwise, operating system error code.
DGetScreenDimensions DGetScreenDimensions Purpose Use DGetScreenDimensions of a single screen. Syntax DWORD DGetScreenDimensions (hdc, wScreenNumber, lpszSize) Parameter Type UWORD SIZE FAR * szSize Return value DWORD – otherwise, operating system error code. Structure This code fragment defines the typedef struct LONG cx; LONG cy;...
Page 42
Example This example returns the dimensions of screen zero (0). #include <windows.h> /* includes SIZE #include <mdpcint.h> SIZE DWORD dwRetCode = DGetScreenDimensions (hdc, 0, &szSize); return dwRetCode; Or, in Windows 2000 mode: dwRetCode = DGetScreenDimensions (NULL, WIN2K_DISPLAY_NUMBER | 0, &szSize); Or, in Windows 2000 mode with an unattached display: dwRetCode = DGetScreenDimensions (hdc, WIN2K_DISPLAY_NUMBER, &szSize);...
DGetScreenPlacement DGetScreenPlacement Purpose Use DGetScreenPlacement the screen in Windows space. Syntax DWORD DGetScreenPlacement (hdc, wScreenNumber, lpptPoint) Parameter Type UWORD POINT FAR * ptPoint Return value DWORD – otherwise, operating system error code. This function returns an error for unattached displays. Structure This code fragment defines the typedef struct LONG x;...
Page 44
Example This example returns the x,y position of screen one (1) in the Windows desktop. #include <windows.h> /* includes POINT #include <mdpcint.h> POINT DWORD dwRetCode = DGetScreenPlacement (hdc, 1, &ptPosition); return dwRetCode; See also DGetNumScreens, DGetScreenDimensions, DGetRefreshRate, DGetRefreshRateMM definition */ hdc;...
DGetNumGCTBits DGetNumGCTBits Purpose Use DGetNumGCTBits correction bits. Syntax DWORD DGetNumGCTBits (hdc, lpNumRedBits, lpNumGreenBits, lpNumBlueBits) Parameter Type DWORD FAR * lpNumRedBits Return value DWORD – otherwise, operating system error code. Example This example returns the number of gamma correction bits. #include <mdpcint.h> DWORD DWORD dwRetCode = DGetNumGCTBits (hdc, &NumRedBits,...
DGetNumGCTBitsMM (Windows 2000, multi-monitor mode only) Purpose Use DGetNumGCTBitsMM correction bits. Syntax DWORD DGetNumGCTBitsMM (hdc, nDisplay, lpNumRedBits, lpNumGreenBits, lpNumBlueBits) Parameter Type UWORD DWORD FAR * lpNumRedBits Return value DWORD – otherwise, operating system error code. Example This example returns the number of gamma correction bits. #include <mdpcint.h>...
DGetNumGDIBits DGetNumGDIBits Purpose Use DGetNumGDIBits GDI bits. Syntax DWORD DGetNumGDIBits (hdc, lpNumRedBits, lpNumGreenBits, lpNumBlueBits) Parameter Type DWORD FAR * lpNumRedBits Return value DWORD – otherwise, operating system error code. Example This example returns the number of GDI bits. #include <mdpcint.h> DWORD DWORD dwRetCode = DGetNumGDIBits (hdc, &NumRedBits,...
DGetNumGDIBitsMM (Windows 2000, multi-monitor mode only) Purpose Use DGetNumGDIBitsMM Windows GDI bits. Syntax DWORD DGetNumGDIBitsMM (hdc, nDisplay, lpNumRedBits, lpNumGreenBits, lpNumBlueBits) Parameter Type UWORD DWORD FAR * lpNumRedBits Return value DWORD – otherwise, operating system error code. to return the number of DGetNumGDIBitsMM Parameters Name nDisplay...
Page 49
DGetNumGDIBitsMM Example This example returns the number of GDI bits. #include <mdpcint.h> UWORD DWORD DWORD dwRetCode = DGetNumGDIBitsMM (NULL, nDisplay, &NumRedBits, &NumGreenBits, &NumBlueBits); return dwRetCode; See also DGetScreenDimensions, DGetNumGCTBitsMM hdc; nDisplay; dwRetCode; NumRedBits, NumGreenBits, NumBlueBits;...
DGetSisterDisplayRegPathMM (Windows 2000, multi-monitor mode only) Purpose Use DGetSisterDisplayRegPathMM path of the Windows 2000 sister display. Syntax DWORD FAR PASCAL DGetSisterDisplayRegPathMM (hdc, nDisplay, *lpRegPath, szRegPath) Parameter Type UWORD char FAR *lpRegPath On successful return, contains the Return value Zero (0) if successful; otherwise, an error message. DGetSisterDisplayRegPathMM Parameters Name Description...
Page 51
DGetSisterDisplayRegPathMM Example This example returns the registry path of the sister display to the target display. #include <mdpcint.h> UWORD WIN2K_DISPLAY_NUMBER; DWORD char dwRetCode = DGetSisterDisplayRegPathMM (NULL, nDisplay, lpRegPath, 256); return dwRetCode; See also DGetSisterDisplayNumberMM hdc; nDisplay = (UWORD) Win2000DisplayNum | dwRetCode;...
DGetSisterDisplayNumberMM (Windows 2000, multi-monitor mode only) Purpose Use DGetSisterDisplayNumberMM Windows 2000 display number of the sister display. Syntax DWORD FAR PASCAL DGetSisterDisplayNumberMM (hdc, nDisplay, lpDisplayNum) Parameter Type UWORD UWORD FAR Return value Zero (0) if successful; otherwise, an error message. Example This example returns the Windows 2000 display number of the sister display.
DDirectBlt DDirectBlt (Obsolete in multi-monitor mode) Purpose Use DDirectBlt data from the host to the screen(s). Syntax DWORD DDirectBlt (hdc, DestX, DestY, SrcX, SrcY, Width, Height, SrcStride, lpSrc) Parameter Type void * to provide a direct transfer of image DDirectBlt Parameters Name Description Handle to the display-device...
Page 54
When you use SrcX + Width bounds of the source image. Otherwise, you risk a system memory access error. Return value DWORD – otherwise, operating system error code. Example This example transfers image data from the host to the screen. #include <mdpcint.h>...
DGetPaletteTypeMM DGetPaletteTypeMM (Windows 2000, multi-monitor mode only) Purpose Use DGetPaletteTypeMM the Windows 2000 display. Syntax DGetPaletteTypeMM (hdc, nDisplay, lppalType) Parameter Type UWORD UWORD FAR *palType Palette type of display; on successful Return value Zero (0) if successful; otherwise, an error message. Example This example returns the palette type of the display.
DSetGCT Purpose Use DSetGCT Syntax DWORD DSetGCT (hdc, wScreenNumber, lpgct) Parameter Type UWORD GAMMA_ CORRECTION_ TABLE FAR * Return value DWORD – otherwise, operating system error code. Grayscale boards use green values only. to set the GCT for a particular screen. DSetGCT Parameters Name wScreenNumber...
Page 57
DSetGCT Structure This code fragment defines the only valid structure for the GAMMA_CORRECTION_TABLE typedef struct UWORD Reserved1; UWORD Reserved2; UWORD ArraySize; UWORD Red[256]; UWORD Green[256]; UWORD Blue[256]; } GAMMA_CORRECTION_TABLE; DSetGCT fields in the field must be 256. Example This example sets the GCT for screen zero (0). #include <mdpcint.h>...
DGetGCT Purpose Use DGetGCT Syntax DWORD DGetGCT (hdc, wScreenNumber, lpgct) Parameter Type UWORD GAMMA_ CORRECTION_ TABLE FAR * Return value DWORD – otherwise, operating system error code. Structure The code fragment on page 49 defines the GAMMA_CORRECTION_TABLE DGetGCT fields in the field must be 256.
Page 59
DGetGCT Example This example returns the GCT for screen zero (0). #include <mdpcint.h> /* includes GAMMA_ GAMMA_CORRECTION_TABLE DWORD dwRetCode = DGetGCT (hdc, 0, &gct); return dwRetCode; See also DSetGCT, DSetStartupGCT, DCancelStartupGCT CORRECTION_TABLE definition */ hdc; gct; dwRetCode;...
DSetStartupGCT Purpose Use DSetStartupGCT screen. This table loads whenever you start the Windows operating system. The GCT supplied to this function takes effect only when you restart Windows. can also replace a previous startup table. Syntax DWORD DSetStartupGCT (wScreenNumber, lpFileName) Parameter Type UWORD...
Page 61
DSetStartupGCT Structure This code fragment defines the structure. typedef struct UDWORD UWORD UWORD UWORD UWORD UWORD } GCT_FILE_FORMAT; ArraySize Example This example sets the initial GCT for screen zero (0). #include <mdpcint.h> DWORD dwRetCode = DSetStartupGCT (0, "screen0.gct"); return dwRetCode; See also DCancelStartupGCT, DGetGCT, DSetGCT GCT_FILE_FORMAT...
DCancelStartupGCT Purpose Use DCancelStartupGCT 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 Type UWORD...
DGetRefreshRate DGetRefreshRate (Obsolete in multi-monitor mode) Purpose Use DGetRefreshRate Syntax DWORD DGetRefreshRate (hdc, lpwRefreshRate) Parameter Type UWORD FAR * wRefreshRate Pointer to UWORD. It is filled Return value DWORD – otherwise, operating system error code. Example This example returns the refresh rate of the screen. #include <mdpcint.h>...
DGetRefreshRateMM (Windows 2000, multi-monitor mode only) Purpose Use DGetRefreshRateMM refresh rate. Syntax DWORD DGetRefreshRateMM (hdc, nDisplay, lpRefreshRate) Parameter Type UWORD UWORD FAR * lpRefreshRate Return value DWORD – otherwise, operating system error code. Example This example returns the refresh rate of the screen. #include <mdpcint.h>...
DCalibratorInit DCalibratorInit Purpose Use DCalibratorInit Calibration TQA™ and prepare it for taking measurements. Syntax DWORD DCalibratorInit (hdc, wScreenNumber, lpInitStruct) Parameter Type UWORD INIT_ CALIBRATOR_ STRUCT FAR * Return value DWORD – otherwise, operating system error code. Structure This code fragment defines the structure.
Page 66
MeasurementTime which the sample is taken in (page 60). This parameter must be greater than 17 and less than 1,179,630. When measuring a periodic source such as a monitor, sample at an integer number of periods. Setting the proper integration time for a monitor at a specific frequency is essential to obtaining accurate, repeatable measurements.
Page 67
DCalibratorInit Example This example initializes the DOME Calibration TQA and prepares it for taking measurements on screen one (1). #include <mdpcint.h> /* includes INIT_ INIT_CALIBRATOR_STRUCT InitStruct; DWORD InitStruct.Version = 2; InitStruct.ReadTimeout = 2000; /* Set InitStruct.MeasurementTime using the dwRetCode = DCalibratorInit (hdc, 1, &InitStruct);...
DCalibratorMeasure Purpose Use DCalibratorMeasure from the DOME Calibration TQA and return the result. Syntax DWORD DCalibratorMeasure (hdc, wScreenNumber, lpdwMeasure) Parameter Type UWORD DWORD FAR * dwMeasure Return value DWORD – otherwise, operating system error code. to take a measurement DCalibratorMeasure Parameters Name wScreenNumber Target screen number zero (0) if function completed successfully;...
Page 69
DCalibratorMeasure Example This example returns the screen luminance on screen one (1), as measured by the calibration system. #include <mdpcint.h> DWORD DWORD dwRetCode = DCalibratorMeasure (hdc, 1, &dwMeasure); return dwRetCode; See also DCalibratorInit, DGetFtLamScale hdc; dwMeasure; dwRetCode;...
DGetFtLamScale Purpose Use DGetFtLamScale convert calibration measurement units to foot Lamberts. Syntax DWORD DGetFtLamScale (hdc, wScreenNumber, lpdScale) Parameter Type UWORD double * Return value DWORD – otherwise, operating system error code. to get the scale factor used to DGetFtLamScale Parameters Name wScreenNumber dScale...
Page 71
DGetFtLamScale Example This example returns the scale factor to convert the calibration measurement units to foot Lamberts. #include <mdpcint.h> UWORD DWORD double dwRetCode = DGetFtLamScale (hdc, wScreenNumber, &dScale); return dwRetCode; See also DCalibratorInit, DCalibratorMeasure hdc; wScreenNumber; dwRetCode; dScale;...
DSerialCmd Purpose Use DSerialCmd 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 Type UWORD UWORD UBYTE FAR * to write command bytes to the PS/2 DSerialCmd Parameters Name Description...
Page 73
DSerialCmd Parameter Type UWORD UBYTE FAR * DWORD Return value DWORD – otherwise, operating system error code. All structures are packed on 1-byte boundaries. DSerialCmd Parameters (Cont.) Name wnumResponse- Bytes ResponseBuffer Buffer to receive the dwTimeout zero (0) if function completed successfully; Description Number of bytes to be read from the port after...
Page 74
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> UWORD DWORD UBYTE DWORD /* Put command bytes in CmdBuffer, and set dwRetCode = DSerialCmd (hdc, 0, wnumCmdBytes, &CmdBuffer, wnumResponseBytes, &ResponseBuffer, dwTimeout);...
DOME MDlib API Function Reference Chapter 3 DOME MDlib API Function Reference In This Chapter • MDlib API Types • MDlib API Structures • MDlib API Functions...
MDlib API Types The standard C types of 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 1 byte 2 bytes 4 bytes 4 bytes 4 bytes...
DOME MDlib API Function Reference MDlib API Structures Use this table to quickly locate the MDlib API structures described in this section. For this structure… DMdVersion DMdCopyRect DMdFillRect DMdDev DMdVersion Structure Purpose The DMdVersion API version. DMdVersion returned by the the program executes, it checks to see if the version of domeMd.h that of the MDlib API.
Page 78
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 runs correctly with a newer MDlib API. Structure This table defines the DMdVersion struct { DShort DByte DByte...
DMdCopyRect Structure DMdCopyRect Structure Purpose The DMdCopyRect copying. Structure This table defines the DMdCopyRect Member Description struct { DULong DULong DULong DULong DULong DULong } DMdCopyRect structure accelerates screen-to-screen structure. DMdCopyRect DMdCopyRect Structure The x screen coordinate of the srcx upper-left corner pixel of the source rectangle.
DMdFillRect Structure Purpose The DMdFillRect Structure This table defines the DMdFillRect struct { DULong DULong DULong DULong } DMdFillRect structure accelerates screen filling. structure. DMdFillRect DMdFillRect Structure Member Description The x screen coordinate of the dstx upper-left corner pixel of the destination rectangle The y screen coordinate of the dsty...
DMdDev Structure DMdDev Structure Purpose The DMdDev structure that accesses to the DOME MDlib device returned by also called the device handle. Structure This table defines the DMdDev struct { DMdVersion DLong DVoid DLong DBool DVoid DVoid DLong DLong DLong DLong struct fbtype *(*FbType) () DLong...
Page 82
DMdDev DError DError DError DError DError DError DError DError DError DVoid DVoid DVoid DVoid DVoid DVoid DVoid DVoid DVoid } DMdDev All structure members, except both 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 MDlib API Functions Use this reference to the DOME MDlib API functions to write applications. The two followed by the other functions in the order in which they appear as members of the Description of MDlib API Functions For a description of this function…...
DMdOpen Purpose Use DMdOpen Syntax DMdDev DMdOpen (name) Parameter Type DChar Return value Device handle if successful; otherwise, Description DMdOpen() and returns the device handle, which provides access to the device. To close the DOME device, use the member function (page 78) of the returned device handle. Errors If DMdOpen() stderr...
DMdFdOpen DMdFdOpen Purpose Use DMdFdOpen file is already open. Syntax DMdDev DMdFdOpen (fd) Parameter Type DLong Return value Device handle if successful; otherwise, Description DMdFdOpen() open file descriptor that provides access to the device. To close the DOME device, use the of the returned device handle.
Close Purpose Use Close Syntax DVoid (*Close) (dev) Parameter Type DMdDev Return value None. Description Close() with either Close() old device handle. Errors None. Example This example closes the device handle #include "domeMd.h" DMdDev dev = DMdOpen ("/dev/md2pci0.0"); (*dev->Close) (dev); See also DMdOpen, DMdFdOpen, DMdDev Structure to end access to a DOME device.
RefreshRate RefreshRate Purpose Use RefreshRate mode setting. Syntax DLong (*RefreshRate) (dev) Parameter Type DMdDev Return value An integer equal to 100 times the refresh rate in Hz, if successful. If the monitor mode is not set to a supported mode, Description RefreshRate() the refresh rate of the monitor mode setting.
FbVideo Purpose Use FbVideo Syntax DBool (*FbVideo) (dev, on) Parameter Type DMdDev DBool Return value if video was on before the call; TRUE was off. Description FbVideo() off if (on or off) before this call takes effect. Errors None. Example This example turns the display video off. #include "domeMd.h"...
MapFb MapFb Purpose Use MapFb the program to access the framebuffer directly. Syntax DVoid *(*MapFb) (dev) Parameter Type DMdDev Return value A pointer to the beginning of the framebuffer if successful; otherwise, Description MapFb() of the caller and returns a pointer to the beginning of that space.
Page 90
Example This example maps the framebuffer. #include "domeMd.h" DMdDev char pFb = (*dev->MapFb) (dev); See also UnmapFb, FbSize, DMdDev Structure dev; *pFb; MapFb...
UnmapFb UnmapFb Purpose Use UnmapFb Syntax DVoid (*UnmapFb) (dev) Parameter Type DMdDev Return value None. Description UnmapFb() address space of the caller, freeing up any system resources that have been allocated. Attempts to access the frame- buffer using the pointer formerly obtained from will result in an error.
FbSize Purpose Use FbSize Syntax DLong (*FbSize) (dev) Parameter Type DMdDev Return value Size of framebuffer in bytes. Description FbSize() bytes. Attempts to access locations beyond the size of the framebuffer will result in an error. Errors None. Example This example returns the size of the framebuffer. #include "domeMd.h"...
FbWidth FbWidth Purpose Use FbWidth Syntax DLong (*FbWidth) (dev) Parameter Type DMdDev Return value Width in pixels of the visible portion of the framebuffer. Description FbWidth() portion of the framebuffer. Access to locations beyond the visible portion of the frame- buffer is reserved.
FbHeight Purpose Use FbHeight Syntax DLong (*FbHeight) (dev) Parameter Type DMdDev Return value Height in pixels of the visible portion of the framebuffer. Description FbHeight() portion of the framebuffer. Access to locations beyond the visible portion of the framebuffer is reserved. Errors None.
FbPitch FbPitch Purpose Use FbPitch Syntax DLong (*FbPitch) (dev) Parameter Type DMdDev 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 framebuffer.
FbType Purpose Use FbType information about the framebuffer. Syntax struct fbtype *(*FbType) (dev) Parameter Type DMdDev Return value Pointer to Sun Description FbType() containing information about the framebuffer. Errors None. Example This example returns the Sun the framebuffer. #include "domeMd.h" DMdDev struct fbtype fbType = (*dev->FbType) (dev);...
BitsPerPixel BitsPerPixel Purpose Use BitsPerPixel the framebuffer. Syntax DLong (*BitsPerPixel) (dev) Parameter Type DMdDev Return value Number of bits per pixel of the framebuffer. Description BitsPerPixel() the framebuffer. Errors None. Example This example returns the bits and bytes per pixel of the framebuffer.
CopyRects Purpose Use CopyRects an array of rectangles. Syntax DError (*CopyRects) (dev, rop, planeMask, r, nRects) Parameter Type DMdDev DLong DLong DMdCopyRect DLong Return value if successful; otherwise, an error code. D_OK Description CopyRects() DMdCopyRect, tion rectangles, and copies each source rectangle to the destination, applying the specified rasterop and plane mask while doing so.
Page 99
CopyRects Currently the only rasterop supported is copy; ignored. Also, written to the screen. For future compatibility, set to GXcopy (or 3), and Errors DMD_ERROR_BAD_DEVICE - rectangle copy. Example This example copies two rectangles from one location on the screen to another. #include "domeMd.h"...
FillRects Purpose Use FillRects the screen. Syntax DError (*FillRects) (dev, rop, planeMask, value, r, nRects) Parameter Type DMdDev DLong DLong DLong DMdFillRect DLong Return value if successful; otherwise, an error code. D_OK Description FillRects() DMdFillRect, draws each rectangle on the screen using the pixel value value, while doing so.
Page 101
FillRects Errors DMD_ERROR_BAD_DEVICE - rectangle fill. Example This example draws two rectangles on the screen using the pixel value 20. #include "domeMd.h" DMdDev DMdFillRect DError rect[0].dstx = 50; rect[0].dsty = 45; rect[0].width = 80; rect[0].height = 65; rect[1].dstx = 30; error = (*dev->FillRects) (dev, GXcopy, ~0, 20, rect, 2);...
InitCmap Purpose Use InitCmap Syntax DError (*InitCmap) (dev) Parameter Type DMdDev Return value if successful; otherwise, an error code. D_OK Description InitCmap() to a linear ramp. hardware with this linear ramp. Errors DMD_ERROR_BAD_DEVICE - colormap. Example This example initializes the colormap to a linear ramp. #include "domeMd.h"...
WriteCmap WriteCmap Purpose Use WriteCmap Syntax DError (*WriteCmap) (dev, i, r, g, b) Parameter Type DMdDev DLong DLong DLong DLong Return value if successful; otherwise, an error code. D_OK Description WriteCmap() color ( colormap. You can write multiple entries by calling WriteCmap() effective unless you call the For an 8-bit-per-pixel framebuffer, the colormap entry...
Page 104
Example This example writes colormap entry 4 with the color yellow. #include "domeMd.h" DMdDev DError error = (*dev->WriteCmap) (dev, 4, 0xff, 0xff, 0); See also InitCmap, ReadCmap, UpdateCmap, DMdDev Structure dev; error; WriteCmap...
UpdateCmap UpdateCmap Purpose Use UpdateCmap Syntax DError (*UpdateCmap) (dev) Parameter Type DMdDev Return value if successful; otherwise, an error code. D_OK Description UpdateCmap() the current values in the colormap. Errors DMD_ERROR_BAD_DEVICE - colormap. Example This example loads the colormap into the colormap hardware.
ReadCmap Purpose Use ReadCmap Syntax DError (*ReadCmap) (dev, i, r, g, b) Parameter Type DMdDev DLong DLong DLong DLong Return value if successful; otherwise, an error code. D_OK Description ReadCmap() the color in ( the colormap. Errors DMD_ERROR_BAD_DEVICE - the colormap. DMD_ERROR_BAD_VALUE - too large.
Page 107
ReadCmap Example This example reads colormap entry 79. #include "domeMd.h" DMdDev DLong DError error = (*dev->ReadCmap) (dev, 79, &r, &g, &b); See also InitCmap, WriteCmap, UpdateCmap, DMdDev Structure dev; r, g, b; error;...
InitGCT Purpose Use InitGCT Syntax DError (*InitGCT) (dev) Parameter Type DMdDev Return value if successful; otherwise, an error code. D_OK Description InitGCT() a linear ramp. this linear ramp. Errors DMD_ERROR_BAD_DEVICE - the GCT. Example This example initializes the GCT to a linear ramp. #include "domeMd.h"...
WriteGCT WriteGCT Purpose Use WriteGCT Syntax DError (*WriteGCT) (dev, i, r, g, b) Parameter Type DMdDev DLong DLong DLong DLong Return value if successful; otherwise, an error code. D_OK Description WriteGCT() To write multiple entries, call times. The new values are not effective unless you call UpdateGCT() For an 8-bit-per-entry colormap, the GCT entry index ranges from 0 (zero) to 255.
Page 110
Example This example writes GCT entry 15. #include "domeMd.h" DMdDev DError error = (*dev->WriteGCT) (dev, 15, 60, 68, 54); See also InitGCT, ReadGCT, UpdateGCT, DMdDev Structure dev; error; WriteGCT...
UpdateGCT UpdateGCT Purpose Use UpdateGCT Syntax DError (*UpdateGCT) (dev) Parameter Type DMdDev Return value if successful; otherwise, an error code. D_OK Description UpdateGCT() current values in the GCT. Errors DMD_ERROR_BAD_DEVICE - the GCT. Example This example loads the GCT into the GCT hardware. #include "domeMd.h"...
ReadGCT Purpose Use ReadGCT Syntax DError (*ReadGCT) (dev, i, r, g, b) Parameter Type DMdDev DLong DLong DLong DLong Return value if successful; otherwise, an error code. D_OK Description ReadGCT() gamma values in ( entry of the GCT. Errors DMD_ERROR_BAD_DEVICE - the GCT.
Page 113
ReadGCT Example This example reads GCT entry 34. #include "domeMd.h" DMdDev DLong DError error = (*dev->ReadGCT) (dev, 34, &r, &g, &b); See also InitGCT, WriteGCT, UpdateGCT, DMdDev Structure dev; r, g, b; error;...