tglee

Member
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

104 Neutral

About tglee

  • Rank
    Newbie

Personal Information

  1. OpenGL OpenGL for Linux and MacOSX?

    On CentOS/RHEL, you're probably after the [b]mesa-libGL-devel[/b] package. http://rpm.pbone.net/index.php3/stat/4/idpl/17834939/dir/centos_5/com/mesa-libGL-devel-6.5.1-7.10.el5.i386.rpm.html
  2. After nailing the move to the US, I've managed to forget to renew my personal domain. It's all gummed up with @godaddy ickiness. :( #failing
  3. hey @nrcantor -- secure APT for @newrelic was released to production yesterday. Let us know if you hit any more roadblocks.
  4. [quote name='Yours3!f' timestamp='1320874350' post='4882283']Hi, this will be exotic I'm trying to load an external text file from javascript, so that I can load it as a shader later. The file is loaded successfully, however when I try to access its contents I can't. I checked with firebug if it is loaded properly, and it was. When I try to access its content by using this: [code] function load_external_script(filename, type) { var script = document.createElement('script'); script.type = type; script.src = filename; script.setAttribute('id', filename); head.appendChild(script); } function getShader(gl, id) { var shaderScript = document.getElementById(id); if (!shaderScript) { return null; } var str = shaderScript.text; ... } load_external_script('vertex.vs', 'text/plain'); var fragmentShader = getShader(gl, "vertex.vs"); [/code] the str = ... line triggers an unexpected EOF error, and I checked: both text and innerHTML properties are empty despite the content is there... any ideas how can I get it? or is there another way of loading shaders from external source? I took the basic source from [url="http://learningwebgl.com/blog/?p=28"]http://learningwebgl.com/blog/?p=28[/url] here's the uploaded file: [url="https://docs.google.com/open?id=0BzHTUfIQ-XD8ZjFmYWM0NzQtM2MyMS00ZjM3LWFmNTItZjBjNDM5ZDcwNDhk"]link[/url] Best regards, Yours3!f [/quote] Easy: use AJAX! XMLHttpRequest.responseText will give you direct access to the source of a shader. (Alternatively you can use the nicer JQuery or Prototype equivalents). Problem is you'll want to process the response asynchronously, which may complicate your initialization a little.