Sign in to follow this  
GuestUnit

Sprite can only load in windowed mode

Recommended Posts

Using Microsoft Visual C++ 2008 Express Edition. I tried to learn more about sprites using DirectX, but I ran into two interesting problems: 1. I need a custom build to load files with .png extensions. Anyway to solve this? I converted the .png image into a .bmp (save as...), and replaced what was needed. Now here's the second problem: I can only load .bmp files if it's compiled and ran in windowed mode. If I run in full screen, I get a message about an unhandled exception; an access violation. Unhandled exception at 0x004013b8 in dx9 sprites.exe: 0xC0000005: Access violation reading location 0x00000000. A yellow arrow points at: d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); What does this indicate and how can it be solved? Thanks for whatever help you can give.

Share this post


Link to post
Share on other sites
I need a custom build to load files with .png extensions. Anyway to solve this?
What do you mean? DirectX can load .png .bmp .jpg .tga ... What error are you getting? Is it compile time? Run time?

Unhandled exception at 0x004013b8 in dx9 sprites.exe: 0xC0000005: Access violation reading location 0x00000000.
Your directX device initialization failed. Check the return value from IDirect3D9::CreateDevice.

Share this post


Link to post
Share on other sites
Gah, sorry for wasting your time.

It turned out that it was just the IDE complaining about a lack of a .png builder. I thought it knew that DirectX could load them.

I don't know why, but I re-did the tutorial and didn't get the DirectX initialization failure. I guess I made a typo during the editting and never caught it.

But thanks for the last problem, it might help me in the future.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this