In the D3DCompiler library there's these flags called "D3DCompile Constants", but the description that Microsoft give us about them is very brief and difficult to have proper understanding of what they do. I wish someone could be able to explain at least what those three mean:
D3DCOMPILE_PARTIAL_PRECISION, D3DCOMPILE_NO_PRESHADER, D3DCOMPILE_ALL_RESOURCES_BOUND
That doc page is pretty poor. It's just the content of D3DCompiler.h comments put into a Markdown page. I'll see about submitting some edits to help it at least a little. Most of these flags are aliases for older D3DX constants as listed on Microsoft Docs where they are better documented at the moment.
UPDATE: The Microsoft Docs page has been updated.
The D3DCOMPILE_PARTIAL_PRECISION flag is equivalent to FXC's /Gpp switch and is an alias for D3DXSHADER_PARTIALPRECISION. It basically treats float32 values as float16 in some cases and enable use of some approximation functions.
The D3DCOMPILE_NO_PRESHADER flag is equivalent to FXC's /Op switch and is an alias for D3DXSHADER_PARTIALPRECISION. This feature is deprecated and only applies to legacy Direct3D 9 era "Effects" (FX). See this Microsoft Docs page for what this was about.
D3DCOMPILE_RESOURCES_MAY_ALIAS, D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES, and D3DCOMPILE_ALL_RESOURCES_BOUND flags are HLSL options for informing the HLSL compiler some assumptions when performing optimizations for DirectX 12 Shader Model 5.1.
Note for DirectX 12, D3DCompile and FXC.EXE are legacy and only support Shader Model 5.1. For DirectX12, you should use Shader Model 6 via the DXIL compiler and DXC.EXE command-line tool. See GitHub.
I am using the annotation feature of the Visual Studio 2017 plug in. The colour scheme seems to be based on the age of the change in a gradient type of style. Is there way to assign a colour to a certain change set? If a number of changes have been made fairly close together, it makes it hard to see which lines belong to which changeset.
I'm afraid the color can only be changed based on the author or date. Please check attached screenshot.
I have searched on the Internet how to do this, but I can't find how.
I need to colour specific words in RichEdit, such as the words false and true.
TRichEdit is not well-suited for syntax highlighting (use something more like SynEdit instead), but it can be done. Basically, you need to highlight the desired text, and then set the selected text's attributes, like color and formatting. You can do that with the TRichEdit::SelStart, TRichEdit::SelLength, and TRichEdit::SelAttributes properties. Or you can use the corresponding Win32 API EM_EXSETSEL and EM_SETCHARFORMAT messages directly.
See Robert Dunn's excellent article on this very topic: "Faster Rich Edit Syntax Highlighting". The Original article first appeared in the C++Builder Journal in October 1999, and is also available for download on Robert's "Yet Another Code Site" website (which is archived on my website).
I am writing a webserver in C++. I am looking at the POST documentation on w3:
http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4
I see that a POST is supposed to support the full multi-parts scheme: parts and sub-parts (and obviously, sub-sub-parts...) just like for email attachments.
Is there any browser and/or tool that do that on a normal basis? In other words, is it really important for a server to support parts and sub-parts?
The obvious problem with that is the fact that it could mean that two files are uploaded under the same name. That's quite a problem if you ask me. Also, from what I can see in PHP it is not supported at all in that realm. Am I correct?
Ah! I guess I should have searched a little more and to tell you the truth I had not thought of looking at HTML5 for the answer.
The following paragraph actually includes the answer:
http://www.w3.org/html/wg/drafts/html/master/forms.html#multipart-form-data
Note: In particular, this means that multiple files submitted as
part of a single element will
result in each file having its own field; the "sets of
files" feature ("multipart/mixed") of RFC 2388 is not used.
So it is clear that sub-parts (multipart/mixed) are not to be supported.
I'm rendering text in Direct2D/DirectWrite, but calling SetLineSpacing() on either TextFormat or TextLayout seems to have no effect. Does anyone know why?
I'm 99% sure that this is a bug. I have done a little playing around with Direct2D lately and also had a problem with SetLineSpacing() on TextLayout, think it is the same as what you are describing, in that case I can confirm that it's not just you. Reopen your bug report on MS Connect, it has been closed.
I even have the same problem as Dmitri Nesteruk said.
However, I find out that if you set the lineSpacing "after
CreateTextLayout", SetLineSpacing cannot work.
Otherwise, if you set LineSpacing before CreateTextLayout,
it can work now.
Maybe you can try this soluton.
PS: My env. is in Window Vista SP2.
Many thanks.
Unfortunately you don't provide code showing what you're trying to do. I'm assuming that you're trying to set the line spacing like this:
pTextLayout->SetLineSpacing(DWRITE_LINE_SPACING_METHOD_DEFAULT, lineSpacing, baseline);
The documentation on MSDN is not terribly clear about the different line spacing methods. The default method causes the spacing for each line to be derived from the used font and inline objects, if any, so each line is the height that it needs to be according to its content. In this case, the two parameters, lineSpacing and baseline, are ignored.
If you have a text format that uses a single font (and font size) and no inline objects (or inline objects that are no higher than the text), you can specify uniform line spacing. This is what the DWRITE_LINE_SPACING_METHOD_UNIFORM is for. I've just tried it and calling SetLineSpacing() with this method results in uniform line spacing according to the passed arguments.
Starting with Windows 10, there is a third line spacing method, DWRITE_LINE_SPACING_METHOD_PROPORTIONAL, that can be used to achieve line spacing that is relative to what the font sizes and inline objects specify. However, this is only supported on Windows 10.
The most misleading part, in my experience, is that calling SetLineSpacing(DWRITE_LINE_SPACING_METHOD_DEFAULT, x, y) succeeds without an error, and retrieving the line spacing parameters afterwards, using the GetLineSpacing() method, returns the values that were provided (while they still don't achieve anything). The API is internally consistent in this regard, not discarding the specified values even though they don't achieve anything useful. Also, when you call GetLineSpacing() on a newly-created IDWriteTextFormat or IDWriteTextLayout instance, the values are returned as zero (which is correct because the line spacing method is DWRITE_LINE_SPACING_METHOD_DEFAULT). In order to be able to do anything useful, you have to determine the default line spacing for the font you're using. You can achieve this by calling IDWriteFont::GetMetrics() on the font you're using. The default line spacing is the sum of the ascent, descent and lineGap values.
Charles Petzold wrote about this in an article about Pagination With DirectWrite.
Am i missing something?
Neither IDWriteTextFormat nor IDWriteTextLayout has a SetLineHeight function ...
Have you checked the HRESULT error code returned by SetLineSpacing()?
Hint: If you're using Visual Studio just type eax,hr in one of the debug Watch windows to see any possible error code right after the call.
Source
minimum supported client: Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista.
Do you run any of the above stated versions of windows?
I believe the reason why you aren't seeing any changes is because any version below the ones states above doesn't support the SetLineSpacing() in DirectWrite.