{"action":"created","issue":{"url":"https://api.github.com/repos/flyx/OpenGLAda/issues/17","repository_url":"https://api.github.com/repos/flyx/OpenGLAda","labels_url":"https://api.github.com/repos/flyx/OpenGLAda/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/flyx/OpenGLAda/issues/17/comments","events_url":"https://api.github.com/repos/flyx/OpenGLAda/issues/17/events","html_url":"https://github.com/flyx/OpenGLAda/issues/17","id":193703451,"number":17,"title":"Problem extracting elements from Shaders.Lists.List lists due to discriminated list elements","user":{"login":"rogermc2","id":12540410,"avatar_url":"https://avatars.githubusercontent.com/u/12540410?v=3","gravatar_id":"","url":"https://api.github.com/users/rogermc2","html_url":"https://github.com/rogermc2","followers_url":"https://api.github.com/users/rogermc2/followers","following_url":"https://api.github.com/users/rogermc2/following{/other_user}","gists_url":"https://api.github.com/users/rogermc2/gists{/gist_id}","starred_url":"https://api.github.com/users/rogermc2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogermc2/subscriptions","organizations_url":"https://api.github.com/users/rogermc2/orgs","repos_url":"https://api.github.com/users/rogermc2/repos","events_url":"https://api.github.com/users/rogermc2/events{/privacy}","received_events_url":"https://api.github.com/users/rogermc2/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-12-06T07:41:45Z","updated_at":"2016-12-07T23:27:43Z","closed_at":"2016-12-06T19:09:29Z","body":"The program builds OK but fails when run with:\r\nLoad_Buffer returned constraint error: raised CONSTRAINT_ERROR : gl-objects-shaders.adb:50 length check failed\r\nThis occurs only when I include\r\n Utilities.Show_All_Shader_Program_Data(Shader_Program);\r\nat the end of the Load_Buffer procedure which builds the shader program then draws the main window.\r\n Utilities.Show_All_Shader_Program_Data(Shader_Program) runs after I close the main window.\r\n\r\nI've cut much out of the Show_All_Shader_Program_Data procedure to simplify debugging.\r\nThe program runs OK to completion when I delete \r\nShader_Source : String := Shaders.Source(Shaders.Lists.Element(List_Cursor));\r\nwhich I hoped to use to get the current shader's Shader_Type and also seemed (to me so far) to be the simplest way to demonstrate the problem.\r\n\r\nprocedure Show_All_Shader_Program_Data(aProgram : gl.Objects.Programs.Program) is\r\n        use GL.Objects;\r\n        Shaders_List     : Shaders.Lists.List := Programs.Attached_Shaders(aProgram);\r\n        List_Cursor        : Shaders.Lists.Cursor := Shaders_List.First;\r\n        Shader_Source : String := Shaders.Source(Shaders.Lists.Element(List_Cursor));\r\n    begin\r\n        Put_Line(\"GL_ATTACHED_SHADERS: \");\r\n        while Shaders.Lists.Has_Next(List_Cursor) loop\r\n            List_Cursor := Shaders.Lists.Next(List_Cursor);\r\n         end loop;\r\n    exception\r\n      when anError : Constraint_Error =>\r\n         Put(\"Show_All_Shader_Program_Data returned constraint error: \");\r\n         Put_Line(Exception_Information(anError));\r\n      when anError : GL.Errors.Invalid_Operation_Error =>\r\n         Put_Line(\"Show_All_Shader_Program_Data returned an invalid operation error: \");\r\n         Put_Line(Exception_Information(anError));\r\n      when anError :  others =>\r\n         Put_Line(\"An exceptiom occurred in Show_All_Shader_Program_Data.\");\r\n         Put_Line(Exception_Information(anError));         \r\n    end Show_All_Shader_Program_Data;\r\n\r\nI'm surprised the problem doesn't raise a Show_All_Shader_Program_Data exception?\r\nI actually want to print out the  Attached_Shaders list but can't see how to process out the different type of shaders.\r\n\r\nIs this enough or do you need the complete Load_Buffer procedure?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/flyx/OpenGLAda/issues/comments/265606736","html_url":"https://github.com/flyx/OpenGLAda/issues/17#issuecomment-265606736","issue_url":"https://api.github.com/repos/flyx/OpenGLAda/issues/17","id":265606736,"user":{"login":"rogermc2","id":12540410,"avatar_url":"https://avatars.githubusercontent.com/u/12540410?v=3","gravatar_id":"","url":"https://api.github.com/users/rogermc2","html_url":"https://github.com/rogermc2","followers_url":"https://api.github.com/users/rogermc2/followers","following_url":"https://api.github.com/users/rogermc2/following{/other_user}","gists_url":"https://api.github.com/users/rogermc2/gists{/gist_id}","starred_url":"https://api.github.com/users/rogermc2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogermc2/subscriptions","organizations_url":"https://api.github.com/users/rogermc2/orgs","repos_url":"https://api.github.com/users/rogermc2/repos","events_url":"https://api.github.com/users/rogermc2/events{/privacy}","received_events_url":"https://api.github.com/users/rogermc2/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T23:27:43Z","updated_at":"2016-12-07T23:27:43Z","body":"Thanks alkhimey.\r\nI added --create-missing-dirs to my GPS Build targets.\r\nTesting showed that a missing bin directory was generated."}}
{"actor":{"display_login":"rogermc2"}}