directdraw


How do you draw text in DirectX 12?


This is a follow-up question of How do you draw text in DirectX 11?
In Direct3D-12, things got much more complex and since it's new I couldn't find any suitable libraries online.
I'm building a basic Direct3D12 FPS Test application, and I like to display the FPS data on screen with my rendered image.
The general answer to questions like this is "if you have to ask, then you probably should be using DirectX 11." DirectX 12 is a graphics expert API that provide immense control, and is not particularly concerned with ease-of-use for novices. See this thread for more thoughts in this vein.
With that out of the way, one option is to use device interop and Direct2D/DirectWrite. See Working with Direct3D 11, Direct3D 10 and Direct2D.
UPDATE: DirectX Tool Kit for DirectX 12 is now available. It includes a SpriteFont / SpriteBatch implementation that will draw text on Direct3D 12 render targets. See this tutorial.
Pure DirectX 12, then you need to load the font glyph data into a vertex buffer and render with a vertex shader and pixel shader. You mentioned libraries online, will this is expert stuff and fortunately James Stanard at Microsoft release a how to with their open source MiniEngine project. He handles multiple fonts, antialiasing, and drop shadows in DirectX 12.
Find the project files at GitHub https://github.com/Microsoft/DirectX-Graphics-Samples/tree/master/MiniEngine and check out Textrender.h and Textrender.cpp
If you want maximum feature set with minimum work you probably should go with DirectWrite on top of a D3D11 interop device, like Chuck said in his answer.
If you want to roll your own high performance text rendering you may want to take a look at the text renderer in the miniengine example repository on github, it has some interesting ideas.

Related Links

How do you draw text in DirectX 12?
how can I detect the maximum size of overlay hardware via Direct Draw library?
Getting programmicaly Device Caps for DirectX 6.1 (DDraw4)

Categories

HOME
android
service-worker
scikit-learn
apache-flink
webdriver
android-studio-2.2
jax-rs
object
datastore
mjml
yahoo-finance
alarm
tivoli
vxml
webix
pkcs#11
character
rcloud
drop-down-menu
android-securityexception
redis-sentinel
qsqlquery
modbus-tcp
sse
nim
squashfs
backpack-for-laravel
angular-routing
comparator
mat
bringtofront
quantlib
bioinformatics
browser-sync
gp
winpe
alm
jmockit
papaparse
arduino-ide
latitude-longitude
wurfl
imagenet
graphhopper
loading
diacritics
trigonometry
datacachefactory
linqpad
avcapturedevice
mesosphere
magento-2.0.7
zenhub
type-theory
javafx-css
sandcastle
cronexpression
cudd
grails-plugin
centrifuge
jboss-tools
installshield-2010
cifilter
android-dateutils
boost-serialization
exim4
maybe
file-move
visual-sourcesafe-2005
rpart
amiga
rdflib
alloy-ui
zxspectrum
code-documentation
qtwebengine
grouping-sets
cosine-similarity
viewer
pseudo-class
linkedin-jsapi
ss7
wxformbuilder
dot42
koala
rfc5322
ora-06550
scriptaculous
embedded-fonts
intersect
adobe-media-server
correlated-subquery
fusefabric
window-decoration
stress
box2d-iphone
strsep
diagrams
metaweblog
visualj#
online-storage

Resources

Encrypt Message