Jump to content
  • Advertisement
Sign in to follow this  
devronious

Texture losing colors...

This topic is 4257 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

My textures lose their proper coloring when I resize the device. This is MDX so the resources are managed. I assume that the reason is because I'm using texture loader wrong or something when creating the managed textures. here's my code:
[source lang=c#]
            FileStream fs = file.OpenRead();
            int b;
            int w = 0;
            int h = 0;
            int bpp = 0;
            for (int i = 0; i < 17; i++)
            {
                b = fs.ReadByte();
                switch (i)
                {
                    case 3:
                        bpp = b;
                        break;
                    case 12:
                        h = b;
                        break;
                    case 16:
                        w = b;
                        break;
                }
            }
            fs.Seek(0, 0);
            this.texture = TextureLoader.FromStream(device, fs, w, h, 0, Usage.None, Format.A8R8G8B8, Pool.Managed, Filter.None, Filter.None, 0);

Share this post


Link to post
Share on other sites
Advertisement
What do you mean by losing colours? I had a problem a while ago where resizing the window would reset the device. Your textures are still there, but this causes the render states to be reset to their default(in my case it would enable lighting). You might to check for this.

Share this post


Link to post
Share on other sites
Thanks, it turns out that it was resetting the alpha blend settings in the Device.RenderState area and it looked like a color issue.

-Devin

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!