🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #258602

--

#258602
From: Jeff-Relf.Me
Date: Tue, 04 Nov 2014 09:33
29 lines
2160 bytes
<PRE><big><big> 
<<A hRef="http://Jeff-Relf.Me/DirectX.CPP"
 target=_blank>DirectX.CPP, Visual C++ 2013, x64</A>> is a small (one-file)
example of how to:
-- Make all Fonts/Glyphs the same width (double·width is allowed).
-- Use DirectX 11.1, Direct2D 1.1, DirectWrite, and Direct3D.
-- Replace DirectDraw/GDI+, etc.
-- Draw to a back buffer at a high fps (frames per second).
-- Draw properly scaled/smoothed .JPG files, hardware accelerated.
-- Draw to/from/within bitmaps.
-- Discover if a font exists or not ("FindFamilyName()").
-- Discover if a glyph exists in a font ("HasCharacter()").
-- Discover the width/height of a glyph ("GlyphWH()").

Your startup folder should have, e.g., "Pics/LowRes.JPG" ( 100px wide/tall ) 
and "Pics/Chess.JPG" ( a 2160 x 3840 screenshot ).
All coordinates are in hard⋅pixels (D2D1_UNIT_MODE_PIXELS).

Note: This code needs Windows 8 or later.
Also, it needs the "MS Mincho", "Consolas", "DejaVu LGC Sans Mono", 
"Lucida Console" and "Arial Unicode MS" fonts.

3840 x 2160 ScreenShot: http://Jeff-Relf.Me/Glyph.JPG

To record "debug/WM_*" messages, use "Jeff-Relf.Me/Debug.CPP"

Here's a more complex, yet still simple, example:
  http://Jeff-Relf.Me/X.CPP
  http://Jeff-Relf.Me/X.PNG
Technical Details
Message-ID: <Jeff-Relf.Me@Nov.4{1.33A.Seattle.2014}>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20141227.mbox.gz!border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!nntpswitch.blueworldhosting.com!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <Jeff-Relf.Me@Nov.4{1.33A.Seattle.2014}>
Subject: --
Date: Tue, 04 Nov 2014 09:33:58 +0000
From: Jeff-Relf.Me <@.>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20141227.mbox.gz!border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!nntpswitch.blueworldhosting.com!not-for-mail
Content-Type: Text/HTML; charset=UTF-8
Content-Transfer-Encoding: 8bit
Newsgroups: comp.os.linux.advocacy,news.software.readers
User-Agent: Jeff-Relf.Me/X.HTM
X-Complaints-To: abuse@blueworldhosting.com
Organization: BWH Usenet NNTPSwitch-Cluster
Lines: 29
NNTP-Posting-Date: Tue, 04 Nov 2014 03:33:58 -0600
X-Trace: ccd2e54589d86ec90b8a616896