Re: How to Imlement DeviceReset (Light is Lost on Window Resize)




"bazad" <no reply> wrote in message news:0DDA88D5-5BD6-47BA-B030-9962BC20250E@xxxxxxxxxxxxxxxx
"ZMan" <zman@xxxxxxxxxxxxxx> wrote in message news:ugYAyy%23aHHA.3272@xxxxxxxxxxxxxxxxxxxxxxx
If you take a look at code attached you would see that graphics initialization is very simple. All other resources are created inside paint method and thus are recreated every time. Here is all I do to initialize graphics:

In general people do not have time to open up projects and debug them for people. Running random code on our machines is a potential nightmare.

Take a look at the tutorials 1-5 in the SDK. They draw simple triangles and shapes and handle Device Reset properly. What do they do differently.

I already did.

Tutorial 1 - no reset at all
Tutorial 2 - no reset at all

Tutorial 3 - there is reset
Device dev = (Device)sender;
// Turn off culling, so we see the front and back of the triangle
dev.RenderState.CullMode = Cull.None;
// Turn off D3D lighting, since we are providing our own vertex colors
dev.RenderState.Lighting = false;
If I try this on my code it does not work, but it works in their sample. I guess I will try to see what's the difference is.

Uh, so much to learn from a book by Bob Gaines "Managed DirectX 9 Graphics and Game Programming".

well, I replied too soon. Tutorial 3 uses no lights that's why the code works (no black triangle issue like I have).

Wait a minute. Tutorial 4 uses lights and it demonstrates the issue I am complaining about! Here we go back to my problem.

Tutorial 5 uses lights and has no problem, but they use Texture if there is any difference here.
--

So, how would one fix Tutorial 4 to work correctly on resize?



.



Relevant Pages

  • Re: How to Imlement DeviceReset (Light is Lost on Window Resize)
    ... initialization is very simple. ... Take a look at the tutorials 1-5 in the SDK. ... They draw simple triangles and shapes and handle Device Reset properly. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Reset all form fields in code behind
    ... I have a form that is used to add records and edit current ones. ... reset the form when I am adding a new record. ... > MY ASP.Net tutorials ... Prev by Date: ...
    (microsoft.public.dotnet.framework.aspnet)
  • your light set up for head shots
    ... ive read alot of tutorials and been trying to learn the best i can ... about how to best position your lights /reflectors etc. ... class reunions large groups indoors ill use the bees. ... stool, posing table, maybe a grid and maybe another light for the grid ...
    (rec.photo.digital)