コード例 #1
0
        public void shaderSource(WebGLShader shader, string source)
        {
#if _DEBUG
            Log.Info(string.Format("shaderSource {0}, source length {1}", shader.Value, source.Length));
#endif
            var bytes = Encoding.ASCII.GetBytes(source);
            var len   = bytes.Length;

            unsafe
            {
                fixed(byte *b = &bytes[0])
                {
                    byte *[] barray = new byte *[] { b };
                    fixed(byte **pb = &barray[0])
                    {
#if GLEW_STATIC
                        Gl.glShaderSource(shader.Value, 1, pb, &len);
#else
                        Gl.__glewShaderSource(shader.Value, 1, pb, &len);
#endif
                    }
                }
            }

            this.ErrorTest();
        }