<?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>110</bug_id>
          
          <creation_ts>2004-09-27 09:30:35 +0200</creation_ts>
          <short_desc>NativeLibLoader should have a flag for loading the library</short_desc>
          <delta_ts>2015-09-27 03:14:51 +0200</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>FIXED</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>FEATURE</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>126</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:46:56 +0100</bug_when>
    <thetext>


---- Reported by s_koehler 2004-09-27 09:30:35 ----

Hi,

in java, you can easily load libraries from different places by using
System.load() instead of System.loadLibrary(). The problem is, that JOGL always
calls System.loadLibrary(&quot;jogl&quot;), but i&apos;d like to load the jogl library
manualle, so that i can extract it from a JAR first etc.

The needed changes are simple.
Please extend NativeLibLoad with a method to set the AUTOLOAD-flag. The flag may
be true by default. Move the code from the static Constructor to the
load()-method, and make the load-method check the AUTOLOAD-flag.



---- Additional Comments From s_koehler 2005-02-11 19:19:28 ----

Here&apos;s a Version of NativeLibLoader, that should work, since the load() Method
is called by all static-constructors of the classes that need the jogl native
library.

package net.java.games.jogl.impl;

public class NativeLibLoader
{
	private static volatile boolean DO_LOADING = true;
	private static boolean DONE_LOADING = false;

	public static void disableLoading()
	{
		DO_LOADING = false;
	}

	public static void enableLoading()
	{
		DO_LOADING = true;
	}

	public static synchronized void load()
	{
		if (DO_LOADING &amp;&amp; !DONE_LOADING)
		{
			System.loadLibrary(&quot;jogl&quot;);
			DONE_LOADING = true;
		}
	}
}

The line System.loadLibraray(&quot;jogl&quot;); is to be replaced by the more complex code
that is currently in the static constructor of the class NativeLibLoader. 



---- Additional Comments From kbr 2005-02-12 11:46:46 ----

Thanks for the patch. I&apos;ve applied it and the changes (the new methods
NativeLibLoader.disableLoading() and NativeLibLoader.enableLoading()) will be
present in 1.1 b09. Note that these are methods in the &quot;implementation&quot; so they
might change in a future release.




---- Additional Comments From s_koehler 2005-02-12 12:34:05 ----

Thank you. I was aware of the fact that the NativeLibLoader is in the &quot;impl&quot;
package, and therefor things may change. One may think of a more official way to
disable/change the loading of the jogl library, but the current sollution is OK
for me.



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

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

    </bug>

</bugzilla>