| 151 | } |
| 152 | |
| 153 | bool CGLFrameBuffer::Use() |
| 154 | { |
| 155 | ScopedPerfMarker(__FUNCTION__); |
| 156 | bool result = false; |
| 157 | |
| 158 | if (m_Ready) |
| 159 | { |
| 160 | #ifndef NEW_RENDERER_ENABLED |
| 161 | glEnable(GL_TEXTURE_2D); |
| 162 | |
| 163 | glGetIntegerv(GL_FRAMEBUFFER_BINDING, &m_OldFrameBuffer); |
| 164 | glBindFramebuffer(GL_FRAMEBUFFER, m_FrameBuffer); |
| 165 | glBindTexture(GL_TEXTURE_2D, Texture.Texture); |
| 166 | |
| 167 | glViewport(0, 0, Texture.Width, Texture.Height); |
| 168 | |
| 169 | glMatrixMode(GL_PROJECTION); |
| 170 | glLoadIdentity(); |
| 171 | |
| 172 | glOrtho(0.0, Texture.Width, 0.0, Texture.Height, -150.0, 150.0); |
| 173 | |
| 174 | glMatrixMode(GL_MODELVIEW); |
| 175 | #else |
| 176 | HACKRender_GetFrameBuffer(g_renderCmdList, &m_OldFrameBuffer); |
| 177 | RenderAdd_SetFrameBuffer(g_renderCmdList, SetFrameBufferCmd{ m_FrameBuffer }); |
| 178 | static constexpr bool flipped_y = true; |
| 179 | RenderAdd_SetViewParams( |
| 180 | g_renderCmdList, |
| 181 | SetViewParamsCmd{ 0, |
| 182 | 0, |
| 183 | int(m_Width), |
| 184 | int(m_Height), |
| 185 | int(m_Width), |
| 186 | int(m_Height), |
| 187 | -150, |
| 188 | 150, |
| 189 | 1.f, |
| 190 | flipped_y }); |
| 191 | #endif |
| 192 | |
| 193 | result = true; |
| 194 | } |
| 195 | |
| 196 | return result; |
| 197 | } |
| 198 | |
| 199 | void CGLFrameBuffer::Draw(int x, int y) |
| 200 | { |
no test coverage detected