Skip to content

Commit be4189c

Browse files
committed
make Program's Attached_Shaders not own their IDs
1 parent 1c65c4a commit be4189c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/gl/implementation/gl-objects-shaders.adb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ package body GL.Objects.Shaders is
9696
API.Get_Shader_Type (Id, Enums.Shader_Type, Kind);
9797
Raise_Exception_On_OpenGL_Error;
9898
return Object : Shader (Kind) do
99-
Object.Set_Raw_Id (Id);
99+
Object.Set_Raw_Id (Id, False);
100100
end return;
101101
end Create_From_Id;
102102

src/gl/interface/gl-objects-shaders.ads

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ package GL.Objects.Shaders is
2222

2323
function Info_Log (Subject : Shader) return String;
2424

25-
-- low-level
25+
-- low-level. creates a Shader object linking to the given OpenGL ID.
26+
-- doesn't take ownership of the ID and therefore doesn't automatically
27+
-- delete it when the last reference vanishes.
2628
function Create_From_Id (Id : UInt) return Shader;
2729
private
2830
type Shader (Kind : Shader_Type) is new GL_Object with null record;

0 commit comments

Comments
 (0)