| 823 | } |
| 824 | |
| 825 | bool initialize(unsigned width, unsigned height, fboConfig &rConfigFBO, |
| 826 | fboData &rActiveFBO) { |
| 827 | // Framebuffer config options |
| 828 | vector<bufferConfig> colorConfigs; |
| 829 | vector<bufferConfig> depthConfigs; |
| 830 | bufferConfig temp; |
| 831 | |
| 832 | // add default color configs |
| 833 | temp.name = (m_bUseFloat ? "RGBA32F" : "RGBA8"); |
| 834 | temp.bits = (m_bUseFloat ? 32 : 8); |
| 835 | temp.format = (m_bUseFloat ? GL_RGBA32F : GL_RGBA8); |
| 836 | colorConfigs.push_back(temp); |
| 837 | |
| 838 | // add default depth configs |
| 839 | temp.name = "D24"; |
| 840 | temp.bits = 24; |
| 841 | temp.format = GL_DEPTH_COMPONENT24; |
| 842 | depthConfigs.push_back(temp); |
| 843 | |
| 844 | // If the FBO can be created, add it to the list of available configs, and |
| 845 | // make a menu entry |
| 846 | string root = colorConfigs[0].name + " " + depthConfigs[0].name; |
| 847 | |
| 848 | rConfigFBO.colorFormat = colorConfigs[0].format; |
| 849 | rConfigFBO.depthFormat = depthConfigs[0].format; |
| 850 | rConfigFBO.redbits = colorConfigs[0].bits; |
| 851 | rConfigFBO.depthBits = depthConfigs[0].bits; |
| 852 | |
| 853 | // single sample |
| 854 | rConfigFBO.name = root; |
| 855 | rConfigFBO.coverageSamples = 0; |
| 856 | rConfigFBO.depthSamples = 0; |
| 857 | |
| 858 | create(width, height, rConfigFBO, rActiveFBO); |
| 859 | |
| 860 | glBindFramebuffer(GL_FRAMEBUFFER, 0); |
| 861 | |
| 862 | return CHECK_FBO; |
| 863 | } |
| 864 | |
| 865 | bool create(GLuint width, GLuint height, fboConfig &config, fboData &data) { |
| 866 | bool multisample = config.depthSamples > 0; |
nothing calls this directly
no outgoing calls
no test coverage detected