D3DXCreateSprite

Programming 2007/09/30 14:41
















D3DXCreateSprite

Creates a sprite object which is associated with a particular device. Sprite objects are used to draw 2D images to the screen.

HRESULT D3DXCreateSprite(
  LPDIRECT3DDEVICE9 pDevice,
  LPD3DXSPRITE * ppSprite
);

Parameters

pDevice
[in] Pointer to an IDirect3DDevice9 interface, the device to be associated with the sprite.
ppSprite
[out] Address of a pointer to an ID3DXSprite interface. This interface allows the user to access sprite functions.

Return Values

If the function succeeds, the return value is S_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL, E_OUTOFMEMORY.

Remarks

This interface can be used to draw two dimensional images in screen space of the associated device.

Requirements

Header: Declared in D3dx9core.h.


생성된 Sprite 객체 초기화후 렌더링할때엔

dx9 device의 BegineScene() 과 EndScene() 사이에 다음 코드를 넣어주면 된다.



 // 알파
 m_pSprite->Begin(D3DXSPRITE_ALPHABLEND);

 // 텍스쳐 그림
 m_pSprite->Draw(m_pTexture, &SrcRect, NULL, &Pos, 0xFFFFFFFF);
 m_pSprite->End();

'Programming' 카테고리의 다른 글

FreeType2 Library Metrics pixel 포맷  (0) 2008/01/18
freetype library  (0) 2007/12/14
rand(), srand(), RAND_MAX  (0) 2007/11/10
맵핑이란.. Mapping  (0) 2007/10/05
ID3DXSprite::Begin  (0) 2007/10/02
D3DXCreateSprite  (0) 2007/09/30
연결 리스트 ( Linked List ) 링크드 리스트  (0) 2007/09/23
순열(next_permutation)과 문자열 변환  (0) 2007/09/16
next_permutation  (0) 2007/09/13
DICamera  (0) 2007/06/19
Camera Class 구현  (0) 2007/06/19
Posted by Hangenie

트랙백 주소 :: http://hangenie.com/trackback/203 관련글 쓰기

댓글을 달아 주세요