MCPcopy Create free account
hub / github.com/Kitware/VTK / DisplayFrameBufferAttachment

Method DisplayFrameBufferAttachment

Rendering/OpenGL2/vtkOpenGLFramebufferObject.cxx:986–1082  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Display a given attachment for the current framebuffer object.

Source from the content-addressed store, hash-verified

984// Description:
985// Display a given attachment for the current framebuffer object.
986void vtkOpenGLFramebufferObject::DisplayFrameBufferAttachment(unsigned int uattachment)
987{
988 GLenum attachment = static_cast<GLenum>(uattachment);
989
990 GLint params;
991 glGetFramebufferAttachmentParameteriv(
992 GL_FRAMEBUFFER, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &params);
993
994 vtkOpenGLCheckErrorMacro("after getting FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE");
995
996 switch (params)
997 {
998 case GL_NONE:
999 std::cout << " this attachment is empty" << endl;
1000 break;
1001 case GL_TEXTURE:
1002 glGetFramebufferAttachmentParameteriv(
1003 GL_FRAMEBUFFER, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &params);
1004 vtkOpenGLCheckErrorMacro("after getting FRAMEBUFFER_ATTACHMENT_OBJECT_NAME");
1005 std::cout << " this attachment is a texture with name: " << params << endl;
1006 glGetFramebufferAttachmentParameteriv(
1007 GL_FRAMEBUFFER, attachment, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, &params);
1008 vtkOpenGLCheckErrorMacro("after getting FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL");
1009 std::cout << " its mipmap level is: " << params << endl;
1010 glGetFramebufferAttachmentParameteriv(
1011 GL_FRAMEBUFFER, attachment, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, &params);
1012 vtkOpenGLCheckErrorMacro("after getting FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE");
1013 if (params == 0)
1014 {
1015 std::cout << " this is not a cube map texture." << endl;
1016 }
1017 else
1018 {
1019 std::cout << " this is a cube map texture and the image is contained in face " << params
1020 << endl;
1021 }
1022#ifdef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET
1023 glGetFramebufferAttachmentParameteriv(
1024 GL_FRAMEBUFFER, attachment, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET, &params);
1025#endif
1026 vtkOpenGLCheckErrorMacro("after getting FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET");
1027 if (params == 0)
1028 {
1029 std::cout << " this is not 3D texture." << endl;
1030 }
1031 else
1032 {
1033 std::cout << " this is a 3D texture and the zoffset of the attached image is " << params
1034 << endl;
1035 }
1036 break;
1037 case GL_RENDERBUFFER:
1038 std::cout << " this attachment is a renderbuffer" << endl;
1039 glGetFramebufferAttachmentParameteriv(
1040 GL_FRAMEBUFFER, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &params);
1041 // this->PrintError("after getting FRAMEBUFFER_ATTACHMENT_OBJECT_NAME");
1042 std::cout << " this attachment is a renderbuffer with name: " << params << endl;
1043

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected