Directx9 splitscreen view

Started by
12 comments, last by Victhor 9 years, 8 months ago

To definitively help you, we'd have to see some code as the pseudo-code you posted above doesn't really make sense. It's not clear where your beginscene, clear calls, endscene and presents occur with respect to each other.

EDIT: I made an error in the code I posted above with respect to setting the rectangles for the viewport and presentation. Don't know if that messed you up. Apologies.


lastly, the framework presents the image

It sounds like you're presenting the backbuffer just once. That's a bit more complicated than the simple sequence I posted above, which is intended to be straight forward.

Repeating what I posted above:

1. Set the viewport to one-half of the backbuffer.

2. Clear, BeginScene, draw, Endscene

3. Present one-half of the backbuffer to one-half of the client area of the window.

Repeat for the other half of the backbuffer and client area.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Advertisement

Thanks Buckeye! I think I'm gonna have to sit down and do some direct3D tutorials. I was hoping to avoid it to save time but now it seems like I've just wasted a bunch of time. To make sure I have you correctly though, each view port has to be presented while it is set and after it has done it's scene? So you're saying you cannot render both scenes for both viewports and then draw them in one call of present? Just to make sure I have that right. Also, any idea why fullscreen is only showing the results for one present call? This program is pretty big so it's easy for something to happen with out my knowing.

There are some semantics to straighten out. The viewport doesn't get presented or "do" a scene. The viewport determines what portion of the backbuffer gets cleared by Clear(), and drawn to. After the drawing is done, the Present call displays the results. Present takes several parameters (take a look at the docs). The first parameter is a pointer to a RECT that determines what portion of the backbuffer will be copied to the window client area. The second parameter is a pointer to a RECT that determines TO what portion of the client area the backbuffer will be copied.


So you're saying you cannot render both scenes for both viewports and then draw them in one call of present?

No, I didn't say that. It may be possible, though I didn't do it that way when I tried it out. It seems simpler (to me) to have a single drawing routine, set parameters in preparation for drawing, call the routine, set different parameters and call the routine a second time.

You certainly can't have 2 viewports active at one time. Further, Present doesn't do any drawing. Present copies all or a portion of the backbuffer to all or a portion of the window client area (as described above.)

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Hi, nice to see some development on a Winamp plugin, are you allowed to tell something else about the nature of this job? Is it official or 3rd party? Will it be used for AVS or another kind of thing? (I've read the thread but I still can't figure out that). Sorry for the non-directly related post, but this it's sort of a good news :D. Don't hesitate to jump by the official forum (forums.winamp.com) for extra help (there aren't too many plugin devs left but there is some activity, specially from the main dev!)

This topic is closed to new replies.

Advertisement