<?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>200</bug_id>
          
          <creation_ts>2006-02-02 03:11:56 +0100</creation_ts>
          <short_desc>Need better exceptions / errors when using allocated buffers</short_desc>
          <delta_ts>2010-03-24 07:48:25 +0100</delta_ts>
          <reporter_accessible>0</reporter_accessible>
          <cclist_accessible>0</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</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>216</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:48:25 +0100</bug_when>
    <thetext>


---- Reported by krazykatz 2006-02-02 15:11:56 ----

Many jogl methods take nio.Buffer&apos;s as parameters, but unless the user created
the buffer using Buffer.wrap(...) the method call will typically fail, with a
often cryptic error (i.e. Buffer Underflow exception)  Jogl methods should
except either arrays or Buffers depending on which gives better performance, and
should not give the developer the option.  If buffers are better then it should
be clearly documented that they must always be created using wrap(), and
appropriate error messages / exceptions should be put in place for the developer.

Found in gl.glGenTextures; gl.glDrawPixels; glu.gluScaleImage; gl.glVertex3fv



---- Additional Comments From kbr 2006-02-03 00:24:58 ----

From the description these problems are caused by user error. The position of
all Buffers is significant as is described in the overview Javadoc for JSR-231
in the section marked &quot;auto-slicing of buffers&quot;. The problem is that e.g.
ByteBuffer.put() was used to store data in the Buffer but rewind() was not
called on it before passing it to the various APIs. Both Buffers created via
wrap() as well as direct buffers are valid for all APIs except where direct
Buffers are mandatory. Because this is already documented and valid exceptions
are being thrown in the various areas, closing this as not a bug.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:48 EDT  ---

This bug was previously known as _bug_ 200 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=200
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>