loading shader

Aug 9, 2013 at 7:19 PM
Hey,

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.CompileShader(handle);
            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 1:03 PM
Hi,

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 :) )
Coordinator
Aug 12, 2013 at 10: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 :)