Changeset 520 for trunk/src/gfx/gfx_terminal.cc
- Timestamp:
- 10/03/16 17:45:46 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/gfx_terminal.cc
r514 r520 84 84 fgcolor = fg.get_argb32(); 85 85 bgcolor = bg.get_argb32(); 86 gylph = uint32( ch ); 87 NV_LOG_INFO( uint32( 88 ( fgcolor & uint32( 0x00FF0000 ) ) >> 16 ), "-", uint32( ( fgcolor & uint32( 0x0000FF00 ) ) >> 8 ),"-" , uint32( fgcolor & uint32( 0x000000FF ) ) ); 86 gylph = uint32( uint8(ch) ); 89 87 } 90 88 }; … … 139 137 m_dc.p = m_context->create_program( nv_gfx_terminal_vs, nv_gfx_terminal_fs ); 140 138 141 m_data->buffer = m_context->create_buffer( nv::UNIFORM_BUFFER, nv:: DYNAMIC_DRAW, tsize.x * tsize.y * sizeof( gfx_terminal_uniform_block ), m_data->data );139 m_data->buffer = m_context->create_buffer( nv::UNIFORM_BUFFER, nv::STREAM_DRAW, tsize.x * tsize.y * sizeof( gfx_terminal_uniform_block ), m_data->data ); 142 140 m_context->bind( m_data->buffer, 7 ); 143 141 m_context->get_device()->set_opt_uniform( m_dc.p, "term_size", vec2( tsize ) ); … … 151 149 void gfx_terminal::update() 152 150 { 153 m_context->bind( m_data->buffer, 7 ); 154 m_context->update( m_data->buffer, m_data->data, 0, m_data->size.x * m_data->size.y * sizeof( gfx_terminal_uniform_block ) ); 155 m_update_needed = false; 151 if ( m_update_needed ) 152 { 153 m_context->bind( m_data->buffer, 7 ); 154 m_context->update( m_data->buffer, m_data->data, 0, m_data->size.x * m_data->size.y * sizeof( gfx_terminal_uniform_block ) ); 155 m_update_needed = false; 156 } 156 157 } 157 158
Note: See TracChangeset
for help on using the changeset viewer.