This project is read-only.

loading shader

Aug 9, 2013 at 8:19 PM

i tried a little bit with sharpgl and loaded a vertex + fragment shader but nothing happens, i'm new in opengl so be patient.
StreamReader vertexShader = new StreamReader("vertex.vert");
            String vert = vertexShader.ReadToEnd();
            String[] vertex = new String[vert.Length];
            for (int i = 0; i < vert.Length; i++)
                vertex[i] = vert[i].ToString();

            programID = gl.CreateProgram();
            handle = gl.CreateShader(OpenGL.GL_VERTEX_PROGRAM_ARB);
            gl.ShaderSource(handle, 2, vertex, null);
            gl.AttachShader(programID, handle);
is it all okay? i made it with a opengl tutorial. I hope someone can help me.

At least sorry if my english is bad but i'm german and learned english just in school :D
Aug 11, 2013 at 2:03 PM

do you need the Shader in OpenGLControl or is it possible for to use SharpGL.SceneControl? I am using it with SceneControl and can post some sample code here ...

(if easier with german send me message ... i am german too :) )
Aug 12, 2013 at 11:12 AM
Try taking a look at the Shader class in the SharpGL code itself - it can help you out with tasks like this, or at least guide you on how to do it yourself :)