How does DirectX render his transformations?

I just made a matrix class that can translate, scale and rotate. Tested it and it works.

Don't mind how I use the methods. It's just a testing project.

Matrix matTranslate, matRotate, matScale, matWorld; matTranslate.SetAsTranslate(-0.7f, -0.4f); matRotate.SetAsRotate(80.0); matScale.SetAsScale(0.5,0.5); matWorld = matRotate * matScale * matTranslate; Matrix::SetAsWorld(hDC, matWorld); Rectangle(hDC, -1, -1, 1, 1);

This is what I use for my transformations:

Matrix::Matrix(): eM11(0.0f), eM12(0.0f), eM13(0.0f), eM21(0.0f), eM22(0.0f), eM23(0.0f), eM31(0.0f), eM32(0.0f), eM33(0.0f) { } void Matrix::SetAsTranslate(float x, float y) { eM11 = 1.0f; eM12 = 0.0f; eM13 = 0.0f; eM21 = 0.0f; eM22 = 1.0f; eM23 = 0.0f; eM31 = x; eM32 = y; eM33 = 1.0f; } void Matrix::SetAsRotate(float radians) { eM11 = (float)cos(radians); eM12 = (float)sin(radians); eM13 = 0.0f; eM21 = (float)-sin(radians); eM22 = (float)cos(radians); eM23 = 0.0f; eM31 = 0.0f; eM32 = 0.0f; eM33 = 1.0f; } void Matrix::SetAsRotate(double degrees) { float radians = (float)(degrees/180 * M_PI); eM11 = (float)cos(radians); eM12 = (float)sin(radians); eM13 = 0.0f; eM21 = (float)-sin(radians); eM22 = (float)cos(radians); eM23 = 0.0f; eM31 = 0.0f; eM32 = 0.0f; eM33 = 1.0f; } void Matrix::SetAsScale(float x, float y) { eM11 = x; eM12 = 0.0f; eM13 = 0.0f; eM21 = 0.0f; eM22 = y; eM23 = 0.0f; eM31 = 0.0f; eM32 = 0.0f; eM33 = 1.0f; } Matrix operator*(const Matrix& ref1, const Matrix& ref2) { Matrix mat; mat.eM11 = ref1.eM11 * ref2.eM11 + ref1.eM12 * ref2.eM21 + ref1.eM13 * ref2.eM31; mat.eM12 = ref1.eM11 * ref2.eM12 + ref1.eM12 * ref2.eM22 + ref1.eM13 * ref2.eM32; mat.eM13 = ref1.eM11 * ref2.eM13 + ref1.eM12 * ref2.eM23 + ref1.eM13 * ref2.eM33; mat.eM21 = ref1.eM21 * ref2.eM11 + ref1.eM22 * ref2.eM21 + ref1.eM23 * ref2.eM31; mat.eM22 = ref1.eM21 * ref2.eM12 + ref1.eM22 * ref2.eM22 + ref1.eM23 * ref2.eM32; mat.eM23 = ref1.eM21 * ref2.eM13 + ref1.eM22 * ref2.eM23 + ref1.eM23 * ref2.eM33; mat.eM31 = ref1.eM31 * ref2.eM11 + ref1.eM32 * ref2.eM21 + ref1.eM33 * ref2.eM31; mat.eM32 = ref1.eM31 * ref2.eM12 + ref1.eM32 * ref2.eM22 + ref1.eM33 * ref2.eM32; mat.eM33 = ref1.eM31 * ref2.eM13 + ref1.eM32 * ref2.eM23 + ref1.eM33 * ref2.eM33; return mat; } void Matrix::SetAsWorld(HDC hDC, const Matrix& mat) { XFORM form; form.eM11 = mat.eM11; form.eM12 = mat.eM12; form.eM21 = mat.eM21; form.eM22 = mat.eM22; form.eDx = mat.eM31; form.eDy = mat.eM32; SetWorldTransform(hDC, &form); }

The calculations I've written on paper first with help from a book. So I didn't copied anything from the internet. I'm getting the hang of matrices very fast with this book, next chapter is linear transformations!

But indeed, I'm using GDI and it's getting pretty classic. But I really don't want to use a single external library. Because it's too "easy" then.. I'm not trying to be stubborn. Any suggestions how I avoid the classic functions? DirectX also must use a classic way or are they working very low level and code all their rendering themselves?