Index: trunk/src/gl/gl_device.cc
===================================================================
--- trunk/src/gl/gl_device.cc	(revision 351)
+++ trunk/src/gl/gl_device.cc	(revision 361)
@@ -22,5 +22,5 @@
 }
 
-program gl_device::create_program( const string& vs_source, const string& fs_source )
+program gl_device::create_program( string_ref vs_source, string_ref fs_source )
 {
 	program result = m_programs.create();
@@ -35,11 +35,11 @@
 // this is a temporary function that will be removed once we find a way to 
 // pass binary file data around
-image_data* gl_device::create_image_data( const std::string& filename )
+image_data* gl_device::create_image_data( string_ref filename )
 {
 	load_sdl_image_library();
-	SDL_Surface* image = IMG_Load( filename.c_str() );
+	SDL_Surface* image = IMG_Load( filename.data() );
 	if (!image)
 	{
-		NV_LOG( LOG_ERROR, "Image file " << filename.c_str() << " not found!" );
+		NV_LOG( LOG_ERROR, "Image file " << filename << " not found!" );
 		return nullptr;
 	}
@@ -254,5 +254,5 @@
 }
 
-bool nv::gl_device::compile( gl_program_info* p, const string& vertex_program, const string& fragment_program )
+bool nv::gl_device::compile( gl_program_info* p, string_ref vertex_program, string_ref fragment_program )
 {
 	if (!compile( GL_VERTEX_SHADER,   vertex_program, p->glidv ))   { return false; }
@@ -397,11 +397,12 @@
 }
 
-bool nv::gl_device::compile( uint32 sh_type, const std::string& shader_code, unsigned& glid )
+bool nv::gl_device::compile( uint32 sh_type, string_ref shader_code, unsigned& glid )
 {
 	glid = glCreateShader( sh_type );
 
-	const char* pc = shader_code.c_str();
-
-	glShaderSource( glid,   1, &pc, 0 );
+	const char* pc = shader_code.data();
+	int l = shader_code.length();
+
+	glShaderSource( glid, 1, &pc, &l );
 	glCompileShader( glid );
 
