Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_d3drender.c @ 1988:1ee02169bbb0
Figured out how texture stages work, thanks to this:
http://www.toymaker.info/Games/html/texture_states.html
Both color and alpha source modulation work now! :)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 28 Aug 2006 04:39:37 +0000 |
parents | 36a08379b3f2 |
children | 3863ba81c1d6 |
comparison
equal
deleted
inserted
replaced
1987:36a08379b3f2 | 1988:1ee02169bbb0 |
---|---|
380 | 380 |
381 /* Set up parameters for rendering */ | 381 /* Set up parameters for rendering */ |
382 IDirect3DDevice9_SetVertexShader(data->device, NULL); | 382 IDirect3DDevice9_SetVertexShader(data->device, NULL); |
383 IDirect3DDevice9_SetFVF(data->device, | 383 IDirect3DDevice9_SetFVF(data->device, |
384 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1); | 384 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1); |
385 IDirect3DDevice9_SetRenderState(data->device, D3DRS_ZENABLE, D3DZB_FALSE); | |
385 IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE, | 386 IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE, |
386 D3DCULL_NONE); | 387 D3DCULL_NONE); |
387 IDirect3DDevice9_SetRenderState(data->device, D3DRS_LIGHTING, FALSE); | 388 IDirect3DDevice9_SetRenderState(data->device, D3DRS_LIGHTING, FALSE); |
389 /* Enable color modulation by diffuse color */ | |
390 IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLOROP, | |
391 D3DTOP_MODULATE); | |
392 IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLORARG1, | |
393 D3DTA_TEXTURE); | |
394 IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLORARG2, | |
395 D3DTA_DIFFUSE); | |
396 /* Enable alpha modulation by diffuse alpha */ | |
397 IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAOP, | |
398 D3DTOP_MODULATE); | |
399 IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAARG1, | |
400 D3DTA_TEXTURE); | |
401 IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAARG2, | |
402 D3DTA_DIFFUSE); | |
388 | 403 |
389 return renderer; | 404 return renderer; |
390 } | 405 } |
391 | 406 |
392 static int | 407 static int |