git-svn-id: svn://db.shs.com.ru/libs@44 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -87,7 +87,7 @@ void GLFramebuffer::bind() {
|
||||
QVector<GLenum> buffers;
|
||||
for (int i = 0; i < colors.size(); ++i)
|
||||
buffers << GL_COLOR_ATTACHMENT0 + i;
|
||||
glDrawBuffers(colors.size(), buffers.constData());
|
||||
glDrawBuffers(buffers.size(), buffers.constData());
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
//glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||
glViewport(0, 0, wid, hei);
|
||||
@@ -105,9 +105,10 @@ void GLFramebuffer::release() {
|
||||
|
||||
void GLFramebuffer::setWriteBuffers(int indeces[]) {
|
||||
QVector<GLenum> buffers;
|
||||
for (uint i = 0; i < sizeof(indeces); ++i)
|
||||
for (uint i = 0; i < sizeof(indeces); ++i) {
|
||||
buffers << GL_COLOR_ATTACHMENT0 + indeces[i];
|
||||
glDrawBuffers(colors.size(), buffers.constData());
|
||||
}
|
||||
glDrawBuffers(buffers.size(), buffers.constData());
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +116,7 @@ void GLFramebuffer::setWriteBuffers(int * indeces, int count) {
|
||||
QVector<GLenum> buffers;
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffers << GL_COLOR_ATTACHMENT0 + indeces[i];
|
||||
glDrawBuffers(colors.size(), buffers.constData());
|
||||
glDrawBuffers(buffers.size(), buffers.constData());
|
||||
}
|
||||
|
||||
|
||||
@@ -127,3 +128,9 @@ void GLFramebuffer::bindColorTextures() {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GLFramebuffer::bindDepthTexture(int channel) {
|
||||
glActiveTextureChannel(channel);
|
||||
glBindTexture(GL_TEXTURE_2D, tex_d);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user