16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 20:39:18 +02:00

shadow visibilty fixes, more strict degenerate triangle detection

This commit is contained in:
tmj-fstate
2017-07-27 18:23:48 +02:00
parent 000603877c
commit bb58156513
10 changed files with 173 additions and 139 deletions

View File

@@ -78,6 +78,7 @@ ui_layer::render() {
// render code here
render_background();
render_texture();
render_progress();
render_panels();
render_tooltip();
@@ -235,6 +236,31 @@ ui_layer::render_background() {
float4( 1.0f, 1.0f, 1.0f, 1.0f ) );
}
void
ui_layer::render_texture() {
if( m_texture != NULL ) {
::glColor4f( 1.f, 1.f, 1.f, 1.f );
::glDisable( GL_BLEND );
GfxRenderer.Bind( NULL );
::glBindTexture( GL_TEXTURE_2D, m_texture );
auto const size = 512.f;
glBegin( GL_TRIANGLE_STRIP );
glMultiTexCoord2f( m_textureunit, 0.f, 1.f ); glVertex2f( 0.f, 256.f );
glMultiTexCoord2f( m_textureunit, 0.f, 0.f ); glVertex2f( 0.f, 256.f + size );
glMultiTexCoord2f( m_textureunit, 1.f, 1.f ); glVertex2f( size, 256.f );
glMultiTexCoord2f( m_textureunit, 1.f, 0.f ); glVertex2f( size, 256.f + size );
glEnd();
::glEnable( GL_BLEND );
}
}
void
ui_layer::print( std::string const &Text )
{