Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Issue loading from Stream  (Read 460 times)
Soganatsu
Customers
Community Member
*****
Posts: 67


« on: March 10, 2010, 11:00:01 AM »

Hey there!
I've got a small problem that unfortunately is holding up development of our whole production pipeline..
So, like many others we're loading Meshes, Textures, etc. from Streams (in our case MemoryStreams from the Ionic.Zip Library, if that matters). Now here's a quick description of the problem:

a) Loading multiple textures after each other (in our texture viewer) works just fine.

Code:
Dim gdiTexture As New Microsoft.DirectX.Direct3D.Texture(TInternals.GetTexture(texture))
        Dim gdilocked As Microsoft.DirectX.GraphicsStream = gdiTexture.LockRectangle(0, Microsoft.DirectX.Direct3D.LockFlags.ReadOnly)
        Dim gdiBitmap As New Bitmap(256, 256, 4 * 256, PixelFormat.Format32bppRgb, gdilocked.InternalData)

gdiTexture.UnlockRectangle(0)
gdiTexture.Dispose()
TTextureFactory.DeleteTexture(texture)

b) Loading multiple meshes (X-Files) without their corresponding textures works fine as well.

Code:
mesh = TScene.CreateMeshBuilder()
mesh.LoadXFile(pakMan(path).GetTVData) 'The pakMan's our Package manager

c) Now here's the problem: After loading a mesh via the commands above (with or without textures, doesn't matter) I can't load any further textures. TV Log says the following:

Code:
03-10-2010 16:56:55 | RESOURCE MANAGER : Reset failed ! DX Error : -2147024809
03-10-2010 16:56:55 | TEXTURE MANAGER : Couldn't recreate the render texture after it has been reset. DirectX error : -2005530516
03-10-2010 16:56:55 | TEXT MANAGER : Failed to create vertex buffer for text rendering 3D

This is being repeated about 20 times before it quits with this message:

Code:
03-10-2010 16:56:55 | TEXTURE MANAGER : Couldn't load the texture file ##MEMORY:59020720|1398256. Unknown error : -2005530518

In VS I get stopped with a Null-Reference-Exception.
Would be really good if someone had an explanation for that issue. If further code's needed, just tell me.

Greets,
Philipp //Illuminated Games
Logged
TripleView
Community Member
*
Posts: 32


« Reply #1 on: March 12, 2010, 11:35:17 PM »

Code:
Dim gdiTexture(999) As New Microsoft.DirectX.Direct3D.Texture(TInternals.GetTexture(texture))
        Dim gdilocked As Microsoft.DirectX.GraphicsStream = gdiTexture.LockRectangle(0, Microsoft.DirectX.Direct3D.LockFlags.ReadOnly)
        Dim gdiBitmap As New Bitmap(256, 256, 4 * 256, PixelFormat.Format32bppRgb, gdilocked.InternalData)

gdiTexture(X).UnlockRectangle(0)
gdiTexture(X).Dispose()
TTextureFactory.DeleteTexture(texture)

See what I did?
with the (999)'s?

Your only loading one texture there granted I have no freaking clue what your doing loading that way but in any event your only loading one texture to start with thats your problem..
Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4944


WWW
« Reply #2 on: March 13, 2010, 03:09:07 PM »

Well interesting.
The Reset error you're getting is actually "Name: E_INVALIDARG
Description: An invalid parameter was passed to the returning function"

Weird.

The reset lines means that the engine has to resize its device.
Could you make sure that the window is not resized when you load a mesh?

Btw it's not possible to resize the device in another thread than the one in which you initialized the engine. This is a limitation of DirectX. That's maybe the case here and the device is never reset correctly, then it can't load any texture with a bad device obviously.

So i would search in the "what resizes the device?" area.
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks