Is it a bug or misunderstanding?

Started by
28 comments, last by GameDev.net 18 years, 3 months ago
Hello, I'm trying to reset the viewport when the window is resized. however it does not seem working as expected as it does using OpenGL. When not resetting it manually using the SetViewport function the D3D resets it automatically but by scaling the rendered image from the original viewport (eindow size at start-up). Could this be a bug inthe DirectX 9c SDK? Or there's some trick around I missed. Thanks.
Advertisement
When you resize the window the backbuffer is still the same size and the viewport is used to render to the backbuffer. If the front buffer is a different size than the back buffer (such as when you resize the window) it's blit-scaled to the front buffer.

I think what you want to do is reset the device to change the backbuffer size when the window resizes.
Stay Casual,KenDrunken Hyena
Then it will be more expensive doing it the right way than using OpenGL. What's exactly the functionality of SetViewport then? If I need to change buffer sizes each time the window resized?????????????
Then Direct3D is either buggy and 50% of its functionality is not working properly, or the design is crappy.
Quote:Original post by quaker
Then it will be more expensive doing it the right way than using OpenGL.

OpenGL and Direct3D do similar things, but they are different API's. It's difficult (if a little pointless) to come up with an architectural comparison.

Quote:Original post by quaker
What's exactly the functionality of SetViewport then? If I need to change buffer sizes each time the window resized?????????????

the Viewport is defined within your render target. I've used it a number of times to "clip" 3D rendering to a specific portion of the GUI. For example, having a 3D rendered image surrounded by a number of controls/displays etc..

Window resizing should be a fairly rare occurence - why are you so worried about it?

Quote:Then Direct3D is either buggy and 50% of its functionality is not working properly, or the design is crappy.

[rolleyes] If you want to troll, then please take it somewhere else.

On the other hand, if you wish to partake in a constructive and intelligent debate on such things feel free to hang around [smile]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

First I'm asking a highky technical question. And it really matter to my appliaction if the window is resized. If Direct3D can do it simply say tell the answer otherwise keep ur comments for u.
Your question was already answered. When the window is resized, Reset the device. You use the Reset method on the device giving it a Present Parameters matching your new requirements.

The Forum FAQ has a number of good resources and tutorials if you need more information.
Stay Casual,KenDrunken Hyena
Ok but why is it different tha OpenGL inner working? Why is it necessary to reset the device with new parameters just to refelect the new viewport? I think the SDK is not well documented to cover all trickies.
Then it's more expensive to use the Direct3D than OpenGL, it's not a flame though. I want to say if Dirct3D complicates things and "invent" it's own hiddne pipe-line which has no origin in the HW then it's pointless to use it unless we want the sioftware to be exclusively Windows XP or Vista.
I think you'll find the difference between them is not that you have to do some expensive reset operation for d3d and not for opengl, the difference is simply that, by default, d3d stretches it. So you have to tell it to resize the buffer, which opengl always does. Not that I know much about directx, I use opengl myself.

And a word of advice: Be nice to people who are helping you. Some very knowledgable people have been quite tolerant, and once you piss them off you only get posters like me (if your lucky).

EDIT: Thought better of the joke
___________________________________________________David OlsenIf I've helped you, please vote for PigeonGrape!
Quote:Original post by Anonymous Poster
Then Direct3D is either buggy and 50% of its functionality is not working properly, or the design is crappy.

For the record: the anonymous wimp who posted this flame is quaker, the original poster.

This topic is closed to new replies.

Advertisement