valinet / D2DAnalogClockC

Example of an analog clock drawn using Direct2D based on the sample code but drawn using ID2D1DeviceContext and written in pure C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

D2DAnalogClockC

Example of an analog clock drawn using Direct2D based on the sample code but drawn using ID2D1DeviceContext and written in pure C.

Based on example from Get Started with Win32 and C++, and enhanced for Direct2D 1.1. You need to place the files "d2d1.h" and "d2d1_1.h" from Windows 10 SDK 10586 or earlier to the project folder, as Microsoft removed the C-style definitions for Direct2D from the latest SDK. Also, note that even some of the definitions in those headers are bugged, as explained here, namely some functions have their prototypes changed, one such example being ID2D1DeviceContext_GetSize.

I structured the code so that it is hopefully easy to read, understand and extend, implemented in a COM/OOP-like pattern in order better understand how things work in the backend of C++, for example.

About

Example of an analog clock drawn using Direct2D based on the sample code but drawn using ID2D1DeviceContext and written in pure C.

License:GNU General Public License v2.0


Languages

Language:C 100.0%