Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 19-Jul-2012, 04:29   #1
TastenamyangGT
Registered
 
Join Date: Jul 2012
Posts: 2
Icon Frown How to rotate surface and display? i am using direct3D9

Hi there,

I wand to rotate my surface and display . i am using direcr3D9.

i succeed to display yuv images using CreteOffscreenPlainSurface and StretchRect methods.

and then i have to rotate these images... so i desided on using D3DXSprite interpace. and Draw method( this is possible rotating images)

So i need to create texture and surface.

i crated texture using D3DCreateTexture and i got surface using GetSurfaceLevel method.

and then i tried to wirte my image data this buffer using LockRect.
but it filed. it seems like that buffer size is different.

pitch value between the surface1 using CreateOffscreenPlainSurface and the other surface2 using GetSurfaceLevel are different.

surface2 is multiple4 than surface1... why???

So i don't know how handle this situation....

please help me out if you know any other idea to rotate surface...and display ...

Thank you!
TastenamyangGT is offline   Reply With Quote
Old 24-Jul-2012, 02:40   #2
TastenamyangGT
Registered
 
Join Date: Jul 2012
Posts: 2
Default

This is my code ..
I used sprite interface and draw method to display images

============================================
//ready to draw

hr = g_lpD3DDevice->CreateTexture(640, 480, 1, D3DUSAGE_RENDERTARGET,
D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &g_lpTexture, NULL)

hr = g_lpTexture->GetSurfaceLevel(0,&g_lpTextureSur);

D3DXCreateSprite(g_lpD3DDevice,&g_lpSprite);


=============================================
//Draw

HRESULT hr = g_lpD3DDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 0, 0 );
g_lpD3DDevice->BeginScene();
g_lpSprite->Begin(D3DXSPRITE_ALPHABLEND);
hr = g_lpD3DDevice->StretchRect( g_lpSurface, 0, g_lpTextureSur, 0, D3DTEXF_NONE ); // copy from my specific surface to texture

RECT rc;
SetRect(&rc,0,0,640,480);
D3DXVECTOR3 vec = D3DXVECTOR3(0,0,0);

g_lpD3DDevice->SetRenderTarget(0, g_lpTextureSur);

hr = g_lpSprite->Draw(g_lpTexture,&rc,NULL,&vec,0);

g_lpSprite->End();
g_lpD3DDevice->EndScene();
g_lpD3DDevice->Present( NULL, NULL, NULL,NULL );

this is not work ..

i tried to check my texture surface.

hr = g_lpD3DDevice->StretchRect( g_lpTextureSur, 0,g_lpBackbuffer , 0, D3DTEXF_NONE );

texture is working. I think texture was created successfully. i don't know what is wrong part in my code... pleas help me out ! Thank you!
TastenamyangGT is offline   Reply With Quote
Old 26-Jul-2012, 23:01   #3
Davros
Darlek ******
 
Join Date: Jun 2004
Posts: 9,663
Default

I'm sure someone will have an answer for you, thee are some clever people on here:
keep checking back
__________________
Guardian of the Most holy Two Terabytes of Gaming Goodness™
Davros is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:53.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.