MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / IsFramebufferValid

Function IsFramebufferValid

test/browser/webgl_with_closure.c:24–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23
24 bool IsFramebufferValid( GLenum target )
25 {
26 // get framebuffer status from opengl
27 GLenum status = glCheckFramebufferStatus( target );
28
29 // debug output of the framebuffer status
30 switch( status )
31 {
32 case GL_FRAMEBUFFER_COMPLETE:
33 printf("**** Framebuffer COMPLETE\n");
34 break;
35 case GL_FRAMEBUFFER_UNDEFINED:
36 printf("**** Target is the default framebuffer, but the default framebuffer does not exist.\n");
37 break;
38 case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
39 printf("**** Any of the framebuffer attachment points are framebuffer incomplete.\n");
40 break;
41 case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
42 printf("**** The framebuffer does not have at least one image attached to it.\n");
43 break;
44 case GL_FRAMEBUFFER_UNSUPPORTED:
45 printf("**** the combination of internal formats of the attached images violates an "
46 "implementation-dependent set of restrictions.\n");
47 break;
48 case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
49 printf("**** The value of GL_RENDERBUFFER_SAMPLES is not the same for all attached renderbuffers; "
50 "if the value of GL_TEXTURE_SAMPLES is not the same for all attached textures; or, if "
51 "the attached images are a mix of renderbuffers and textures, the value of "
52 "GL_RENDERBUFFER_SAMPLES does not match the value of GL_TEXTURE_SAMPLES."
53 "Or the value of GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not the same for all attached "
54 "textures; or, if the attached images are a mix of renderbuffers and textures, the "
55 "value of GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not GL_TRUE for all attached textures.\n");
56 break;
57 case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
58 printf("**** GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS.\n");
59 break;
60 default:
61 printf("**** IsFramebufferValid() Unknown validation error: %#08x\n", (uint32_t)status );
62 break;
63 }
64
65 return status == GL_FRAMEBUFFER_COMPLETE;
66 }
67
68
69int main()

Callers 1

mainFunction · 0.85

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected