ID3DXSprite::Begin
Prepares a device for drawing sprites.
HRESULT Begin( DWORD Flags );
Parameters
- Flags
- [in] Combination of zero or more flags that describe sprite rendering options. For this method, the valid flags are:
- D3DXSPRITE_ALPHABLEND
- D3DXSprite__BILLBOARD
- D3DXSPRITE_DONOTMODIFY_RENDERSTATE
- D3DXSPRITE_DONOTSAVESTATE
- D3DXSPRITE_OBJECTSPACE
- D3DXSprite__SORT_DEPTH_BACKTOFRONT
- D3DXSprite__SORT_DEPTH_FRONTTOBACK
- D3DXSprite__SORT_TEXTURE
Return Values
If the method succeeds, the return value is S_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, D3DXERR_INVALIDDATA, E_OUTOFMEMORY.
Remarks
This method must be called from inside a IDirect3DDevice9::BeginScene . . . IDirect3DDevice9::EndScene sequence. ID3DXSprite::Begin cannot be used as a substitute for either IDirect3DDevice9::BeginScene or ID3DXRenderToSurface::BeginScene.
This method will set the following states on the device.
Render States:
| Type (D3DRENDERSTATETYPE) | Value |
|---|---|
| D3DRS_ALPHABLENDENABLE | TRUE |
| D3DRS_ALPHAFUNC | D3DCMP_GREATER |
| D3DRS_ALPHAREF | 0x00 |
| D3DRS_ALPHATESTENABLE | AlphaCmpCaps |
| D3DRS_BLENDOP | D3DBLENDOP_ADD |
| D3DRS_CLIPPING | TRUE |
| D3DRS_CLIPPLANEENABLE | FALSE |
| D3DRS_COLORWRITEENABLE | D3DCOLORWRITEENABLE_ALPHA | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_RED |
| D3DRS_CULLMODE | D3DCULL_NONE |
| D3DRS_DESTBLEND | D3DBLEND_INVSRCALPHA |
| D3DRS_DIFFUSEMATERIALSOURCE | D3DMCS_COLOR1 |
| D3DRS_ENABLEADAPTIVETESSELLATION | FALSE |
| D3DRS_FILLMODE | D3DFILL_SOLID |
| D3DRS_FOGENABLE | FALSE |
| D3DRS_INDEXEDVERTEXBLENDENABLE | FALSE |
| D3DRS_LIGHTING | FALSE |
| D3DRS_RANGEFOGENABLE | FALSE |
| D3DRS_SEPARATEALPHABLENDENABLE | FALSE |
| D3DRS_SHADEMODE | D3DSHADE_GOURAUD |
| D3DRS_SPECULARENABLE | FALSE |
| D3DRS_SRCBLEND | D3DBLEND_SRCALPHA |
| D3DRS_SRGBWRITEENABLE | FALSE |
| D3DRS_STENCILENABLE | FALSE |
| D3DRS_VERTEXBLEND | FALSE |
| D3DRS_WRAP0 | 0 |
Texture Stage States:
| Stage Identifier | Type (D3DTEXTURESTAGESTATETYPE) | Value |
|---|---|---|
| 0 | D3DTSS_ALPHAARG1 | D3DTA_TEXTURE |
| 0 | D3DTSS_ALPHAARG2 | D3DTA_DIFFUSE |
| 0 | D3DTSS_ALPHAOP | D3DTOP_MODULATE |
| 0 | D3DTSS_COLORARG1 | D3DTA_TEXTURE |
| 0 | D3DTSS_COLORARG2 | D3DTA_DIFFUSE |
| 0 | D3DTSS_COLOROP | D3DTOP_MODULATE |
| 0 | D3DTSS_TEXCOORDINDEX | 0 |
| 0 | D3DTSS_TEXTURETRANSFORMFLAGS | D3DTTFF_DISABLE |
| 1 | D3DTSS_ALPHAOP | D3DTOP_DISABLE |
| 1 | D3DTSS_COLOROP | D3DTOP_DISABLE |
Sampler States:
| Sampler Stage Index | Type (D3DSAMPLERSTATETYPE) | Value |
|---|---|---|
| 0 | D3DSAMP_ADDRESSU | D3DTADDRESS_CLAMP |
| 0 | D3DSAMP_ADDRESSV | D3DTADDRESS_CLAMP |
| 0 | D3DSAMP_MAGFILTER | D3DTEXF_ANISOTROPIC if TextureFilterCaps includes D3DPTFILTERCAPS_MAGFANISOTROPIC; otherwise D3DTEXF_LINEAR |
| 0 | D3DSAMP_MAXMIPLEVEL | 0 |
| 0 | D3DSAMP_MAXANISOTROPY | MaxAnisotropy |
| 0 | D3DSAMP_MINFILTER | D3DTEXF_ANISOTROPIC if TextureFilterCaps includes D3DPTFILTERCAPS_MINFANISOTROPIC; otherwise D3DTEXF_LINEAR |
| 0 | D3DSAMP_MIPFILTER | D3DTEXF_LINEAR if TextureFilterCaps includes D3DPTFILTERCAPS_MIPFLINEAR; otherwise D3DTEXF_POINT |
| 0 | D3DSAMP_MIPMAPLODBIAS | 0 |
| 0 | D3DSAMP_SRGBTEXTURE | 0 |
Note This method disables N-patches.
Requirements
Header: Declared in D3dx9core.h.
See Also
'Programming' 카테고리의 다른 글
| FreeType2 library ft_pixel_mode_mono (0) | 2008/01/18 |
|---|---|
| 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 |
TAG DX9






댓글을 달아 주세요