Re: Windows Direct2D 1.1

Neil Hodgson <[email protected]> Tue, 11 Feb 2025 20:06:54 -0800 (PST)
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
   Scintilla on Win32 has been updated to use Direct2D and DirectWrite 1.1. 
This may help with compatibility and performance on newer systems.

   Windows Vista does not support Direct2D 1.1 so Scintilla will not 
support DirectWrite on Vista, falling back to the older GDI drawing API. 
While it would be possible to support both Direct2D 1.0 and 1.1 APIs from a 
single code base it would add significant code duplication plus I don't 
have a Vista system.

   A new technology mode SC_TECHNOLOGY_DIRECT_WRITE_1 (value 4) was added 
that uses the lower-level approach that Microsoft recommends for Direct2D 
that involves interacting with Direct3D and DXGI then constructing and 
using an explicit swap chain. This may provide the basis for further modes 
that tweak more details. Just appending a 1 to the symbol isn't great but 
it matches Microsoft's API changes.

   Resizing the window in the original SC_TECHNOLOGY_DIRECTWRITE mode was 
made more efficient by resizing the render target instead of recreating it.

   While I am hopeful these changes will work well in most cases, there may 
be some problems on particular systems, depending on hardware, drivers, and 
Windows version. It's also a large change so there may be mistakes.

   The implementation changes were informed by these articles:
https://katyscode.wordpress.com/2013/01/23/migrating-existing-direct2d-applications-to-use-direct2d-1-1-functionality-in-windows-7/
https://learn.microsoft.com/en-us/archive/msdn-magazine/2013/may/windows-with-c-introducing-direct2d-1-1
   For the Kenny Kerr article, there are also related articles in previous 
and later editions of MSDN magazine.

   The committed changes can be examined either in the repository
hg clone http://hg.code.sf.net/p/scintilla/code scintilla
   or from
https://www.scintilla.org/scite.zip Source
https://www.scintilla.org/wscite.zip Windows executable (64-bit)

   Neil

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/ee2517e4-510d-4402-851f-e1a8e08a321bn%40googlegroups.com.