| 1135 | } |
| 1136 | } |
| 1137 | void SimpleOpenGL3App::dumpNextFrameToPng(const char* filename) |
| 1138 | { |
| 1139 | // open pipe to ffmpeg's stdin in binary write mode |
| 1140 | |
| 1141 | m_data->m_frameDumpPngFileName = filename; |
| 1142 | |
| 1143 | //you could use m_renderTexture to allow to render at higher resolutions, such as 4k or so |
| 1144 | if (!m_data->m_renderTexture) |
| 1145 | { |
| 1146 | m_data->m_renderTexture = new GLRenderToTexture(); |
| 1147 | GLuint renderTextureId; |
| 1148 | glGenTextures(1, &renderTextureId); |
| 1149 | |
| 1150 | // "Bind" the newly created texture : all future texture functions will modify this texture |
| 1151 | glBindTexture(GL_TEXTURE_2D, renderTextureId); |
| 1152 | |
| 1153 | // Give an empty image to OpenGL ( the last "0" ) |
| 1154 | //glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB, g_OpenGLWidth,g_OpenGLHeight, 0,GL_RGBA, GL_UNSIGNED_BYTE, 0); |
| 1155 | //glTexImage2D(GL_TEXTURE_2D, 0,GL_RGBA32F, g_OpenGLWidth,g_OpenGLHeight, 0,GL_RGBA, GL_FLOAT, 0); |
| 1156 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, |
| 1157 | m_instancingRenderer->getScreenWidth() * m_window->getRetinaScale(), m_instancingRenderer->getScreenHeight() * m_window->getRetinaScale(), 0, GL_RGBA, GL_FLOAT, 0); |
| 1158 | |
| 1159 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 1160 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); |
| 1161 | //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 1162 | //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 1163 | |
| 1164 | m_data->m_renderTexture->init(m_instancingRenderer->getScreenWidth() * m_window->getRetinaScale(), this->m_instancingRenderer->getScreenHeight() * m_window->getRetinaScale(), renderTextureId, RENDERTEXTURE_COLOR); |
| 1165 | } |
| 1166 | |
| 1167 | m_data->m_renderTexture->enable(); |
| 1168 | } |
| 1169 | |
| 1170 | void SimpleOpenGL3App::setUpAxis(int axis) |
| 1171 | { |
no test coverage detected