Changeset 487 for trunk/src/gl
- Timestamp:
- 03/08/16 08:05:51 (9 years ago)
- Location:
- trunk/src/gl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_context.cc
r485 r487 216 216 glBindBufferBase( buffer_type_to_enum( info->type ), index, info->glid ); 217 217 else 218 glBindBufferRange( buffer_type_to_enum( info->type ), index, info->glid, offset, size);218 glBindBufferRange( buffer_type_to_enum( info->type ), index, info->glid, static_cast<GLintptr>( offset ), static_cast<GLsizeiptr>( size ) ); 219 219 } 220 220 } … … 790 790 else 791 791 { 792 glDrawArrays( primitive_to_enum(prim), first, static_cast<GLsizei>( count ) );792 glDrawArrays( primitive_to_enum(prim), static_cast<GLint>( first ), static_cast<GLsizei>( count ) ); 793 793 } 794 794 unbind( va ); -
trunk/src/gl/gl_device.cc
r485 r487 358 358 if ( info ) 359 359 { 360 int result = glGetUniformBlockIndex( info->glid, name.data() );361 if ( result >= 0 ) return result;360 GLuint result = glGetUniformBlockIndex( info->glid, name.data() ); 361 if ( result != GL_INVALID_INDEX ) return static_cast<int>( result ); 362 362 if ( fatal ) 363 363 { … … 427 427 if ( ubase->is_dirty() ) 428 428 { 429 int uloc = ubase->get_location(); 429 GLint uloc = ubase->get_location(); 430 GLsizei size = static_cast<GLsizei>( ubase->get_length() ); 430 431 switch( ubase->get_type() ) 431 432 { 432 case FLOAT : glUniform1fv( uloc, ubase->get_length(), static_cast< uniform< enum_to_type< FLOAT >::type >*>( ubase )->get_value() ); break;433 case INT : glUniform1iv( uloc, ubase->get_length(), static_cast< uniform< enum_to_type< INT >::type >*>( ubase )->get_value() ); break;434 case FLOAT_VECTOR_2 : glUniform2fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*>( ubase )->get_value())); break;435 case FLOAT_VECTOR_3 : glUniform3fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*>( ubase )->get_value())); break;436 case FLOAT_VECTOR_4 : glUniform4fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*>( ubase )->get_value())); break;437 case INT_VECTOR_2 : glUniform2iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_2 >::type >*>( ubase )->get_value())); break;438 case INT_VECTOR_3 : glUniform3iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_3 >::type >*>( ubase )->get_value())); break;439 case INT_VECTOR_4 : glUniform4iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_4 >::type >*>( ubase )->get_value())); break;440 case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*>( ubase )->get_value())); break;441 case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*>( ubase )->get_value())); break;442 case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*>( ubase )->get_value())); break;433 case FLOAT : glUniform1fv( uloc, size, static_cast< uniform< enum_to_type< FLOAT >::type >*>( ubase )->get_value() ); break; 434 case INT : glUniform1iv( uloc, size, static_cast< uniform< enum_to_type< INT >::type >*>( ubase )->get_value() ); break; 435 case FLOAT_VECTOR_2 : glUniform2fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*>( ubase )->get_value())); break; 436 case FLOAT_VECTOR_3 : glUniform3fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*>( ubase )->get_value())); break; 437 case FLOAT_VECTOR_4 : glUniform4fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*>( ubase )->get_value())); break; 438 case INT_VECTOR_2 : glUniform2iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_2 >::type >*>( ubase )->get_value())); break; 439 case INT_VECTOR_3 : glUniform3iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_3 >::type >*>( ubase )->get_value())); break; 440 case INT_VECTOR_4 : glUniform4iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_4 >::type >*>( ubase )->get_value())); break; 441 case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*>( ubase )->get_value())); break; 442 case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*>( ubase )->get_value())); break; 443 case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*>( ubase )->get_value())); break; 443 444 default : break; // error? 444 445 } … … 507 508 } 508 509 509 uniform_base* u = uniform_base::create( utype, uni_loc, uni_len);510 uniform_base* u = uniform_base::create( utype, uni_loc, size_t( uni_len ) ); 510 511 NV_ASSERT( u, "Unknown uniform type!" ); 511 512 (*p->m_uniform_map)[ name ] = u;
Note: See TracChangeset
for help on using the changeset viewer.