Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Strange Problems in DX8
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Iodiplin
Knave

USA
67 Posts

Posted - Oct 25 2004 :  4:49:53 PM  Show Profile  Reply with Quote
I've got two problems here (seems I've had lots of those recently) both with DX8.

The first is a little more straight forward than the other, so I'll give that one first.

When I go from windowed mode to full-screen mode (by changing the presentation parameters and resetting) it works just fine. When I switch between full-screen mode to windowed mode it also works fine...almost. In the latter case, the windowed form becomes COMPLETELY enveloped by the rendering, therefore the title bar and its contents are not visible, they're being drawn on. The only way I can seem to fix it is by minimizing the window (only accessable by the task bar button) and then restoring it again. Even by doing this, somehow the size of the render target gets smaller so things are being chopped off at the bottom and right edges (like the FPS counter text, at first I thought it was saying I had an FPS of 9, but it was because the 2 was cut off, so it was actually 92).

Screenie after going back to windowed mode:


I can't understand why this is happening, because it looks fine when I initialize right into windowed mode.

Hopefully someone will have experience here to point me in the right direction. (I've tried everything )



This second problem is recent, and it's VERY weird. Ok, I was testing my ability to make a nice interpolated sun-set sky in the background, so I stretch a 1x1 white pixel on the screen and color blend the sides to get my sky. It looks quite nice actually. However, it get's very messed up during a very specific circumstance in my game (which is a 2D side scroller). When I'm moving my little guy around on the floors (currently all one texture, I'm not done with the graphics) the sky simply sits in the background unintrusively. But, when I let my guy fall in a part of the map in which NO tiles are being drawn (just the background and him) the background suddenly becomes a large colorized, stretched floor texture and my guy disappears!

Screenies:

Regular (notice the background gradient):


Messed Up (notice the same background gradient, applied to the wrong texture):

I've tried setting the rendering texture to nothing and setting it back again; doesn't work. I can't think what could be going wrong, cuz' when I go back to an area with tiles again, it works fine, so it's not like it's loosing any data!

Thanks in advance.

Environment Makes All the Difference.

VBBR
Moderator

Brazil
617 Posts

Posted - Oct 25 2004 :  6:36:30 PM  Show Profile  Reply with Quote
Have you tried putting a DoEvents before the Reset call?


Whatever. Who knows...
Go to Top of Page

Iodiplin
Knave

USA
67 Posts

Posted - Oct 25 2004 :  8:58:26 PM  Show Profile  Reply with Quote
Yes...it didn't work.

Environment Makes All the Difference.
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - Oct 26 2004 :  09:28:40 AM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
The first problem is obvious, but a fix for it is't. What's happening is that you're intializing directx to use the form's drawable area before the operating system gets a chance to define the masked areas where the title bar and windows border should be.

It may not work but its something to try, use a picturebox for rendering when in windowed mode. Also, what event are you using to call the re-intializing code for directx? DoEvents is probably not working for you because your event isn't finished, so other events may not execute because they need the uncompleted event to finish first.

For the second error, I'm not sure. It's possible that you're calling a render function with no vertices, and I think that behavior is undefined. Since there are no tiles on the screen, your tile data should be empty right? If that's the case, then you shouldn't even call the render function. Directx might be getting bogus data from memory and rendering leftover information.
Go to Top of Page

Iodiplin
Knave

USA
67 Posts

Posted - Oct 26 2004 :  5:46:15 PM  Show Profile  Reply with Quote
Thanks. I'll see if I can't put the DoEvents somewhere else and ensure the OS finishes chaning the screen resolution before reassigning the render target.

As for the second, I think you may be right. I'll have to experiment more with it. Perhaps it actually isn't setting up the verts correctly for the sky but it doesn't cause a problem when other things are being renderered. ??? Notice that the messed up background is using the wrong texture, but it appears the texture (floor texture) isn't actually being drawn correctly (as if I wanted it drawn). It 's a bit too beig for the scren. Of course, with a mere gradient, you wouldn't notice that, but with the texture, it's more apparent. Dunno. I'll post my results.

Thanks again!

Environment Makes All the Difference.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.17 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.