DX3D Sur-Faces VS Tex-Tures, oh my! ;)

Started by
11 comments, last by cruiz 22 years ago
Hi People! I''m trying here to copy a texture(DX3D) in a lot of Textures(For animation..). Ok. I have here first: - CreateTextureFromFile (logical isn''t?) then... CreateTexture and I made a void texture. Ok then a bird( ) said to me I should take the CopyRects-command. ... ok ... I took it... And then... In the copyrects command you can''t(till I can see) use Textures to copy, you should give him surfaces... ????????? I mean... What????? Should I convert all my textures in surfaces and then copy and then convert it again in textures????? Is there an other command? Or what should I do. I mean...I have here the commandlists before me and here it says, that there is a surfacefromfile command. But not a convert texture to surface or surface to texture command... Please help!!! (i can remember on surfaces in DD This should be something different, not?) Thanks to all! Greets: C.Ruiz (I had today an english-test: horrible like you can see... )
Advertisement
Call GetSurfaceLevel member of your texture to get a surface pointer. Don''t forget to Release it when you are done.


Jack
Hey! Thanks for this post!
Ok now I have converted it and then "copyreccted" it!
But... Now I should convert it in texture again.
And... that's the same problem like before...
means... I did'nt found any commands to convert...
What's the command to convert it again from surface to texture now?
Tnx to all and to Jack!

Greets: C.Ruiz

[edited by - cruiz on March 19, 2002 4:41:31 AM]
Please help!
Do you know witch command I should take to
convert it now from surface to texture?
Pleeeeeaasssee!
This would be the last step!
Tnx to all: C.Ruiz
you don't convert surfaces to texture. The texture instead contains surfaces.

Call GetSurfaceLevel(whatever) to get access to one of them, and then just release the surface when you're done with it. If you did something to the surface you've already updated the texture.

[edited by - sorrow on March 19, 2002 8:34:50 AM]
oh.. and dude... lay off on the 6 question marks in sequence :o Makes it sound like you''ve gone thru 5 pots of coffee.
It doesn''t work but I don''t understand it either!
CreateTextureFromFile Tex1
CreateTexture Tex2(void) <-(could be probably wrong defintion)

And then??????
Tex1->GetSurface Level( 0, Surface1)

Copyrect( surface1 to surface2

And then????!!!!????

Get surface Level(0, Surface2)
????????
Hmmmmmmm.......
Can anyone explain this? Plz!
Tnx for posts but I''m still frustrated....

C.Ruiz

P.S.: Coffee is my best friend!
P.P.S.: I try to make my text "living".
The question marks should take the reader to a long journey of you know... What a ***?????? What am I writing here??????

I think what he is saying is, release your Surface1 pointer after you did you copy rect. Then go about your biz as usual.
Your texture buffers should be ready to party now.

Oh....and &%!@~!!!!!
Hmm this is how I do it (note: from memory and no real commands

CreateTexture("somefile", blabla);
CreateTexture(blank)

LPDIRECT3DSURFACE8 surf1;
LPDIRECT3DSURFACE8 surf2;

Tex1->GetSurfaceLevel(surf1);
Tex2->GetSurfaceLevel(surf2);

D3DDevice->CopyRects(whatever);

surf1->Release();
surf2->Release();

Hope this helps, oh and by the way D3D won''t convert between formats so make sure your dest texture is in the correct format...

Regards Shadows



Hi again!
Ok I did it. I believe.
Ok... I know I''m new in DX3D.
But it doesn''t work properly. Yeah....
I would have problems explaining it. I copy it
and then he paints only a part of it. In the rest surface of the brush(sorry for this english) it paints some crazy lines. Like an error. How... tv or I don''t know when it gives problems.
I hope you can Imagine.
Ok I think following:
I loaded the texture well. Because I can see one part ok. (i mean correct bits etc...)
There are 3 numbers.
I mean first there is the size of the vertices.
For example 7.0f and 1.0f. I I change this it changes the size of the entire texture-"field". This should not be the problem.
Then there is the size of CreateTexture.... should be the size of pixels not? (shoudl be! How I think...)
And then there is the size of the copied RECT. I mean his should be ok because I can change it and it works ok... (yes... without the rest...)

What does this crazy lines on the texture-"Field"????????
Man!!!!
Sorry people! Raelly!!! Probably It''s a newbie problem.
Probably It''s a big shame this problem.
Hope not but... I know...

Yes I''m tired.... and my coffee-can is void!!!!!!!!!
I need coffee!!!!!!!!

Greets to all out there: C.Ruiz

This topic is closed to new replies.

Advertisement