glFramebufferRenderbuffer - OpenGL 4 Reference Pages

文章推薦指數: 80 %
投票人數:10人

glFramebufferRenderbuffer and glNamedFramebufferRenderbuffer attaches a renderbuffer as one of the logical buffers of the specified framebuffer object. Name glFramebufferRenderbuffer,glNamedFramebufferRenderbuffer—attacharenderbufferasalogicalbufferofaframebufferobject CSpecification voidglFramebufferRenderbuffer( GLenumtarget,   GLenumattachment,   GLenumrenderbuffertarget,   GLuintrenderbuffer);   voidglNamedFramebufferRenderbuffer( GLuintframebuffer,   GLenumattachment,   GLenumrenderbuffertarget,   GLuintrenderbuffer);   Parameters target Specifiesthetargettowhichtheframebufferisbound forglFramebufferRenderbuffer. framebuffer Specifiesthenameoftheframebufferobjectfor glNamedFramebufferRenderbuffer. attachment Specifiestheattachmentpointoftheframebuffer. renderbuffertarget Specifiestherenderbuffertarget.Mustbe GL_RENDERBUFFER. renderbuffer Specifiesthenameofanexistingrenderbufferobjectof typerenderbuffertargetto attach. Description glFramebufferRenderbufferand glNamedFramebufferRenderbufferattachesa renderbufferasoneofthelogicalbuffersofthespecified framebufferobject.Renderbufferscannotbeattachedtothe defaultdrawandreadframebuffer,sotheyarenotvalidtargets ofthesecommands. ForglFramebufferRenderbuffer, theframebufferobjectisthatboundto target,whichmustbe GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFERor GL_FRAMEBUFFER. GL_FRAMEBUFFERisequivalentto GL_DRAW_FRAMEBUFFER. ForglNamedFramebufferRenderbuffer, framebufferisthenameofthe framebufferobject. renderbuffertargetmustbe GL_RENDERBUFFER. renderbuffermustbezeroorthenameof anexistingrenderbufferobjectoftype renderbuffertarget.If renderbufferisnotzero,thenthe specifiedrenderbufferwillbeusedasthelogicalbuffer identifiedbyattachmentofthespecified framebufferobject.Ifrenderbufferis zero,thenthevalueof renderbuffertargetisignored. attachmentspecifiesthelogical attachmentoftheframebufferandmustbe GL_COLOR_ATTACHMENTi, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENTor GL_DEPTH_STENCIL_ATTACHMENT. iinmayrangefromzerotothevalueof GL_MAX_COLOR_ATTACHMENTSminusone. Settingattachmenttothevalue GL_DEPTH_STENCIL_ATTACHMENTisaspecial casecausingboththedepthandstencilattachmentsofthe specifiedframebufferobjecttobesetto renderbuffer,whichshouldhavethebase internalformatGL_DEPTH_STENCIL. Thevalueof GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPEfor thespecifiedattachmentpointissetto GL_RENDERBUFFERandthevalueof GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAMEis settorenderbuffer.Allotherstate valuesofspecifiedattachmentpointaresettotheirdefault values.Nochangeismadetothestateoftherenderbuuffer objectandanypreviousattachmenttothe attachmentlogicalbufferofthe specifiedframebufferobjectisbroken. Ifrenderbufferiszero,thesecommands willdetachtheimage,ifany,identifiedbythespecified attachmentpointofthespecifiedframebufferobject.Allstate valuesoftheattachmentpointaresettotheirdefaultvalues. Errors GL_INVALID_ENUMisgeneratedby glFramebufferRenderbufferif targetisnotoneoftheaccepted framebuffertargets. GL_INVALID_OPERATIONisgeneratedby glFramebufferRenderbufferifzeroisbound totarget. GL_INVALID_OPERATIONisgeneratedby glNamedFramebufferRenderbufferif framebufferisnotthenameofan existingframebufferobject. GL_INVALID_ENUMisgeneratedif attachmentisnotoneoftheaccepted attachmentpoints. GL_INVALID_ENUMisgeneratedif renderbuffertargetisnot GL_RENDERBUFFER. GL_INVALID_OPERATIONisgeneratedif renderbuffertargetisnotzeroorthe nameofanexistingrenderbufferobjectoftype GL_RENDERBUFFER. VersionSupport OpenGLVersion Function/FeatureName 2.0 2.1 3.0 3.1 3.2 3.3 4.0 4.1 4.2 4.3 4.4 4.5 glFramebufferRenderbuffer - - ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ glNamedFramebufferRenderbuffer - - - - - - - - - - - ✔ SeeAlso glGenFramebuffers, glBindFramebuffer, glGenRenderbuffers, glFramebufferTexture, glFramebufferTexture1D, glFramebufferTexture2D, glFramebufferTexture3D Copyright Copyright©2010-2014KhronosGroup. Thismaterialmaybedistributedsubjecttothetermsandconditionssetforthin theOpenPublicationLicense,v1.0,8June1999. http://opencontent.org/openpub/.



請為這篇文章評分?