FrameBuffer.cc 1.06 KB
Newer Older
Robert Menzel's avatar
Robert Menzel committed
1
2
3
4
5
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011, Computer Graphics Group RWTH Aachen University         //
// All rights reserved.                                                       //
////////////////////////////////////////////////////////////////////////////////

Robert Menzel's avatar
Robert Menzel committed
6
#include <ACGL/OpenGL/Objects/FrameBuffer.hh>
Robert Menzel's avatar
Robert Menzel committed
7

8
using namespace ACGL;
Robert Menzel's avatar
Robert Menzel committed
9
using namespace ACGL::OpenGL;
Robert Menzel's avatar
Robert Menzel committed
10

11
12
13
14
15
/*
 * We can't use the constants GL_COLOR_ATTACHMENT1 to GL_COLOR_ATTACHMENT7 here
 * because OpenGL ES does not know these yet.
 */
 GLuint FrameBuffer::msBuffers[8] = {
Robert Menzel's avatar
Robert Menzel committed
16
    GL_COLOR_ATTACHMENT0,
17
18
19
20
21
22
23
24
25
    GL_COLOR_ATTACHMENT0+1,
    GL_COLOR_ATTACHMENT0+2,
    GL_COLOR_ATTACHMENT0+3,
    GL_COLOR_ATTACHMENT0+4,
    GL_COLOR_ATTACHMENT0+5,
    GL_COLOR_ATTACHMENT0+6,
    GL_COLOR_ATTACHMENT0+7};


26
27
28
29
30
31
32
33
34
35
int_t FrameBuffer::getColorAttachmentIndexByName(const std::string& _name) const
{
     for(AttachmentVec::size_type i = 0; i < mColorAttachments.size(); i++)
     {
         if(mColorAttachments[i].name == _name)
             return i;
     }

     return -1;
 }