<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>993</bug_id>
          
          <creation_ts>2014-03-05 23:26:11 +0100</creation_ts>
          <short_desc>Make JOGL&apos;s tracking information public</short_desc>
          <delta_ts>2014-07-10 14:36:20 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>opengl</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="PJDM">pjd.mayne+jogl</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3829</commentid>
    <comment_count>0</comment_count>
    <who name="PJDM">pjd.mayne+jogl</who>
    <bug_when>2014-03-05 23:26:11 +0100</bug_when>
    <thetext>JOGL internally tracks buffer targets. Please make this information public, it would (hopefully) make debugging buffer usage much easier.

(See discussion at http://forum.jogamp.org/Detecting-memory-leaks-td4031771.html.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4020</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-07-10 14:36:20 +0200</bug_when>
    <thetext>&apos;gl.getBoundBuffer(target)&apos; lets you query the buffer bound to a specific 
target.

&apos;gl.getBufferStorage(int bufferName)&apos; gives you the GLBufferStorage 
as created via &apos;gl.glBufferData(..)&apos; or &apos;gl.glNamedBufferDataEXT(..)&apos;,
see GLBufferStorage API documentation!

Further more, GLBufferStorage.getMappedBuffer()
gives you a mapped NIO buffer for that storage as mapped
via &apos;gl.glMapBufferRange(..)&apos; etc.

Summary:
=========

So what object states do we track currently:
  - object -&gt; target binding
  - GLBufferStorage of object-name w/ storage created
  - GLBufferStorage&apos;s mapped NIO buffer

what do we _not_ track:
  - buffer-names which are not bound to target
  - GLBufferStorage of object-name w/o storage created

so one could ask whether a buffer-name has a storage created,
simply by &apos;null != gl.getBufferStorage(bufferName)&apos;, etc.

Bug closed. 

+++++

In GLBase you have:

++++++++++++++++++++++++++

   /**
    * @param target a GL buffer (VBO) target as used in {@link GL#glBindBuffer(int, int)}, ie {@link GL#GL_ELEMENT_ARRAY_BUFFER}, {@link GL#GL_ARRAY_BUFFER}, ..
    * @return the GL buffer name bound to a target via {@link GL#glBindBuffer(int, int)} or 0 if unbound.
    * @see #getBufferStorage(int)
    */
   public int getBoundBuffer(int target);

   /**
    * @param bufferName a GL buffer name, generated with e.g. {@link GL#glGenBuffers(int, int[], int)} and used in {@link GL#glBindBuffer(int, int)}, {@link GL#glBufferData(int, long, java.nio.Buffer, int)} or {@link GL2#glNamedBufferDataEXT(int, long, java.nio.Buffer, int)}.
    * @return the size of the given GL buffer storage, see {@link GLBufferStorage}
    * @see #getBoundBuffer(int)
    */
   public GLBufferStorage getBufferStorage(int bufferName);

++++++++++++++++++++++++++

.. further more, you have:

++++++++++++++++++++++++++

   /**
    * @return true if a VBO is bound to {@link GL#GL_ARRAY_BUFFER} via {@link GL#glBindBuffer(int, int)}, otherwise false
    */
   public boolean isVBOArrayBound();

   /**
    * @return true if a VBO is bound to {@link GL#GL_ELEMENT_ARRAY_BUFFER} via {@link GL#glBindBuffer(int, int)}, otherwise false
    */
   public boolean isVBOElementArrayBound();

++++++++++++++++++++++++++</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>