Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

3DXD

Disappearing Textured Quads in Full Screen Mode...Odd

This topic is 5098 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ugh I know sorry :-( its me again. I have some simple textured quads(not using transformed verts) that have a ugly texture of a monster on it. I also have some that have a picture of a ladder on it representing the next and previous levels When I am in windowed mode my monsters and my ladders show up(they are all seperate objects) When I am in full screen mode my ladders show up, but my monsters do not. I was really baffled, and since I can turn off/on my walls etc I turned everything off but the monsters and get nothing, I can turn everything else on while rendering and it all looks fine. Not only that but the "rendering" code doesn''t throw any errors etc, just the opposite the draw primitive works just fine The texture is a jpg(and is the same as the ladders in dimensions and file type 128x128) I''ve stepped through, tried release/debug, checked orientation etc, but for some weird reason it just "poofs" I have culling turned off, zbuffers on. It shares the same states as the "walls" and again is visible in windowed in the exact spot that it should be. weird...

Share this post


Link to post
Share on other sites
Advertisement
Hmmm.. odd thing is if I use the reference device then my quads are back, but a hardware one and they are not.

Ok thats gonna drive me crazy.

Any one see this before?

Share this post


Link to post
Share on other sites
Well I now know "why" this problem was happening, but I still don''t quite understand it.

It must have something to do with the device (state)

After creating a test instance of the objects that weren''t working and them working, I then realized I had an idea.

My other walls/etc, including my new test instances worked because I had "created" them after the Window(in full screen) had been shown.

However, the ones that were NOT showing had been created before the issue to the form.show command.

So it was like this

1. I created an instance of the class(form)
2. I initialized my data(loaded textures etc)
3. Created my static objects(monsters, etc)
4. Then called form.Show
5. Then created the walls, ceiling, floor for the dungeon level.
6. Then entered into my render loop
7. attempted to render my walls, monsters, ladders
8. Ladders/Monsters failed to show up in full screen mode.
In windowed it worked fine

So I then decided to load my data and create my static objects AFTER my call to formclass.show

And my problem went away.

However, one thing to note, I had already initialized the device before the call to formclass.show, but I take it, when its in full screen mode this isn''t good enough until I call .show

Maybe this will help someone else.

Share this post


Link to post
Share on other sites
Depending on the memory pool that objects are in, switching mode can result in lost vertex buffers etc. These need to be restored after a mode switch. I think if they are in the D3DPOOL_MANAGED, they survive screen mode changes / window focus changes etc. If they are in other pools, they can be lost when this happens. It looks like this is what is happening here. Try putting them in the D3DPOOL_MANAGED memory area, or seperating the creation of D3DPOOL_DEFAULT objects into a RestoreDeviceObjects function which you call on screen mode / window changes. The D3D SDK sample framework shows how this is done, and gives good explanations of where initialisation should go.

---------------------------------------

Let''s struggle for our dream of Game!

http://andrewporritt.4t.com

Share this post


Link to post
Share on other sites
Yes, but in my case I never switched screen modes.
The device was either create in full screen or windowed, not switched between.

This specifically had to do with when an object was created using a texture/info that required the device as a parameter.

Once the formclass.show is called the problem disappears.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!