// ---------------------------------------------------------------- display --- void TextRender::display(const int _viewPortWidth, const int _viewPortHeight) { //glClearColor(0.40, 0.40, 0.45, 1.00); //glClearColor(1.0, 1.0, 1.0, 1.0); //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); m_mutex.lock(); mat4_set_orthographic(&m_projection, 0, _viewPortWidth, 0, _viewPortHeight, -1, 1); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glUseProgram(m_text_buffer->shader); { glUniformMatrix4fv(glGetUniformLocation(m_text_buffer->shader, "model"), 1, 0, m_model.data); glUniformMatrix4fv(glGetUniformLocation(m_text_buffer->shader, "view"), 1, 0, m_view.data); glUniformMatrix4fv(glGetUniformLocation(m_text_buffer->shader, "projection"), 1, 0, m_projection.data); text_buffer_render(m_text_buffer); } m_mutex.unlock(); }
// ---------------------------------------------------------------- reshape --- void reshape( GLFWwindow* window, int width, int height ) { glViewport(0, 0, width, height); mat4_set_orthographic( &projection, 0, width, 0, height, -1, 1); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, width, 0, height, -1, 1); glMatrixMode(GL_MODELVIEW); TwWindowSize( width, height ); }
// ---------------------------------------------------------------- reshape --- static void reshape( int width, int height ) { glViewport(0, 0, width, height); mat4_set_orthographic( &projection, 0, width, 0, height, -1, 1); }
// ---------------------------------------------------------------- reshape --- void reshape( GLFWwindow* window, int width, int height ) { glViewport(0, 0, width, height); mat4_set_orthographic( &projection, 0, width, 0, height, -1, 1); }
void CFont::Resize(int width, int height) { mat4_set_orthographic(&projection, 0, width, 0, height, -1, 1); }