1. ------------------------------------------------------------------------- 
  2.  --  GL.Geometry - GL vertex buffer Object 
  3.  -- 
  4.  --  Copyright (c) Rod Kay 2007 
  5.  --  AUSTRALIA 
  6.  --  Permission granted to use this software, without any warranty, 
  7.  --  for any purpose, provided this copyright note remains attached 
  8.  --  and unmodified if sources are distributed further. 
  9.  ------------------------------------------------------------------------- 
  10.  
  11. --  with GL.Geometry; 
  12. --  with GL.Textures; 
  13.  
  14. package GL.Buffer is 
  15.  
  16.    subtype vbo_Name is GL.Uint;     -- an openGL vertex buffer 'name', which is a natural integer. 
  17.  
  18.    -- buffer object 
  19.    -- 
  20.    type Object is abstract tagged private; 
  21.  
  22.    procedure Enable  (Self  :        Object'Class); 
  23.    procedure Destroy (Self  : in out Object'Class); 
  24.  
  25.    function Extract_VBO_Target (Self : Object) return GL.VBO_Target is abstract; 
  26.  
  27.    -- 'array' and 'element array' base classes 
  28.    -- 
  29.  
  30.    type array_Object         is new Object with private; 
  31.    type element_array_Object is new Object with private; 
  32.  
  33.    -- refer to child packages, for specific buffers: 
  34.    -- 
  35.    -- - GL.Buffer.vertex 
  36.    -- - GL.Buffer.texture_coords 
  37.    -- - GL.Buffer.normals 
  38.    -- - GL.Buffer.indices 
  39.    -- 
  40.    -- (tbd : pixel pack/unpack buffers) 
  41.  
  42.    no_platform_Support  : exception; 
  43.    -- 
  44.    -- raised by buffer 'Map' functions when OS platform does not support GL Buffer objects. 
  45.  
  46. private 
  47.  
  48.    type Object is abstract tagged 
  49.       record 
  50.          Name    : aliased vbo_Name := 0; 
  51.          Length  :         Positive; 
  52.       end record; 
  53.  
  54.    overriding function Extract_VBO_Target (Self : array_Object)         return GL.VBO_Target; 
  55.    overriding function Extract_VBO_Target (Self : element_array_Object) return GL.VBO_Target; 
  56.  
  57.    type array_Object         is new Object with null record; 
  58.    type element_array_Object is new Object with null record; 
  59.  
  60.    type vertex_buffer_Object is new array_Object with null record; 
  61.  
  62.    -- support 
  63.  
  64.    procedure Verify_Name (Self  : in out Object'Class); 
  65.  
  66. end GL.Buffer;