Sign in to follow this  
Mati Preisz

Problem drawing in directx

Recommended Posts

Mati Preisz    108
Hello all! [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
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: [url="http://vvcap.net/db/ZogmWZOZl_ykfchCQTZN.htp"]http://vvcap.net/db/..._ykfchCQTZN.htp[/url]
Any idea?

(Sorry my bad english, i'm Argentinean )
Trank you! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Share this post


Link to post
Share on other sites
Auskennfuchs    1032
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. Edited by Auskennfuchs

Share this post


Link to post
Share on other sites
Mati Preisz    108
[quote name='Auskennfuchs' timestamp='1353004399' post='5001302'] 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. [/quote]
The size is set to 800x600 ([url="http://vvcap.net/db/pAb3b82qwCsulVJ53-Ca.htp"]http://vvcap.net/db/pAb3b82qwCsulVJ53-Ca.htp[/url])
[quote name='SamiHuutoniemi' timestamp='1352991932' post='5001233']
What version of DirectX? Is it an ortographic projection? Some code? =)
[/quote]
I never defined a DirectX version :S

Share this post


Link to post
Share on other sites
Auskennfuchs    1032
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this