HRESULT SETRENDERSTATE (D3DrenderstateType State, DWord Value)

xiaoxiao2021-03-06  41

Set the rendering status parameters of a device.

HRESULT SetRenderState (D3DRENDERSTATETYPE State, DWORD Value); Parameter: State [in] Device state variable that is being modified This parameter can be any member of the D3DRENDERSTATETYPE enumerated type Value [in] New value for the device render state to be set.. . The meaning of this parameter is dependent on the value specified for State. for example, if State were D3DRS_SHADEMODE, the second parameter would be one member of the D3DSHADEMODE enumerated type. return value If the method succeeds, the return value is D3D_OK. D3DERR_INVALIDCALL is returned if one of the arguments is invalid Here are a few of the more common:. // This is because we want to hide the back of our polygonsg_pD3DDevice-> SetRenderState (D3DRS_CULLMODE, D3DCULL_CCW); // Turn off lighting because we are specifying That Our Vertices Have COLOURG_PD3DDEVICE-> SetRenderstate (D3DRS_Lighting, False); // Activation Deep Buffer M_PD3DDevice-> setrenderstate (D3DRS_ZE NABLE, D3DZB_TRUE); // Turn on lighting lighting open m_pD3DDevice-> SetRenderState (D3DRS_LIGHTING, TRUE); // Set ambient light level of the ambient light is provided m_pD3DDevice-> SetRenderState (D3DRS_AMBIENT, D3DCOLOR_XRGB (32, 32, 32)); / / activation D3DRS_NORMALIZENORMALS rendering state m_pD3DDevice-> SetRenderState (D3DRS_NORMALIZENORMALS, TRUE); // Enable alpha blending so we can use transparent textures transparent texture m_pD3DDevice-> SetRenderState (D3DRS_ALPHABLENDENABLE, TRUE); // Set how the texture should be blended (use alpha) with alpha m_pD3DDevice-> SetRenderState (D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); m_pD3DDevice-> SetRenderState (D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); D3DRENDERSTATETYPE structure: typedef enum _D3DRENDERSTATETYPE {D3DRS_ZENABLE =

7, D3DRS_FILLMODE = 8, D3DRS_SHADEMODE = 9, D3DRS_ZWRITEENABLE = 14, D3DRS_ALPHATESTENABLE = 15, D3DRS_LASTPIXEL = 16, D3DRS_SRCBLEND = 19, D3DRS_DESTBLEND = 20, D3DRS_CULLMODE = 22, D3DRS_ZFUNC = 23, D3DRS_ALPHAREF = 24, D3DRS_ALPHAFUNC = 25, D3DRS_DITHERENABLE = 26, D3DRS_ALPHABLENDENABLE = 27, D3DRS_FOGENABLE = 28, D3DRS_SPECULARENABLE = 29, D3DRS_FOGCOLOR = 34, D3DRS_FOGTABLEMODE = 35, D3DRS_FOGSTART = 36, D3DRS_FOGEND = 37, D3DRS_FOGDENSITY = 38, D3DRS_RANGEFOGENABLE = 48, D3DRS_STENCILENABLE = 52, D3DRS_STENCILFAIL = 53, D3DRS_STENCILZFAIL = 54, D3DRS_STENCILPASS = 55, D3DRS_STENCILFUNC = 56, D3DRS_STENCILREF = 57, D3DRS_STENCILMASK = 58, D3DRS_STENCILWRITEMASK = 59, D3DRS_TEXTUREFACTOR = 60, D3DRS_WRAP0 = 128, D3DRS_WRAP1 = 129, D3DRS_WRAP2 = 130, D3DRS_WRAP3 = 131, D3DRS_WRAP4 = 132, D3DRS_WRAP5 = 133, D3DRS_WRAP6 = 134, D3DRS_WRAP7 = 135, D3DRS_CLIPPING = 136, D3DRS_LIGHTING = 137, D3DRS_AMBIENT = 139, D3DRS_FOGVERTEXMODE = 140, D3DRS_COLORVERTEX = 141, D3DRS_LOCALVIEWER = 142, D3DRS_NORMALIZENORMALS = 143, D3DRS_DIFFUSEMATERIALSOURCE = 145, D3DRS_SPECULARMATERIALSOURCE = 146, D3DRS_AMBIENTMATERIALSOURCE = 147, D3DRS_EMISSIVEMATERIALSOURCE = 148, D3DRS_VERTEXBLEND = 151, D3DRS_CLIPPLANEENABLE = 152, D3DRS_POINTSIZE = 154, D3DRS_POINTSIZE_MIN = 155, D3DRS_POINTSPRIEENABLE = 156, D3DRS_PointScaleEnable =

转载请注明原文地址:https://www.9cbs.com/read-57300.html

New Post(0)