{"action":"opened","issue":{"url":"https://api.github.com/repos/opentk/opentk/issues/491","repository_url":"https://api.github.com/repos/opentk/opentk","labels_url":"https://api.github.com/repos/opentk/opentk/issues/491/labels{/name}","comments_url":"https://api.github.com/repos/opentk/opentk/issues/491/comments","events_url":"https://api.github.com/repos/opentk/opentk/issues/491/events","html_url":"https://github.com/opentk/opentk/issues/491","id":210717313,"number":491,"title":"WPF/OpenTK. I cannot load shaders from files","user":{"login":"8Observer8","id":3908473,"avatar_url":"https://avatars.githubusercontent.com/u/3908473?v=3","gravatar_id":"","url":"https://api.github.com/users/8Observer8","html_url":"https://github.com/8Observer8","followers_url":"https://api.github.com/users/8Observer8/followers","following_url":"https://api.github.com/users/8Observer8/following{/other_user}","gists_url":"https://api.github.com/users/8Observer8/gists{/gist_id}","starred_url":"https://api.github.com/users/8Observer8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/8Observer8/subscriptions","organizations_url":"https://api.github.com/users/8Observer8/orgs","repos_url":"https://api.github.com/users/8Observer8/repos","events_url":"https://api.github.com/users/8Observer8/events{/privacy}","received_events_url":"https://api.github.com/users/8Observer8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-28T08:22:12Z","updated_at":"2017-02-28T08:22:12Z","closed_at":null,"body":"Hello,\r\n\r\nThis version of my program work perfect. It gets shaders from strings:\r\n\r\n```\r\n        string vShaderSource =\r\n            \"#version 330\\n\" +\r\n            \"in vec4 a_Position;\\n\" +\r\n            \"void main() {\\n\" +\r\n            \"gl_Position = a_Position;\\n\" +\r\n            \"}\\n\";\r\n        string fShaderSource =\r\n            \"#version 330\\n\" +\r\n            \"out vec4 outColor;\\n\" +\r\n            \"void main() {\\n\" +\r\n            \"outColor = vec4(1.0, 0.0, 0.0, 1.0);\\n\" +\r\n            \"}\\n\";```\r\n\r\n[Screenshot](https://dl.dropboxusercontent.com/s/ri5rqu10slhhu7n/Triangle_SetBackgroundColor.png)\r\nDownload the Project: [Triangle_StringShaders.zip](https://dl.dropboxusercontent.com/s/u5zc4jpejge9j0t/Triangle_StringShaders.zip)\r\n\r\nBut when I want to load shaders from files I receive the error, [see shreenshot](https://dl.dropboxusercontent.com/s/ab6dcnhx3nnawzc/Triangle_FileShaderError.png)\r\n\r\nDownload the Project: [Triangle_FileShaderError.zip](https://dl.dropboxusercontent.com/s/07tcnpsaockm7te/Triangle_FileShaderError.zip)\r\n\r\n```\r\n        string vShaderSource = null;\r\n        string fShaderSource = null;\r\n\r\n        // ...\r\n\r\n        private void renderCanvas_Load(object sender, EventArgs e)\r\n        {\r\n            // ...\r\n\r\n            // Load shaders from files\r\n            LoadShader(\"./Shaders/vShader.glsl\", out vShaderSource);\r\n            LoadShader(\"./Shaders/fShader.glsl\", out fShaderSource);\r\n            if (vShaderSource == null || fShaderSource == null)\r\n            {\r\n                File.AppendAllText(infoFileName, \"Failed to load shaders from files\");\r\n                return;\r\n            }\r\n\r\n            // ...\r\n        }\r\n\r\n        private void LoadShader(string fileName, out string shaderSource)\r\n        {\r\n            shaderSource = null;\r\n\r\n            using (StreamReader sr = new StreamReader(fileName))\r\n            {\r\n                shaderSource = sr.ReadToEnd();\r\n            }\r\n        }\r\n```\r\n"}}
{"actor":{"display_login":"8Observer8"}}