2009-12-07 4 views

답변

2

documentation에 따르면 찾고자하는 기능은 argGements GL_BLEND_SRC, GL_BLEND_DST가있는 glGet입니다. 이것은 OpenGL의 성가심 중 하나입니다. get과 sets는 (다른 것들 사이에서) 일치하지 않습니다.

3

나는 정확히 똑같은 상황에 부딪쳤다. 이전의 혼합 상태를 저장하고 완료되면 복원하는 방법은 다음과 같습니다.

// save off current state of blend enabled 
GLboolean blendEnabled; 
glGetBooleanv(GL_BLEND, &blendEnabled); 

// save off current state of src/dst blend functions 
GLint blendSrc; 
GLint blendDst; 
glGetIntegerv(GL_BLEND_SRC_ALPHA, &blendSrc); 
glGetIntegerv(GL_BLEND_DST_ALPHA, &blendDst); 

// 
// change blend state... do other stuff 
// 

// restore saved state of blend enabled and blend functions 
if (blendEnabled) { 
    glEnable(GL_BLEND); 
} 
else { 
    glDisable(GL_BLEND); 
} 

glBlendFunc(blendSrc, blendDst); 
1

몇 해 후 같은 문제가 발생했는데 문서가 여전히 불분명하거나 도청되었습니다. 완료되지 않은/버그에서 돈의 솔루션 @

하지만, 당신은 또한 _RGB 값을 복원해야합니다 ...

GLint last_blend_src_rgb; glGetIntegerv(GL_BLEND_SRC_RGB, &last_blend_src_rgb); 
GLint last_blend_dst_rgb; glGetIntegerv(GL_BLEND_DST_RGB, &last_blend_dst_rgb); 
GLint last_blend_src_alpha; glGetIntegerv(GL_BLEND_SRC_ALPHA, &last_blend_src_alpha); 
GLint last_blend_dst_alpha; glGetIntegerv(GL_BLEND_DST_ALPHA, &last_blend_dst_alpha); 

glBlendFuncSeparate(last_blend_src_rgb, last_blend_dst_rgb, last_blend_src_alpha, last_blend_dst_alpha); 
관련 문제