Problem drawing in directx

Started by
5 comments, last by Auskennfuchs 11 years, 5 months ago
Hello all! biggrin.png
I have a problem drawing in DirectX. When i draw, the size is always smaller, i mean, the width is 800, but i draw 16 figures of 50 width (16 * 50 = 800) and it don't fits in my screen.
Pic: http://vvcap.net/db/..._ykfchCQTZN.htp
Any idea?

(Sorry my bad english, i'm Argentinean )
Trank you! smile.png
Advertisement
Maybe there is a difference between transformed/untransformed calculattions.
What version of DirectX? Is it an ortographic projection? Some code? =)
Looks like your created orthogonal matrix doesn't match the size of your drawing area/rendertarget. Also your screenshot is only 795x614(with some advertisment at end)px. So your drawing area is less then 800x600, if the screenshot is not scaled. To solve it, resize the window so the clientarea matches 800x600 or use the current clientsize of the window and create rendertarget and projectionmatrix with these values. Last solution is more flexible also when you will resize your window or switch to fullscreen.
Looks like your created orthogonal matrix doesn't match the size of your drawing area/rendertarget. Also your screenshot is only 795x614(with some advertisment at end)px. So your drawing area is less then 800x600, if the screenshot is not scaled. To solve it, resize the window so the clientarea matches 800x600 or use the current clientsize of the window and create rendertarget and projectionmatrix with these values. Last solution is more flexible also when you will resize your window or switch to fullscreen.

The size is set to 800x600 (http://vvcap.net/db/pAb3b82qwCsulVJ53-Ca.htp)

What version of DirectX? Is it an ortographic projection? Some code? =)

I never defined a DirectX version :S
Sorry, i magicaly fixed changing this:
deviceParameters.BackBufferWidth = displaySettings.Width
to this:
deviceParameters.BackBufferWidth = 800
So then you changed the size of your rendertarget (backbuffer), but it doesn't match the size of the area in your window. You only draw into the clientarea of the window. So when your screenshot is 800x600 the clientarea is something about 790x560px, because border and windowtitlebar also consuming space. Your now correctly rendered backbuffer is scaled into the clientarea. Normally you can see the artifacts. Same happens, when you resize the window.

This topic is closed to new replies.

Advertisement