What does β€œ1” mean in β€œD2D1”?

D2D1 is the namespace for Direct2D technology in Win32. However, I do not understand the etymology of this name. D2D part most likely refers to D directly in 2D , however the last 1 puzzle is me ...

There are also many classes with a β€œ1” as a suffix: IDWriteFactory1 , IDWriteFont1 , IDWriteTextLayout1 , etc. - What is their purpose and difference from similar objects without a suffix?

+4
source share
1 answer

COM interfaces are usually called with increasing numbers, which allows version control. When a COM interface is published publicly, COM rules dictate that the interface can no longer be changed, or compatibility with existing code gaps. If you need to add new functionality, you must open a new interface. Take, for example, IDWriteFactory1 . Today is the first release interface. In the future, perhaps, IDWriteFactory2 will be added, which extends IDWriteFactory1 with new methods. Existing code is saved because they do not know anything about IDWriteFactory2 , but the new code can create an IDWriteFactory1 object and query it to see if it IDWriteFactory2 , and if so, use newer methods if necessary.

The naming of the D2D1 namespace is most likely similar. It is probably used for version control purposes (Direct2D v1?). Perhaps in the future, the D2D2 (Direct2D v2) namespace will be added for things that do not fit into the existing Direct2D architecture. Who knows for sure.

+5
source

All Articles