From: Michael Brooks Date: 2009-03-10T14:38:08+09:00 Subject: Re: Ruby OpenGL Gears example that uses shiny and velvet GLSL shaders Hello Matthias (again): > Hello Matthias > >> One question though: >> >>> def get_shader_source(file_name)揃 >>> # Read all the text from the file and return it in the >>> file_content variable. >>> file_content = '' >>> File.open(file_name) do |file| >>> while file_line = file.gets() >>> file_content += file_line >>> end >>> end >>> return(file_content) >>> end >> >> You know there is File.read, right? >> >> -Matthias > > Actually I didn't give it much thought... that was the least of my > worries in making the demo program :) However, I appreciate you taking > the time to mention it. I'll investigate and update the code to use > File#read instead. > > Michael I just changed the code to use the File#read and re-posted it. I feel silly for doing it the way I originally did. I cut-and-paste some code from another program and didn't think to look for a better Ruby way. Thanks for pointing out the area for improvement. On another topic, what kind of performance / fps are you getting? My past experience has been that Nvidia has better OpenGL drivers than ATI. Michael