Skip to main content
gamedev.net
🔒 Locked

Break code [render a bitmap]

Started by BlueChip 4 replies 350+ views
Original Post
BlueChip
BlueChip
Hi boys... I''ve read some tutorials, and then I''ve write few code line... but they can''t work... LPDIRECT3DTEXTURE9 m_ptTexture = NULL; D3DXVECTOR2 m_v2RotationPoint= D3DXVECTOR2(1.0f, 1.0f);; D3DXVECTOR2 m_v2ScaleFactor= D3DXVECTOR2(1.0f, 1.0f);; D3DXVECTOR2 m_v2CenterTex= D3DXVECTOR2(1.0f, 1.0f);; D3DXVECTOR2 m_v2Coordinate= D3DXVECTOR2(1.0f, 1.0f);; LPCTSTR cPathSprite ("aaa.bmp"); D3DXCreateTextureFromFile( m_pd3dDevice, cPathSprite, &m_ptTexture ); pID3DXSprite->Draw(m_ptTexture,NULL,&m_v2ScaleFactor,&m_v2RotationPoint,1,&m_v2Coordinate,D3DCOLOR_ARGB(1,10,10,10)); <--- this gime me a runtime error boh... this code is very short... how do I can to mistake it? Byezzz and thanks
coma
coma
it seams the texture object wasnt loaded in the prev. line..
so you dont have a valid pointer to pass..
check''t up.
BlueChip
BlueChip
mmmm...
I''ve a valid pointer LPDIRECT3DTEXTURE9 m_ptTexture = NULL;
I''ve call a valid method D3DXCreateTextureFromFile( m_pd3dDevice, cPathSprite, &m_ptTexture );

Why doesn''t I''ve a valid pointer?

I can''t undertand....
RhoneRanger
RhoneRanger
Just a quick q, did your create texture from file return correctly?
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
BlueChip
BlueChip
If I debug the code, m_ptTexture have a data, but I don''t know if it is a correct memory address...
I think that is right because anyone error is returned

There is a mode to see if that value is right?

thanks ^__^
Pipo DeClown
Pipo DeClown
D3DCOLOR_ARGB( 255, 255, 0, 0 )

if you set A to 1 it''s VERY close transparent, so you see nothing.

.lick

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.