Jump to content

  • Log In with Google      Sign In   
  • Create Account


Problem drawing in directx


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 matipre96   Members   -  Reputation: 108

Like
0Likes
Like

Posted 14 November 2012 - 07:25 PM

Hello all! Posted Image
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! Posted Image

Sponsor:

#2 kubera   Members   -  Reputation: 852

Like
0Likes
Like

Posted 15 November 2012 - 01:31 AM

Maybe there is a difference between transformed/untransformed calculattions.

#3 SamiHuutoniemi   Members   -  Reputation: 259

Like
0Likes
Like

Posted 15 November 2012 - 09:05 AM

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

#4 Auskennfuchs   Members   -  Reputation: 512

Like
0Likes
Like

Posted 15 November 2012 - 12:33 PM

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, 15 November 2012 - 12:36 PM.


#5 matipre96   Members   -  Reputation: 108

Like
0Likes
Like

Posted 15 November 2012 - 01:48 PM

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

#6 matipre96   Members   -  Reputation: 108

Like
1Likes
Like

Posted 15 November 2012 - 01:59 PM

Sorry, i magicaly fixed changing this:
deviceParameters.BackBufferWidth = displaySettings.Width
to this:
deviceParameters.BackBufferWidth = 800

#7 Auskennfuchs   Members   -  Reputation: 512

Like
0Likes
Like

Posted 16 November 2012 - 06:48 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS