dgVoodoo API for Version 2.7

dgVoodoo API for Version 2.7

Previous API versions are compatible with dgVoodoo 2.7.

This version contains the following components that you can utilize in your application:

  • Control Panel DDI interfaces (ICPLDDI)
  • dgVoodoo config file read/write interfaces (IConfig)
  • INI Parser interfaces (IINIParser)

The implementation of those C++ interfaces are compiled into a dll (dgVoodooAPI.dll).

dgVoodoo components rely on those interfaces too, but they are linked statically against the library.


Overview

dgVoodoo API documentation
Overview

dgVoodoo API Overview

This section contains a (very) short overview for dgVoodoo API.

dgVoodoo API is intended for developers/modders who would like to distribute their patched games or other stuffs bundled with dgVoodoo
and go beyond the possibilities the CPL configuration utility provides, by their custom configuration frontends.

So, this version of the library provides access to 3 main separate areas as of the functionality:

  • Reading, writing and validating dgVoodoo configuration files (or, I'd say property sets)
  • Getting information about the underlying graphics hardware and their display outputs
  • A general parser for INI-property sets for optional custom usage

The structure of the API consists of

  • Some functions for initializing/shutting down the library
  • Instanced objects with pure C++ interfaces (similar to Microsoft's COM - but these are not COM objects)
  • Structures and enumerations within structures for describing various data

Overview topics:

  • Initializing and shutting down the library
  • Configuration data and its input/output
  • Information for graphics hardware and display outputs
  • INI parser


Library version, initializing and shutting down

Library version, initializing and shutting down

  • Altough you know what version of the library you are coding your stuff for, you may need to make sure about the correct version.
    Simply call dgVoodoo_API_GetVersion to query the library version.
    This function can be called without initializing the library itself.

  • The very first thing you need to do is initialize the library before doing anything else.
    Function dgVoodoo_API_Init both initializes the library and returns an interface pointer to the singleton object IMainFactory.
    You can reach out and create other object instances through that factory object. If library init fails then NULL pointer is returned and you cannot continue.

  • After you finished with the library and released all instances of created objects, you must call function dgVoodoo_API_Exit to avoid memory and resource leaks.


Configuration data and its input/output

Configuration data and its input/output

dgVoodoo's configuration data is simply stored in a structure. The main structure consists of more sub-structures for various classes of dgVoodoo's configurable data.
Sub-structuring reflects the sections of the INI format and the tab pages of the CPL. The CPL however does not exposes all the sections of the configuration.

This data structure has its own inline default constructors, so if you simply declare

dgVoodoo::Config config;
then you have a config instance containing dgVoodoo's default configuration.
There are no functions or methods for modifying the elements of the structure. You can access its members directly, for example
dgVoodoo::Config config;

config.general.centerAppWindow = true;
config.directX.cardType = dgVoodoo::ConfigDirectX::Geforce4Ti4800;

I think structure members and its valid values are mostly clear and self-speaking, except the following areas:
  • Ordinals of graphics adapters and display outputs.
    Adapters and outputs are enumerated on a local system, so their ordinals can change machine by machine.
    Say, if a system has two graphics adapters then the ordinal of the first is 1 and the ordinal of the second is 2.
    This value is written to ConfigGeneral::rendererDevice. 0 means 'AdapterAll' and this is the default.
    It's not recommended at all to distribute a config file with a non-0 adapter ordinal because dgVoodoo may fail to initialize on other systems that have less graphics adapters available than the ordinal defines.
    Always let the user change it locally on his/her system if it needed at all.

    Ordinals of display outputs in fact is defined in the same way.
    Say, a system has one graphics adapter with two monitors attached to it, then ordinals are the following:
    • Adapter ordinal: 1
    • Monitor1 ordinal: 1
    • Monitor2 ordinal: 2
    Monitor ordinal is written to ConfigGeneral::renderingOutput.
    Value 0 means 'default'. It's recommended to handle display output ordinals in the same way as adapter ordinals, for the same reason.
    A given display output is always identified in a unique way only by a pair of (adapter ordinal, output ordinal).
  • Members describing resolution and refresh rate (for both Glide and DirectX)
    Defining a resolution is simple: just write the desired horizontal and vertical values into Config*::resWidth and Config*::resHeight.
    There are however special values for unforced and dynamic resolutions. Enumeration ConfigGeneral::Resolution defines them.
    For defining such a special resolution value, just write the desired enumeration value into the resolution members, like
    config.directX.resWidth = config.directX.resHeight = dgVoodoo::ConfigGeneral::R_Max_ISF;

    Dynamic resolution R_IntegerScaled has an extra parameter, the scale factor. It can be defined in the following way, for e.g. 3x application resolution:
    config.directX.resWidth = dgVoodoo::ConfigGeneral::R_IntegerScaled;
config.directX.resHeight = 3;

    Refresh rates are defined in rational form instead of a single integer value, to describe the monitor refresh rate as precisely as possible.
    For example, for a monitor having refresh rate of 60.01 Hz, this value can be defined as 6001/100, so the appropriate structure members are filled like this:
    config.directX.refRateNumerator = 6001;
config.directX.refRateDenominator = 100;
    You always obtain supported refresh rate values through an ICPLDDI object.

    Extra enumerable resolutions for DirectX can also have special values max, max_4_3 and max_16_9 defining the desktop resolution itself and maximum resolutions calculated from the desktop resolution with 4:3 and 16:9 aspect ratios, respectively.
    Fill the members like
    config.directX.extraResolutions[0].width = dgVoodoo::ConfigGeneral::R_Max;
config.directX.extraResolutions[0].height = dgVoodoo::ConfigGeneral::R_Max;
    and
    config.directX.extraResolutions[0].width = dgVoodoo::ConfigGeneral::R_Max;
config.directX.extraResolutions[0].height = dgVoodoo::ConfigGeneral::PR_Max_4_3;
    and
    config.directX.extraResolutions[0].width = dgVoodoo::ConfigGeneral::R_Max;
config.directX.extraResolutions[0].height = dgVoodoo::ConfigGeneral::PR_Max_16_9;
    for defining them.
    Refresh rates for extra resolutions are simple integers because they are user-defined and are not obtained from and ICPLDDI object.
  • Members describing Display ROI
    ROI position can either be defined as a pixel position, like
    config.generalExt.displayROIPosX = 320;
config.generalExt.displayROIPosY = 200;
    or it can be a predefined value, currently one is existing:
    config.generalExt.displayROIPosX = dgVoodoo::ConfigGeneralExt::DROI_Centered;
config.generalExt.displayROIPosY = dgVoodoo::ConfigGeneralExt::DROI_Centered;

    ROI size can either be defined as a pixel size, like
    config.generalExt.displayROISizeX = 640;
config.generalExt.displayROISizeY = 400;
    or it can be a proportion (size X / size Y), say, defining a 21:9 aspect ratio is done like this:
    config.generalExt.displayROISizeX = dgVoodoo::ConfigGeneralExt::DROI_Rational;
config.generalExt.displayROISizeY = (21L << 16) | (9L << 0);

For managing configuration data input/output, you must query the interface of the singleton IConfig object.
There are some variants of methods for data reading and writing, including reading/writing from/to file, file handle and custom implemented streams.
A short example for a simple config data modification:
dgVoodoo::IConfig* pConfig = pMainFactory->GetIConfig ();
if (pConfig != NULL) {

    dgVoodoo::Config config;
    if (pConfig->ReadConfig (config, "myconfigfile.conf")) {

        config.directX.resWidth = 1280;
        config.directX.resHeight = 1024;

        if (pConfig->WriteConfig (config, "myconfigfile.conf", NULL)) {
            // we are happy - just modified DirectX resolution to 1280x1024
        }
    }
}
The example above reads a dgVoodoo configuration from file "myconfigfile.conf" which can be either an INI-format or a binary one.
Some structure members are modified and the configuration is written back to the same file.
Write method writes binary format in this case because NULL pointer is defined for the INI-template.

Hmm... how to write an INI format config file? If you are happy with dgVoodoo's default template then just query it from IConfig:

// This function shouldn't return NULL - but if it does, then the written config file will just be binary

const char* pIniTemplate = pConfig->GetINITemplate ();

if (pConfig->WriteConfig (config, "myconfigfile.conf", pIniTemplate)) {
    // succeeded
}
Well, it's a bit lame for the time being, but IConfig can only write INI format through templates that contains all the properties that the default template does and their order must even match.
In other words, you can only create your own template by removing/adding comments to the default template. There is no way to write partial INI property set through IConfig.

Sometimes you may want to ensure that your Config data structure contains valid values and you aren't working with some garbage.
IConfig::ValidateConfig tells you the answer. Originally I intended that method for debugging purposes so the debug layer gives you extended feedback about the detected problems.

And at last, there is a utility method. IConfig::IsResolutionTypeDynamic tells you if a resolution is dynamic or static.

if (pConfig->IsResolutionTypeDynamic (config.glide.resWidth, config.glide.resHeight)) {
    // don't display the values to the user - needs more interpretation
} else {
    // resWidth and resHeight contains single values immediately
}


Control Panel DDI (CPLDDI)

Control Panel DDI (CPLDDI)

You can use CPL DDI object interface to query information about the underlying graphics hardware, the attached display outputs and their supported resolutions and MSAA levels.
A CPL DDI object is API-specific. All the information queried is coming from the API that the CPL DDI objects is backed by.
CPL DDI objects are singletons and interface pointers can be queried for them through IMainFactory.

CPL DDI objects can be in activated and inactivated state. When activated, its backing API (e.g. Direct3D11) is initialized and is in usage. Only one CPL DDI object can be active at a time, to avoid conflicts between multiple backing API's.
When a CPL DDI object becomes activated then all the information like available adapters, display outputs and resolutions are (re)collected.
All kind of objects are accessible through indexing. You just retrieve the number of the objects of the required type and reference to them as indexes from 0 to (num-1).

  • Adapter: denotes a video card (or an integrated GPU) that can have display outputs attached to it.
  • Display output: denotes a monitor or any other device that can display output image coming from the adapter. A display output is identified as a pair of (adapter index, output index).
  • Resolution: A list of supported resolutions is always specific to a display output.
  • MSAA level: A list of supported MSAA levels is always specific to an adapter.

For more, see the sample application.


IniParser

IniParser

INI property sets are textual (ASCII) data containing

  • Properties: consist of a name and zero or more values and zero or more subproperties
  • Sections: Named subsets of properties for grouping; each property name is only unique in the section in which it's declared
IniParser objects provide functionality for
  • parsing data containers (file or custom implemented stream) as INI property sets and storing parsed data
  • querying the parsed and stored data set

Format of INI property sets

Sections

  • Each section has a name.
  • When declaring a section, its name must be enclosed by squared brackets.
  • The only exception is the global (default) section that has no name. Empty square brackets denotes the global section.
  • More than one section can be included within a line.

Properties

  • Each property is included in one of the sections.
  • Only one property can be declared within a line.
  • A property can have values and subproperties.
  • A property name is always followed by an equal sign '=' even if the property has no any value or subproperty.
  • Property values are separated by white spaces or commas from each other; Values can be enclosed by quotation marks - its unavoidable if the value contains space characters.
  • Subproperties are enumerated after value items; they also have a name and a mandatory value, separated by a colon without white spaces.

Comments

  • Comment delimiter character is ';'
  • Any character after the delimiter character is treated as comment up to the end of the line

Example

Color1 = BLUE                         ; we have just declared a property named "Color1" with one value, "BLUE" in the global section

[Geometry]
Shapes1 = rectangle, triangle         ; Entering section 'Geometry' and declared 'Shapes1' property with two values, "rectangle" and "triangle"
Shapes2 = "rotated rectangle" circle  ; Declaring 'Shapes2' property with two values, "rotated rectangle" and "circle"
Shapes3 =                             ; Declaring 'Shapes3' property with no values

[Topology] []                         ; Declared empty section 'Topology' and then declared the global section again, returning to that

Color2 = red R:255 G:0 B:0            ; Declared property 'Color2' with one value 'red' and 3 subproperties R, G, B with subproperty values 255, 0, 0 respectively

Using IniParser objects

IniParser objects are instanced objects and any number of them can be created through IMainFactory::CreateINIParser method.
After creation, it contains an empty property set. To fill it with some useful data, you must parse a property set by one of the IIniParser::Parse methods.
Each sections, properties within sections, values within properties and subproperties within properties are referenced by indexing. Use the proper IIniParser methods to query the number of each of them.
When an IniParser object is no longer needed you must release it explicitly by calling its Release method.

Say, we have the property set of the example written to a file 'properties.ini'.
dgVoodoo::IIniParser* pSet = pMainFactory->CreateINIParser ();
if (pSet != NULL) {

    if (pSet->Parse ("properties.ini", dgVoodoo::IIniParser::LowerCase)) {

        // Ok, if method succeeds then format of the file was ok and pSet contains the following set, converted to lower case

        // Number of sections: 3
        // Section 0 name: "" (it's the global section)
        //      Property 0: name "color1", value 0: "blue", no subproperties
        //      Property 1: name "color2", value 0: "red",
        //                  subproperty 0 name: "r", value: "255", subproperty 1 name: "g", value: "0", subproperty 2 name: "b", value: "0"
        // Section 1 name: "geometry"
        //      Property 0: name "shapes1", value 0: "rectangle", value 1: "triangle"
        //      Property 1: name "shapes2", value 0: "rotated rectangle", value 1: "circle"
        //      Property 2: name "shapes3", no values
        // Section 2 name: "topology"
        //      no properties

        // Query the information above with the appropriate methods
    }
    pSet->Release ();
}


Reference

dgVoodoo API documentation
Reference

dgVoodoo API Reference

This section contains reference information for the API elements of dgVoodoo API.

  • Enumerations
  • Interfaces
  • Functions
  • Structures


Interfaces

Interfaces

This section contains reference information for API interfaces:

  • APIObject
  • IMainFactory
  • IConfig
  • ICPLDDI
  • IIniParser


APIObject

APIObject

Some of the objects created by dgVodooo API are inherited from this base interface.

Destruction Release

Requirements

Header: APIObject.hpp
Library: dgVoodooAPI.lib


APIObject::Release

APIObject::Release

Releases the instance of an object inherited from this interface.

void     Release ();

Remarks

Altough this mechanism is similar to IUnkonwn interface of Microsoft's COM, dgVoodoo API objects are not reference counted.
After this method returns, the object instance is deleted and becomes invalid.

Requirements

Header: APIObject.hpp


IMainFactory

IMainFactory

Applications use this interface either to retrieve pointers to other interfaces or create new objects.

Retrieving interfaces | GetCPLDDIObject
 | GetIConfig
Creating objects | CreateIniParser

Requirements

Header: IMainFactory.hpp
Library: dgVoodooAPI.lib

See Also

dgVoodoo_API_Init


IMainFactory::CreateIniParser

IMainFactory::CreateIniParser

Creates a new instance of an INI property set parser object.

IIniParser*	CreateIniParser (
    const APIDebugObj* pDebug = NULL
);

Parameters

pDebug
[in] Optional debug object. This parameter can be NULL.

Return value

If successful, this function returns a pointer to an IIniParser interface.

NULL pointer is returned otherwise.

Remarks

When the object instance is no longer needed, you must release it explicitly by calling Release method of the object.

Requirements

Header: IMainFactory.hpp


IMainFactory::GetCPLDDIObject

IMainFactory::GetCPLDDIObject

Returns a pointer to one of the CPL DDI singleton objects.

ICPLDDI*	GetCPLDDIObject (
    ConfigGeneral::RendererAPI api,
    const APIDebugObj* pDebug = NULL
);

Parameters

api
[in] Required API type

 API_Direct3D12_FL12_0
 Direct3D 12 with feature level 12.0

 API_Direct3D12_FL11_0
 Direct3D 12 with feature level 11.0

 API_Direct3D11_FL11_0
 Direct3D 11 with feature level 11.0

 API_Direct3D11_FL10_1
 Direct3D 11 with feature level 10.1

 API_Direct3D11_FL10_0
 Direct3D 11 with feature level 10.0

 API_Direct3D11_MS_WARP_FL10_1
 Direct3D 11 WARP with feature level 10.1

 API_BestAvailable

pDebug
[in] Optional debug object. This parameter can be NULL.

Return value

If successful, this function returns a pointer to an ICPLDDI interface.

NULL pointer can be returned if the required API type is not available for some reason.

Remarks

When defining RendererAPI::API_BestAvailable for the required API then the library returns the interface for the object representing the best API currently available on the system. In this version D3D12 is never chosen automatically because of some known issues that are planned to be resolved in subsequent releases. Also, feature level only defines a minimum for D3D12. Unlike in D3D11, feature levels cannot be forced in D3D12. It always initializes itself at the maximum available that is greater-equal to the specified minimum.

Requirements

Header: IMainFactory.hpp


IMainFactory::GetIConfig

IMainFactory::GetIConfig

Returns a pointer to the singleton object providing functionality for handling dgVoodoo config files.

IConfig*	GetIConfig ();

Return value

A pointer to the config file handling IConfig object. This method always succeeds.

Remarks

Requirements

Header: IMainFactory.hpp


ICPLDDI

ICPLDDI

Applications use this interface to retrieve information about the underlying graphics hardware and display outputs.

Activation | Activate
 | Deactivate
Information | GetAPIName
 | GetAPI
 | GetAPIType
 | GetAdapterName
 | GetNumberOfAdapters
 | GetNumberOfMSAALevels
 | GetNumberOfOutputs
 | GetNumberOfResolutions
 | GetMSAALevel
 | GetOutputDesc
 | GetRefreshRateSimple
 | GetResolution

Requirements

Header: ICPLDDI.hpp


ICPLDDI::Activate

Activates a CPL DDI object which means enumerating all the adapters (GPU's) that are available through the API type the object representing.
Also, all the additional information like attached display outputs, supported resolutions and MSAA levels are collected.

bool	Activate ();

Return value

Returns true if object activation is successful and there is at least one system adapter supporting the given API.

Returns false in the following cases (and the object remains unactivated):

  • Another CPL DDI object is currently being active
  • There is no any adapter supporting the given API
  • Initializing the API fails for some reasons

Remarks

Only one CPL DDI object can be in activated state at a time.

When a CPL DDI object gets activated then potential changes in the state of available adapters and their outputs since the last activation are detected and information is recollected.
For example, if a display output is removed from one of the adapters then reactivating the CPL DDI takes it into account.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::Deactivate

ICPLDDI::Deactivate

Deactivates a CPL DDI object representing a given API type.

void	Deactivate ();

Return value

This method has no return value.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetAdapterName

ICPLDDI::GetAdapterName

Returns the name of the adapter.

bool   GetAdapterName (
    UInt32 adapterIdx,
    WCHAR* pName
);

Parameters

adapterIdx
[in] Index of the adapter
pName
[out] Pointer to a buffer to be filled with a zero terminated string.

Return value

Returns true if the method succeeds.
If adapterIdx is out of range or pName is invalid then returns false.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetAPIName

ICPLDDI::GetAPIName

Returns the name of the API the object is representing.

const char*    GetAPIName ()

Return value

A const pointer to a zero terminated ASCII string.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetAPI

ICPLDDI::GetAPI

Returns the API the object is representing.

ConfigGeneral::RendererAPI          GetAPI ();

Return value

One of the elements of enumeration ConfigGeneral::RendererAPI.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetAPIType

ICPLDDI::GetAPIType

Returns the API type the object is representing. This method is changed compared to previous API versions.

APIType          GetAPIType ();

Return value

One of the elements of enumeration ICPLDDI::APIType.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetMSAALevel

ICPLDDI::GetMSAALevel

Returns a supported MSAA level.

UInt32     GetMSAALevel (
    UInt32 adapterIdx,
    UInt32 idx
);

Parameters

adapterIdx
[in] Index of the adapter
idx
[in] Index of the MSAA level to be queried

Return value

If the method succeeds then the level of MSAA.
Zero if adapterIdx or idx is out of range.

Remarks

Returned integer represents an MSAA level. For example, 2 represents 2x MSAA, 4 is 4x MSAA, and so forth.
dgVoodoo supports 16x as a maximum.
Value 1 means no MSAA which is always supported so it is not enumerated by this method.
Value 0 is an invalid MSAA level meaning an error.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetNumberOfAdapters

ICPLDDI::GetNumberOfAdapters

Returns the number of adapters that are accessible through this object.

UInt32     GetNumberOfAdapters ();

Return value

Number of adapters. Adapters can be indexed from 0 to (number of adapters)-1.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetNumberOfMSAALevels

ICPLDDI::GetNumberOfMSAALevels

Returns the number of MSAA levels supported by the adapter.

UInt32     GetNumberOfMSAALevels (
    UInt32 adapterIdx
);

Parameters

adapterIdx
[in] Index of the adapter

Return value

If adapterIdx is valid then number of supported MSAA levels.
Zero if adapterIdx is out of range.

Remarks

MSAA levels can be indexed from 0 to (number of MSAA levels)-1.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetNumberOfOutputs

ICPLDDI::GetNumberOfOutputs

Returns the number of display outputs that are attached to the adapter.

UInt32     GetNumberOfOutputs (
    UInt32 adapterIdx
);

Parameters

adapterIdx
[in] Index of the adapter

Return value

If adapterIdx is valid then number of attached display outputs.
Zero if adapterIdx is out of range.

Remarks

Display output can be indexed from 0 to (number of outputs)-1.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetNumberOfResolutions

ICPLDDI::GetNumberOfResolutions

Returns the number of supported resolutions on the display output attached to an adapter.

UInt32     GetNumberOfResolutions (
    UInt32 adapterIdx,
    UInt32 outputIndex,
    ConfigGeneral::ScanlineOrder scanlineOrder
);

Parameters

adapterIdx
[in] Index of the adapter
outputIndex
[in] Index of the display output
scanlineOrder
[in] Scan line ordering mode

Return value

If the method succeeds then the number of supported resolutions.
Zero if adapterIdx or outputIndex is out of range or scanlineOrder is invalid.

Remarks

Resolutions can be indexed from 0 to (number of resolutions)-1.
Scan line ordering can only be

  • SO_OutputDefault: All the resolution supported including interlaced display modes.
  • SO_Progressive: Resolution only that are available with progressive scanline order.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetOutputDesc

ICPLDDI::GetOutputDesc

Returns information about a display output attached to the adapter.

bool     GetOutputDesc (
    UInt32 adapterIdx,
    UInt32 outputIdx,
    OutputDesc* pDesc
);

Parameters

adapterIdx
[in] Index of the adapter
outputIdx
[in] Index of the display output
pDesc
[out] Pointer to an OutputDesc structure to be filled with information

Return value

True if the methods succeeds.
False if adapterIdx or outputIdx is out of range or pDesc is invalid.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetRefreshRateSimple

ICPLDDI::GetRefreshRateSimple

Returns the simple form of a refresh rate given in rational form.

UInt32     GetRefreshRateSimple (
    UInt32 refRateNumerator,
    UInt32 refRateDenominator
);

Parameters

refRateNumerator
[in] Numerator of the rational form
refRateDenominator
[in] Denominator of the rational form

Return value

Simple (non-rational) form of a refresh value.

Remarks

This is a utility method for converting refresh rates from rational to single form.

0/0 and 0/1 are valid and their simple form is 0. Value 0 denotes undefinied refresh rate.

Requirements

Header: ICPLDDI.hpp


ICPLDDI::GetResolution

ICPLDDI::GetResolution

Returns information about a display mode.

bool     GetResolution (
    UInt32 adapterIdx,
    UInt32 outputIdx,
    UInt32 resIdx,
    ConfigGeneral::ScanlineOrder scanlineOrder,
    ModeDesc* pDesc
);

Parameters

adapterIdx
[in] Index of the adapter
outputIdx
[in] Index of the display output
resIdx
[in] Index of the display mode
scanlineOrder
[in] Mode of the scanline ordering - this parameter denotes the resolution list to return information from
pDesc
[out] Pointer to an ModeDesc structure to be filled with information

Return value

True if the methods succeeds.
False if adapterIdx, outputIdx or resIdx is out of range or scanlineOrder, pDesc is invalid.

Remarks

Resolutions can be indexed from 0 to (number of resolutions)-1.
Parameter scan line ordering selects the display mode list to pick up a resolution from

  • SO_OutputDefault: All the resolution supported including interlaced display modes.
  • SO_Progressive: Resolution only that are available with progressive scanline order.

Requirements

Header: ICPLDDI.hpp


IConfig

IConfig

Applications use this interface to read and write dgVoodoo configuration structures.

Read | Read (file, c-string)
 | Read (file, widechar-string)
 | Read (handle)
 | Read (stream)
Write | Write (file, c-string)
 | Write (file, widechar-string)
 | Write (handle)
 | Write (stream)
Miscellaneous | GetINITemplate
 | IsResolutionTypeDynamic

Requirements

Header: IConfig.hpp


IConfig::GetINITemplate

IConfig::GetINITemplate

Returns the default template of an INI-format config property set.

const char*     GetINITemplate ();

Return value

A const pointer to the template. This can be directly fed into the Write methods.

Requirements

Header: IConfig.hpp


IConfig::IsResolutionTypeDynamic

IConfig::IsResolutionTypeDynamic

Returns if width/height members of a resolution defines a dynamic resolution.

bool     IsResolutionTypeDynamic (
    UInt32 width,
    UInt32 height
);

Parameters

width
[in] Width of the resolution
height
[in] Height of the resolution

Return value

True if the resolution is a dynamic one. If it is then its values needs further interpretation.

Requirements

Header: IConfig.hpp


IConfig::ReadConfig

IConfig::ReadConfig

Reads dgVoodoo configuration from a file.

bool     ReadConfig (
    Config& toConfig,
    const char* pFileName,
    const APIDebugObj* pDebug = NULL
);

Parameters

toConfig
[out] Reference to a Config structure to read the configuration into
pFileName
[in] Zero terminated c-string of the file path to read from
pDebug
[in] Optional Debug object to use for debug output. This parameter can be NULL.

Return value

True if the methods succeeds, false if pFileName is invalid or some error occured during the read.

Remarks

This method can read both binary and INI version of config files, file denoted by pPFilename can be of both type. All config file versions from 2.5 to current version are supported.

Requirements

Header: IConfig.hpp


IConfig::ReadConfig

IConfig::ReadConfig

Reads dgVoodoo configuration from a file.

bool     ReadConfig (
    Config& toConfig,
    const wchar_t* pFileName,
    const APIDebugObj* pDebug = NULL
);

Parameters

toConfig
[out] Reference to a Config structure to read the configuration into
pFileName
[in] Zero terminated widechar-string of the file path to read from
pDebug
[in] Optional Debug object to use for debug output. This parameter can be NULL.

Return value

True if the methods succeeds, false if pFileName is invalid or some error occured during the read.

Remarks

This method can read both binary and INI version of config files, file denoted by pPFilename can be of both type. All config file versions from 2.5 to current version are supported.

Requirements

Header: IConfig.hpp


IConfig::ReadConfig

IConfig::ReadConfig

Reads dgVoodoo configuration from an opened file identified by a file handle.

bool     ReadConfig (
    Config& toConfig,
    HANDLE hFile,
    const APIDebugObj* pDebug = NULL
);

Parameters

toConfig
[out] Reference to a Config structure to read the configuration into
hFile
[in] Handle of the file
pDebug
[in] Optional Debug object to use for debug output. This parameter can be NULL.

Return value

True if the methods succeeds, false if file handle is invalid or some error occured during the read.

Remarks

This method can read both binary and INI version of config files, file identified by hFile can be of both type. All config file versions from 2.5 to current version are supported.
Note that config is always tried to be read from the beginning of the file and the file should contain no other data than the config itself.
Current file position is undefined after the method returns.

Requirements

Header: IConfig.hpp


IConfig::ReadConfig

IConfig::ReadConfig

Reads dgVoodoo configuration from an IAPIDataStream object.

bool     ReadConfig (
    Config& toConfig,
    IAPIDataStream* pStream,
    const APIDebugObj* pDebug = NULL
);

Parameters

toConfig
[out] Reference to a Config structure to read the configuration into
pStream
[in] The stream to read from
pDebug
[in] Optional Debug object to use for debug output. This parameter can be NULL.

Return value

True if the methods succeeds, false if pStream is invalid or some error occurs during the read.

Remarks

This method can read both binary and INI version of config files, file identified by pStream can be of both type. All config file versions from 2.5 to current version are supported.
Stream should implement GetSize, Seek and Read to succeed. Note that config is always tried to be read from the beginning of the stream and the stream should contain no other data than the config itself.
Current stream position is undefined after the method returns.

Requirements

Header: IConfig.hpp


IConfig::WriteConfig

IConfig::WriteConfig

Writes dgVoodoo configuration into a file.

bool     WriteConfig (
    const Config& fromConfig,
    const char* pFileName,
    const char* pINITemplate = NULL,
    const APIDebugObj* pDebug = NULL
);

Parameters

fromConfig
[in] Reference to a Config structure to write the configuration from
pFileName
[in] Zero terminated c-string of the file path to write to
pINITemplate
[in] Template of an INI file
pDebug
[in] Optional Debug object to use for debug output. This parameter can be NULL.

Return value

True if the methods succeeds, false if pFileName is invalid or some error occured during the write.

Remarks

This method can write both binary and INI version of config files, versioned to the current library version.
If pINITemplate is NULL then binary version is written. If an INI-template is specified then it must contain all of the configuration properties, in the same order as dgVoodoo default config file.

Requirements

Header: IConfig.hpp


IConfig::WriteConfig

IConfig::WriteConfig

Writes dgVoodoo configuration into a file.

bool     WriteConfig (
    const Config& fromConfig,
    const wchar_t* pFileName,
    const char* pINITemplate = NULL,
    const APIDebugObj* pDebug = NULL
);

Parameters

fromConfig
[in] Reference to a Config structure to write the configuration from
pFileName
[in] Zero terminated widechar-string of the file path to write to
pINITemplate
[in] Template of an INI file
pDebug
[in] Optional Debug object to use for debug output. This parameter can be NULL.

Return value

True if the methods succeeds, false if pFileName is invalid or some error occured during the write.

Remarks

This method can write both binary and INI version of config files, versioned to the current library version.
If pINITemplate is NULL then binary version is written. If an INI-template is specified then it must contain all of the configuration properties, in the same order as dgVoodoo default config file.

Requirements

Header: IConfig.hpp


IConfig::WriteConfig

IConfig::WriteConfig

Writes dgVoodoo configuration into a file denoted by a file handle.

bool     WriteConfig (
    const Config& fromConfig,
    const HANDLE* hFile,
    const char* pINITemplate = NULL,
    const APIDebugObj* pDebug = NULL
);

Parameters

fromConfig
[in] Reference to a Config structure to write the configuration from
hFile
[in] Opened handle of a writable file
pINITemplate
[in] Template of an INI file
pDebug
[in] Optional Debug object to use for debug output. This parameter can be NULL.

Return value

True if the methods succeeds, false if hFile is invalid or some error occured during the write.

Remarks

This method can write both binary and INI version of config files, versioned to the current library version.
If pINITemplate is NULL then binary version is written. If an INI-template is specified then it must contain all of the configuration properties, in the same order as dgVoodoo default config file.

Note that data is written to the current file position and its offseted by the size of the written data when the method returns.

Requirements

Header: IConfig.hpp


IConfig::WriteConfig

IConfig::WriteConfig

Writes dgVoodoo configuration into a file denoted by a file handle.

bool     WriteConfig (
    const Config& fromConfig,
    IAPIDataStream* pToStream,
    const char* pINITemplate = NULL,
    const APIDebugObj* pDebug = NULL
);

Parameters

fromConfig
[in] Reference to a Config structure to write the configuration from
pToStream
[in] Stream object to write to
pINITemplate
[in] Template of an INI file
pDebug
[in] Optional Debug object to use for debug output. This parameter can be NULL.

Return value

True if the methods succeeds, false if hFile is invalid or some error occured during the write.

Remarks

This method can write both binary and INI version of config files, versioned to the current library version.
If pINITemplate is NULL then binary version is written. If an INI-template is specified then it must contain all of the configuration properties, in the same order as dgVoodoo default config file.

Note that data is written to the current stream position. Stream object must implement Write to succeed.

Requirements

Header: IConfig.hpp


IIniParser

IIniParser

Applications use this interface to parse an INI property set and get its properties and property values. Inherits from APIObject.

Parsing | Parse (file, c-string)
 | Parse (file, widechar-string)
 | Parse (stream)
Sections | GetNumberOfSections
 | GetSectionName
Properties | GetNumberOfProperties
 | GetPropertyName
Property values | GetNumberOfPropertyValues
 | GetPropertyValueAsString
 | GetPropertyValueAsInt
Subproperty values | GetNumberOfSubProperties
 | GetSubPropertyName
 | GetSubPropertyValueAsString
 | GetSubPropertyValueAsInt

Requirements

Header: IIniParser.hpp


IIniParser::DbgDump

IIniParser::DbgDump

Dumps the entire property set currenty stored in the object.

void     DbgDump ();

Remarks

Dump is written to the current debug output.
Also, this method is only available in Debug and SpecRelease builds and serves only debugging purposes. In Release builds it does nothing.

Requirements

Header: IIniParser.hpp


IIniParser::Parse

IIniParser::Parse

Parses an INI-format property set from a file and stores them in the object, overwriting the current set.

bool     Parse (
    const char* pFileName,
    StringType* stringType
);

Parameters

pFileName
[in] Zero terminated c-string of the file path to parse from
stringType
[in] StringType method for converting the strings when storing them as a set

Return value

True if the methods succeeds, false if pFileName is invalid or some error occured during parsing.

Requirements

Header: IIniParser.hpp


IIniParser::Parse

IIniParser::Parse

Parses an INI-format property set from a file and stores them in the object, overwriting the current set.

bool     Parse (
    const wchar_t* pFileName,
    StringType* stringType
);

Parameters

pFileName
[in] Zero terminated widechar-string of the file path to parse from
stringType
[in] StringType method for converting the strings when storing them as a set

Return value

True if the methods succeeds, false if pFileName is invalid or some error occured during parsing.

Requirements

Header: IIniParser.hpp


IIniParser::Parse

IIniParser::Parse

Parses an INI-format property set from the beginning of a stream and stores them in the object, overwriting the current set.

bool     Parse (
    IAPIDataStream* pStream,
    StringType* stringType
);

Parameters

pStream
[in] A stream implementation to parse from
stringType
[in] StringType method for converting the strings when storing them as a set

Return value

True if the methods succeeds, false if pStream is invalid or some error occured during parsing.

Remarks

Stream object must implement Seek and Read to succeed.
Note that parsing is always done from the beginning of the stream which should contain no other data than the INI property set itself.

Requirements

Header: IIniParser.hpp


IIniParser::GetNumberOfProperties

IIniParser::GetNumberOfProperties

Returns the number of properties the given section is containing.

UInt32     GetNumberOfProperties (
    UInt32 sectionIdx
);

Return value

Number of properties in the given section.

Remarks

If a given section is defined in the INI property set but has no properties then this method returns 0.
Also, 0 is returned if sectiondIdx is out of range.
Properties can be indexed from 0 to (number of properties)-1 when referencing them.

Requirements

Header: IIniParser.hpp


IIniParser::GetNumberOfPropertValues

IIniParser::GetNumberOfPropertValues

Returns the number of values that a property in the given section has.

UInt32     GetNumberOfPropertValues (
    UInt32 sectionIdx,
    UInt32 propertyIdx
);

Parameters

sectionIdx
[in] Index of the section
propertyIdx
[in] Index of the property in the section

Return value

Number of property values.

Remarks

Zero is returned if sectionIdx or propertyIdx is out of range or the property has no values defined.
Values can be indexed from 0 to (number of values)-1.

Requirements

Header: IIniParser.hpp


IIniParser::GetNumberOfSections

IIniParser::GetNumberOfSections

Returns the number of sections in the property set.

UInt32     GetNumberOfSections ();

Return value

Number of sections in the propery set.

Remarks

Note that the global section (the one that has no name) is always included in the property set even if it has no properties.
Sections can be indexed from 0 to (number of sections)-1 when referencing them.

Requirements

Header: IIniParser.hpp


IIniParser::GetNumberOfSubProperties

IIniParser::GetNumberOfSubProperties

Returns the number of subproperties of the given property.

UInt32     GetNumberOfSubProperties (
    UInt32 sectionIdx,
    UInt32 propertyIdx
);

Return value

Number of subproperties for the given property.

Remarks

Zero is returned if sectionIdx or propertyIdx is out of range, or the given property has no subproperties defined.
Subproperties can be indexed from 0 to (number of subproperties)-1 when referencing them.

Requirements

Header: IIniParser.hpp


IIniParser::GetPropertyName

IIniParser::GetPropertyName

Returns the name of a property in the given section.

const char*     GetPropertyName (
    UInt32 sectionIdx,
    UInt32 propertyIdx
);

Parameters

sectionIdx
[in] Index of the section
propertyIdx
[in] Index of the property in the section

Return value

A const pointer to the zero terminated c-string of the property name.

Remarks

NULL pointers are returned if sectionIdx or propertyIdx is out of range.

Requirements

Header: IIniParser.hpp


IIniParser::GetPropertyValueAsInt

IIniParser::GetPropertyValueAsInt

Interprets and returns a property value as an integer number.

bool     GetPropertyValueAsInt (
    UInt32 sectionIdx,
    UInt32 propertyIdx,
    UInt32 valueIdx,
    Int32& value
);

Parameters

sectionIdx
[in] Index of the section
propertyIdx
[in] Index of the property in the section
valueIdx
[in] Index of the property value
value
[out] Reference to an Int32 to store the interpreted value

Return value

If a property value can be interpreted as an integer then this method returs true.
False is returned otherwise.

Remarks

Reference to value is filled by the parsed integer value if the method succeeds.

Requirements

Header: IIniParser.hpp


IIniParser::GetPropertValueAsString

IIniParser::GetPropertValueAsString

Returns a value of a property as a zero terminated c-string.

const char*     GetPropertyValueAsString (
    UInt32 sectionIdx,
    UInt32 propertyIdx,
    UInt32 valueIdx
);

Parameters

sectionIdx
[in] Index of the section
propertyIdx
[in] Index of the property in the section
valueIdx
[in] Index of the property value

Return value

A const pointer to the c-string.

Remarks

NULL pointer is returned if sectionIdx, propertyIdx or valueIdx is out of range.

Requirements

Header: IIniParser.hpp


IIniParser::GetSectionName

IIniParser::GetSectionName

Returns the name of the given section.

const char*     GetSectionName (
    UInt32 sectionIdx
);

Parameters

sectionIdx
[in] Index of the section

Return value

A const pointer to the zero terminated c-string of the name.

Remarks

Global section has no name and the function returns NULL pointer for that one.
Also, NULL pointer is returned if sectionIdx is out of range.

Requirements

Header: IIniParser.hpp


IIniParser::GetSubPropertyName

IIniParser::GetSubPropertyName

Returns the name of a subproperty for a given property.

const char*     GetSubPropertyName (
    UInt32 sectionIdx,
    UInt32 propertyIdx,
    UInt32 subPropertyIdx
);

Parameters

sectionIdx
[in] Index of the section
propertyIdx
[in] Index of the property in the section
subPropertyIdx
[in] Index of the subproperty for the given property

Return value

A const pointer to the zero terminated c-string of the property name.

Remarks

NULL pointers are returned if sectionIdx, propertyIdx or subPropertyIdx is out of range.

Requirements

Header: IIniParser.hpp


IIniParser::GetSubPropertyValueAsInt

IIniParser::GetSubPropertyValueAsInt

Interprets and returns a subproperty value as an integer number.

bool     GetSubPropertyValueAsInt (
    UInt32 sectionIdx,
    UInt32 propertyIdx,
    UInt32 subPropertyIdx,
    Int32& value
);

Parameters

sectionIdx
[in] Index of the section
propertyIdx
[in] Index of the property in the section
subPropertyIdx
[in] Index of subproperty for the given property
value
[out] Reference to an Int32 to store the interpreted value

Return value

If a subproperty value can be interpreted as an integer then this method returs true.
False is returned otherwise.

Remarks

Reference to value is filled by the parsed integer value if the method succeeds.

Requirements

Header: IIniParser.hpp


IIniParser::GetSubPropertyValueAsString

IIniParser::GetSubPropertyValueAsString

Returns a value of a property as a zero terminated c-string.

const char*     GetSubPropertyValueAsString (
    UInt32 sectionIdx,
    UInt32 propertyIdx,
    UInt32 subPropertyIdx
);

Parameters

sectionIdx
[in] Index of the section
propertyIdx
[in] Index of the property in the section
subPropertyIdx
[in] Index of subproperty for the give property

Return value

A const pointer to the c-string.

Remarks

NULL pointer is returned if sectionIdx, propertyIdx or subPropertyIdx is out of range.

Requirements

Header: IIniParser.hpp


Enumerations

Enumerations

This section contains reference information for API enumerations:

  • IIniParser::StringType


IIniParser::StringType

IIniParser::StringType

This enumeration has members for defining how to convert the strings of an INI property set when reading.

enum StringType
{
    CaseSensitive   = 0,
    LowerCase,
    UpperCase
};

Remarks

Every single string including section/property/subproperty and value names of an INI property set are affected.

Requirements

Header: IIniParser.hpp


Functions

Functions

This section contains reference information for API funtions:

  • dgVoodoo_API_GetVersion
  • dgVoodoo_API_Init
  • dgVoodoo_API_Exit


dgVoodoo_API_Init

dgVoodoo API documentation
dgVoodoo_API_Init

dgVoodoo_API_Init ()

Initializes dgVoodoo API library and returns the interface for the main factory object.

This is the function that must be called before using any other library component.

 IMainFactory	API_EXPORT *	dgVoodoo_API_Init ();

Return value

If successful, this function returns a pointer to a IMainFactory interface.

If initialization fails then NULL pointer is returned.

Remarks

When finished with the library, the application must call dgVoodoo_API_Exit to do the needed cleanup.

Requirements

Header: IMainFactory.hpp


dgVoodoo_API_Exit

dgVoodoo API documentation
dgVoodoo_API_Exit

dgVoodoo_API_Exit ()

This function does the cleanup and shuts down the library.

void	API_EXPORT	dgVoodoo_API_Exit ();

Return value

This function has no return value.

Remarks

It must be called when the library is no longer needed, to avoid memory- and resource leaks.

Requirements

Header: IMainFactory.hpp


dgVoodoo_API_GetVersion

dgVoodoo API documentation
dgVoodoo_API_GetVersion

dgVoodoo_API_GetVersion ()

This function returns the version of the API library. This is the only function that can be called without initializing the library.

UInt32 	API_EXPORT	dgVoodoo_API_GetVersion ();

Return value

A BCD-coded integer representing the version number.

Remarks

Each digit of the version number is encoded into 4 bit fields.
So, for example, 0x262 means version 2.62.

Requirements

Header: IMainFactory.hpp


Structures

Structures

This section contains reference information for API structures:

  • APIDebugObj
  • Config
  • ConfigDebug
  • ConfigDirectX
  • ConfigDirectXExt
  • ConfigGeneral
  • ConfigGeneralExt
  • ConfigGlide
  • ConfigGlideExt
  • ICPLDDI::OutputDesc
  • ICPLDDI::ModeDesc


APIDebugObj

APIDebugObj

This is a simple container structure describing severity/tracing levels, output string prefix and an optional output stream for debug layer feedback.

struct APIDebugObj
{
    enum InfoLevel
    {
        DisableInfo       = 0,
        EnableInfo,
        EnableInfoAndBreak
    };

    enum WarningLevel
    {
        DisableWarning    = 0,
        EnableWarning,
        EnableWarningAndBreak
    };

    enum ErrorLevel
    {
        DisableError      = 0,
        EnableError,
        EnableErrorAndBreak
    };

    InfoLevel           infoLevel;
    WarningLevel        warningLevel;
    ErrorLevel          errorLevel;
    const char*         pPrefixString;
    UInt32              maxTraceLevel;
    IAPIDataStream*     pOutputStream;

    InfoLevel       inline          GetInfoLevel () const;
    WarningLevel    inline          GetWarningLevel () const;
    ErrorLevel      inline          GetErrorLevel () const;
    UInt32          inline          GetMaxTraceLevel () const;
    void            inline          SetDebugInfo (InfoLevel _infoLevel,
                                                  WarningLevel _warningLevel,
                                                  ErrorLevel _errorLevel,
                                                  const char* _pPrefixString,
                                                  UInt32 _maxTraceLevel,
                                                  IAPIDataStream* _pOutputStream = NULL);

    APIDebugObj (InfoLevel _infoLevel,
                 WarningLevel _warningLevel,
                 ErrorLevel _errorLevel,
                 const char* _pPrefixString,
                 UInt32 _maxTraceLevel,
                 IAPIDataStream* _pOutputStream = NULL);
};

Requirements

Header: APIDebugObj.hpp


Config

Config

This structure contains dgVoodoo configuration data.

struct Config
{
    ConfigGeneral        general;
    ConfigGlide          glide;
    ConfigDirectX        directX;

    ConfigGeneralExt     generalExt;
    ConfigGlideExt       glideExt;
    ConfigDirectXExt     directXExt;

    ConfigDebug          debug;
};

Requirements

Header: dgVoodooConfig.hpp


ConfigDebug

ConfigDebug

This structure contains Debug dgVoodoo options.

struct ConfigDebug
{
    enum Severity
    {
        D_Disable,
        D_Enable,
        D_EnableBreak
    };

    Severity     info;
    Severity     warning;
    Severity     error;
    UInt32       maxTraceLevel;
    bool         logToFile;

    ConfigDebug ():
        info            (D_Enable),
        warning         (D_Enable),
        error           (D_Enable),
        maxTraceLevel   (0),
        logToFile       (false)
    {
    }
};

Requirements

Header: dgVoodooConfig.hpp


ConfigDirectX

ConfigDirectX

This structure contains DirectX dgVoodoo options that are exposed through the Control Panel.

struct ConfigDirectX
{
    enum CardType
    {
        SVGA                = 0,
        Virtual3D,
        Geforce4Ti4800,
        Radeon8500,
        MatroxParhelia512,
        GeforceFX5700Ultra,

        NumOfCardTypes
    };

    enum TexFilterType
    {
        TF_AppDriven        = 0,
        TF_ForcePoint       = 0x100,
        TF_ForceBilinear    = 0x200,
        TF_ForceLinearMip   = 0x300,
        TF_ForceTrilinear   = 0x400,
        TF_ForceAniso1x     = 1,
        TF_ForceAniso2x     = 2,
        TF_ForceAniso3x     = 3,
        TF_ForceAniso4x     = 4,
        TF_ForceAniso5x     = 5,
        TF_ForceAniso6x     = 6,
        TF_ForceAniso7x     = 7,
        TF_ForceAniso8x     = 8,
        TF_ForceAniso9x     = 9,
        TF_ForceAniso10x    = 10,
        TF_ForceAniso11x    = 11,
        TF_ForceAniso12x    = 12,
        TF_ForceAniso13x    = 13,
        TF_ForceAniso14x    = 14,
        TF_ForceAniso15x    = 15,
        TF_ForceAniso16x    = 16,

        TF_AnisoMask        = 0xFF
    };

    CardType     cardType;
    UInt32       videoMemSize;
    UInt32       resWidth;
    UInt32       resHeight;
    UInt32       msaaLevel;
    UInt32       refRateNumerator;
    UInt32       refRateDenominator;
    UInt32       texFilterType;
    bool         disabledAndPassThru;
    bool         appControlledScreenState;
    bool         disableAltEnter;
    bool         watermark;
    bool         linearBltStretch;
    bool         applyPhongShading;
    bool         forceVSync;
    bool         disableMipmapping;
    bool         fastVideoMemAccess;

    ConfigDirectX ():
        cardType                    (Virtual3D),
        videoMemSize                (64*1024*1024),
        resWidth                    (0),
        resHeight                   (0),
        msaaLevel                   (0),
        refRateNumerator            (0),
        refRateDenominator          (0),
        texFilterType               (TF_AppDriven),
        disabledAndPassThru         (false),
        appControlledScreenState    (true),
        disableAltEnter             (true),
        watermark                   (true),
        linearBltStretch            (false),
        applyPhongShading           (false),
        forceVSync                  (false),
        disableMipmapping           (false),
        fastVideoMemAccess          (false)
    {
    }
};

Requirements

Header: dgVoodooConfig.hpp


ConfigDirectXExt

ConfigDirectXExt

This structure contains DirectX dgVoodoo options that are not exposed through the Control Panel by default.

#define MAX_NUM_OF_DX_EXTRA_RESOLUTIONS    16

struct ConfigDirectXExt
{
    enum AdapterIDType
    {
        AIDT_Default      =  0,
        AIDT_nVidia,
        AIDT_AMD,
        AIDT_Intel
    };

    enum DitheringEffect
    {
        DE_Pure32Bit      =  0,
        DE_Ordered2x2,
        DE_Ordered4x4,

        NumOfDitheringEffects,
    };

    enum Dithering
    {
        DT_Disabled       =  0,
        DT_AppDriven,
        DT_ForceOn16Bit,
        DT_ForceAlways,

        NumOfDitheringBehaviors
    };

    enum DepthBufferBitDepth
    {
        DBD_AppDriven     =  0,
        DBD_ForceMin24,
        DBD_Force32,

        NumOfDepthBufferBitDepths
    };

    enum DefEnumResolutions
    {
        DER_None          =  0,
        DER_Classics,
        DER_All,

        NumOfDefEnumResolutions
    };

    enum EnumResBitDepths
    {
        ERBD_8            =   0x1,
        ERBD_16           =   0x2,
        ERBD_32           =   0x4,
        ERBD_All          =   0x7
    };

    struct ExtraResolution
    {
        UInt32   width;
        UInt32   height;
        UInt32   refRate;
    };

    AdapterIDType        adapterIDType;
    UInt32               vendorID;
    UInt32               deviceID;
    UInt32               subSysID;
    UInt32               revisionID;
    ExtraResolution      extraResolutions[MAX_NUM_OF_DX_EXTRA_RESOLUTIONS];
    DitheringEffect      ditheringEffect;
    Dithering            dithering;
    UInt32               ditherOrderedMatrixSizeScale;
    DepthBufferBitDepth  depthBuffersBitDepth;
    DefEnumResolutions   defaultEnumeratedResolutions;
    UInt32               enumeratedResolutionBitDepths;
    UInt32               maxVSConstRegisters;
    bool                 msD3DDeviceNames;
    bool                 rtTexturesForceScaleAndMSAA;
    bool                 smoothedDepthSampling;
    bool                 deferredScreenModeSwitch;
    bool                 primarySurfaceBatchedUpdate;

    ConfigDirectXExt () :
        adapterIDType                   (AIDT_Default),
        vendorID                        (0x0),
        deviceID                        (0x0),
        subSysID                        (0x0),
        revisionID                      (0x0),
        ditheringEffect                 (DE_Pure32Bit),
        dithering                       (DT_ForceAlways),
        ditherOrderedMatrixSizeScale    (0),
        depthBuffersBitDepth            (DBD_AppDriven),
        defaultEnumeratedResolutions    (DER_All),
        enumeratedResolutionBitDepths   (ERBD_All),
        maxVSConstRegisters             (256),
        msD3DDeviceNames                (false),
        rtTexturesForceScaleAndMSAA     (true),
        smoothedDepthSampling           (true),
        deferredScreenModeSwitch        (false),
        primarySurfaceBatchedUpdate     (false)
    {
        memset (extraResolutions, 0, sizeof (extraResolutions));
    }
};

Requirements

Header: dgVoodooConfig.hpp


ConfigGeneral structure

dgVoodoo API documentation
ConfigGeneral structure

ConfigGeneral

This structure contains general dgVoodoo options that are exposed through the Control Panel.

struct ConfigGeneral
{
    enum RendererAPI
    {
        API_BestAvailable               = 0,
        API_Direct3D11_FL10_0,
        API_Direct3D11_FL10_1,
        API_Direct3D11_MS_WARP_FL10_1,
        API_Direct3D11_FL11_0,
        API_Direct3D12_FL11_0,
        API_Direct3D12_FL12_0,

        NumOfAPITypes
    };

    enum Adapter
    {
        AdapterAll                      = 0
    };

    enum ScanlineOrder
    {
        SO_OutputDefault                = 0,
        SO_Progressive,
        SO_Undefined,

        NumOfScanlineOrders
    };

    enum ScalingMode
    {
        SM_Unspecified                  = 0,
        SM_Centered,
        SM_Stretched,
        SM_AspectRatio,
        SM_AspectRatio4_3,
        SM_AspectRatio4_3_CRTLike,
        SM_AspectRatio4_3_C64Like,
        SM_CenteredAspectRatio,

        NumOfScalingModes
    };

    enum Resolution
    {
        R_Unforced                      = 0,
        R_Max                           = 0xFFFFFFFF,   // It can have a parameter, the aspect ratio
        R_Max_ISF                       = 0xFFFFFFFE,
        R_MaxFHD                        = 0xFFFFFFFD,
        R_MaxFHD_ISF                    = 0xFFFFFFFC,
        R_MaxQHD                        = 0xFFFFFFFB,
        R_MaxQHD_ISF                    = 0xFFFFFFFA,
        R_IntegerScaled                 = 0xFFFFFFF9,   // It has the integer scale value as a parameter

        // Optional parameters for R_Max

        PR_Max_4_3                      = 0x100,
        PR_Max_16_9                     = 0x101
    };

    RendererAPI      rendererAPI;
    UInt32           rendererDevice;                    //  AdapterAll or adapter ordinal
    UInt32           renderingOutput;                   //  0 == default
    UInt32           brightnessScale;
    UInt32           colorScale;
    UInt32           contrastScale;
    ScanlineOrder    scanlineOrder;
    ScalingMode      scalingMode;
    bool             windowed;
    bool             keepApectRatio;
    bool             enumerateRefreshRates;
    bool             captureMouse;
    bool             centerAppWindow;
    bool             inheritColorProfile;

    ConfigGeneral ():
        rendererAPI             (API_BestAvailable),
        rendererDevice          (0),
        renderingOutput         (0),
        brightnessScale         (100),
        colorScale              (100),
        contrastScale           (100),
        scanlineOrder           (SO_OutputDefault),
        scalingMode             (SM_Unspecified),
        windowed                (false),
        keepApectRatio          (true),
        enumerateRefreshRates   (false),
        captureMouse            (true),
        centerAppWindow         (false),
        inheritColorProfile     (false)
    {
    }
};

Requirements

Header: dgVoodooConfig.hpp


ConfigGeneralExt

ConfigGeneralExt

This structure contains general dgVoodoo options that are not exposed through the Control Panel by default.

struct ConfigGeneralExt
{
    enum Environment
    {
        Env_Unspecified      = 0,
        Env_DosBox,
        Env_QEmu
    };

    enum WindowedAttributes
    {
        WA_DefaultAttributes = 0x0,

        WA_BorderlessFlag    = 0x1,
        WA_AlwaysOnTop       = 0x2,
        WA_FullscreenSize    = 0x4,

        WA_FlagsMask         = 0x7
    };

    enum DisplayROIPosition
    {
        DROI_Centered        = 0xFFFFFFFF
    };

    enum DisplayROISize
    {
        DROI_Rational        = 0xFFFFFFFF
    };

    enum Resampling
    {
        RS_PointSampled      = 0,
        RS_Bilinear,
        RS_Bicubic,
        RS_Lanczos_2,
        RS_Lanczos_3
    };

    UInt32       desktopResWidth;
    UInt32       desktopResHeight;
    UInt32       desktopRefRateNumerator;
    UInt32       desktopRefRateDenominator;
    UInt32       desktopBitDepth;
    UInt32       deframerSize;
    UInt32       imageXScaleFactor;
    UInt32       imageYScaleFactor;
    UInt32       displayROIPosX;
    UInt32       displayROIPosY;
    UInt32       displayROISizeX;
    UInt32       displayROISizeY;
    Environment  environment;
    UInt32       windowedAttributes;
    Resampling   resampling;
    bool         freeMouse;
    bool         enableGDIHooking;

    ConfigGeneralExt ():
        desktopResWidth             (0),
        desktopResHeight            (0),
        desktopRefRateNumerator     (0),
        desktopRefRateDenominator   (0),
        desktopBitDepth             (0),
        deframerSize                (1),
        imageXScaleFactor           (1),
        imageYScaleFactor           (1),
        displayROIPosX              (0),
        displayROIPosY              (0),
        displayROISizeX             (0),
        displayROISizeY             (0),
        environment                 (Env_Unspecified),
        windowedAttributes          (WA_DefaultAttributes),
        resampling                  (RS_Bilinear),
        freeMouse                   (false),
        enableGDIHooking            (false)
    {
    }
};

Requirements

Header: dgVoodooConfig.hpp


ConfigGlide

ConfigGlide

This structure contains Glide dgVoodoo options that are exposed through the Control Panel.

struct ConfigGlide
{
    enum CardType
    {
        VoodooGraphics      =   0,
        VoodooRush          =   1,
        Voodoo2             =   2,
        VoodooBanshee       =   3,
        Other               =   4,

        NumOfCardTypes
    };

    enum TexFilterType
    {
        TF_AppDriven        =   0,
        TF_ForcePoint       =   0x100,
        TF_ForceBilinear    =   0x200
    };

    CardType         cardType;
    UInt32           onBoardMemSize;
    UInt32           texMemSize;
    Int32            numOfTMUs;
    UInt32           resWidth;
    UInt32           resHeight;
    UInt32           msaaLevel;
    UInt32           refRateNumerator;
    UInt32           refRateDenominator;
    TexFilterType    texFilterType;
    bool             disableMipMapping;
    bool             enableGammaRamp;
    bool             pointCastPalette;
    bool             forceVSync;
    bool             forceEmulateLfbPCI;
    bool             use16BitDepthBuffer;
    bool             enable3DfxWaterMark;
    bool             enableSplashScreen;
    bool             enableInactiveAppState;

    ConfigGlide ():
        cardType                (Voodoo2),
        onBoardMemSize          (8*1024*1024),
        texMemSize              (4*1024*1024),
        numOfTMUs               (2),
        resWidth                (0),
        resHeight               (0),
        msaaLevel               (0),
        refRateNumerator        (0),
        refRateDenominator      (0),
        texFilterType           (TF_AppDriven),
        disableMipMapping       (false),
        enableGammaRamp         (true),
        pointCastPalette        (false),
        forceVSync              (true),
        forceEmulateLfbPCI      (false),
        use16BitDepthBuffer     (false),
        enable3DfxWaterMark     (true),
        enableSplashScreen      (false),
        enableInactiveAppState  (false)
    {
    }
};

Requirements

Header: dgVoodooConfig.hpp


ConfigGlideExt

ConfigGlideExt

This structure contains Glide dgVoodoo options that are not exposed through the Control Panel by default.

struct ConfigGlideExt
{
    enum DitheringEffect
    {
        DE_Pure32Bit    = 0,
        DE_Dither2x2,
        DE_Dither4x4,

        NumOfDitherinEffects,
    };

    enum Dithering
    {
        DT_Disabled     = 0,
        DT_AppDriven,
        DT_ForceAlways,

        NumOfDitheringBehaviors
    };

    DitheringEffect      ditheringEffect;
    Dithering            dithering;
    UInt32               ditherOrderedMatrixSizeScale;

    ConfigGlideExt ():
        ditheringEffect                 (DE_Pure32Bit),
        dithering                       (DT_ForceAlways),
        ditherOrderedMatrixSizeScale    (0)
    {
    }
};

Requirements

Header: dgVoodooConfig.hpp


ICPLDDI::OutputDesc

ICPLDDI::OutputDesc

This structure contains the description of a display output attached to an adapter.

struct OutputDesc
{
    WCHAR        name[32];
    WCHAR        desc[128];
    HMONITOR     hMonitor;
};

Requirements

Header: ICPLDDI.hpp


ICPLDDI::ModeDesc

ICPLDDI::ModeDesc

This structure contains the description of a display mode.

struct ModeDesc
{
    UInt32	xRes;
    UInt32	yRes;
    UInt32	refreshRateNumerator;
    UInt32	refreshRateDenominator;
    UInt32	refreshRateSimple;

    ModeDesc ():
        xRes                    (0),
        yRes                    (0),
        refreshRateNumerator    (0),
        refreshRateDenominator  (0),
        refreshRateSimple       (0)
    {
    }
};

Requirements

Header: ICPLDDI.hpp