Changeset 361 for trunk/src/gl/gl_device.cc
- Timestamp:
- 05/15/15 12:01:41 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_device.cc
r350 r361 22 22 } 23 23 24 program gl_device::create_program( const string& vs_source, const string&fs_source )24 program gl_device::create_program( string_ref vs_source, string_ref fs_source ) 25 25 { 26 26 program result = m_programs.create(); … … 35 35 // this is a temporary function that will be removed once we find a way to 36 36 // pass binary file data around 37 image_data* gl_device::create_image_data( const std::string&filename )37 image_data* gl_device::create_image_data( string_ref filename ) 38 38 { 39 39 load_sdl_image_library(); 40 SDL_Surface* image = IMG_Load( filename. c_str() );40 SDL_Surface* image = IMG_Load( filename.data() ); 41 41 if (!image) 42 42 { 43 NV_LOG( LOG_ERROR, "Image file " << filename .c_str()<< " not found!" );43 NV_LOG( LOG_ERROR, "Image file " << filename << " not found!" ); 44 44 return nullptr; 45 45 } … … 254 254 } 255 255 256 bool nv::gl_device::compile( gl_program_info* p, const string& vertex_program, const string&fragment_program )256 bool nv::gl_device::compile( gl_program_info* p, string_ref vertex_program, string_ref fragment_program ) 257 257 { 258 258 if (!compile( GL_VERTEX_SHADER, vertex_program, p->glidv )) { return false; } … … 397 397 } 398 398 399 bool nv::gl_device::compile( uint32 sh_type, const std::string&shader_code, unsigned& glid )399 bool nv::gl_device::compile( uint32 sh_type, string_ref shader_code, unsigned& glid ) 400 400 { 401 401 glid = glCreateShader( sh_type ); 402 402 403 const char* pc = shader_code.c_str(); 404 405 glShaderSource( glid, 1, &pc, 0 ); 403 const char* pc = shader_code.data(); 404 int l = shader_code.length(); 405 406 glShaderSource( glid, 1, &pc, &l ); 406 407 glCompileShader( glid ); 407 408
Note: See TracChangeset
for help on using the changeset viewer.