GLenum OpenGLRenderer::ms_aeZBufferCompare[ZBufferState::CF_QUANTITY] = { GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, GL_ALWAYS };
//--------------------------------------------------------- void OpenGLRenderer::SetZBufferState (ZBufferState* pkState) { if ( pkState->Enabled() ) { glEnable(GL_DEPTH_TEST); glDepthFunc(ms_aeZBufferCompare[pkState->Compare()]); } else { glDisable(GL_DEPTH_TEST); glDepthFunc(GL_ALWAYS); }
if ( pkState->Writeable() ) glDepthMask(GL_TRUE); else glDepthMask(GL_FALSE); }
|
#223-1. 안영기 |
2004/02/27 (Fri) |
그냥...
//--------------------------------------------------------- #define SM(gal,T_T)gl##gal(GL_DEPTH_TEST),glDepthFunc(ms_aeZBufferCompare[T_T]) void OpenGLRenderer::SetZBufferState(ZBufferState* pkState) { pkState->Enabled() ? SM(Enable,pkState->Compare()) : SM(Disable,7); glDepthMask(pkState->Writeable() ? GL_TRUE : GL_FALSE); }
|
|
|
#223-2. 왕아저씨 |
2004/02/27 (Fri) |
|
|
#223-3. 안영기 |
2004/02/27 (Fri) |
별 뜻은 없었고...
단지 SMgal T_T라는 문자열이 코드에 나오도록 해보고 싶어서... (위의 함수로 대체해도 결과가 똑같을 것임..)
|
|
|