<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: JS: loading textures on start up</title>
		<atom:link href="http://cycling74.com/forums/topic/js-loading-textures-on-start-up/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/js-loading-textures-on-start-up/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 05:05:56 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/js-loading-textures-on-start-up/#post-29521</guid>
					<title><![CDATA[JS: loading textures on start up]]></title>
					<link>http://cycling74.com/forums/topic/js-loading-textures-on-start-up/#post-29521</link>
					<pubDate>Sat, 06 Jan 2007 14:03:25 +0000</pubDate>
					<dc:creator>Matthew Aidekman</dc:creator>

					<description>
						<![CDATA[
						<p>ok&#8230;.. last one(I hope.)  I&#8217;m trying very hard to follow the  <br />
documentation here.  I hope this isn&#8217;t something stupid because I  <br />
really feel bad asking for so much help.</p>
<p>the problem here, is that it takes 3 tries to get a texture loaded in  <br />
jit.js.  in max it appears that jit.gl.texture makes max wait until  <br />
its done loading the file.  but in javascript, it lets JS executing  <br />
the code.    any work arounds for this?</p>
<p>
///////////////////////////MAX<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P message 196 67 48 196617 loadbang;<br />
#P user jit.pwindow 195 186 82 62 0 1 0 0 1 0;<br />
#X name zoe;<br />
#P newex 196 102 88 196617 js testTexture.js;<br />
#P window linecount 9;<br />
#P user com 300 190 264 196617 78;<br />
#K set 0 26990 29556 29301 25460 26991 28275 14880 3341 28001 27493  <br />
8307 30066 25888 29800 25888 26989 24935 25888 28769 29800 8297 28192  <br />
29800 25888 27233 30305 29539 29289 28788 8297 29472 24864 30305  <br />
27753 25632 28526 25869 29285 29556 24946 29728 28001 30733 27759  <br />
24932 8308 26729 29472 28769 29795 26637 26729 29728 27759 24932  <br />
25185 28263 3432 26996 8300 28513 25698 24942 26400 24935 24937 28173  <br />
25448 25955 27424 29800 25888 28001 30752 30569 28260 28535 3328;<br />
#K end;<br />
#P connect 3 0 1 0;<br />
#P window clipboard copycount 4;</p>
<p>
////////////////NAME THIS  testTexture.js<br />
autowatch=1;</p>
<p>var changeMeToAValidImagePath =  &#8220;moooooooo&#8221;<br />
var myrender = null;<br />
var dirtTexture =null<br />
var background = null<br />
var myrender = new JitterObject(&#8220;jit.gl.render&#8221;,&#8221;zoe&#8221;);</p>
<p>function loadbang()<br />
	{<br />
	post(&#8220;begin loadbang&#8211;n&#8221;);<br />
	dirtTexture = new JitterObject(&#8220;jit.gl.texture&#8221;,&#8221;zoe&#8221;)<br />
	dirtTexture.name = &#8220;dirt&#8221;<br />
	dirtTexture.file = changeMeToAValidImagePath<br />
	post(&#8220;dirtTexture.dim AFTER dirtTexture.file  <br />
assignment:   ,&#8221;,dirtTexture.dim,&#8221;n&#8221;);</p>
<p>
	background = new JitterObject(&#8220;jit.gl.gridshape&#8221;,&#8221;zoe&#8221;)<br />
	background.shape = &#8220;plane&#8221;<br />
	background.texture = &#8220;dirt&#8221;;</p>
<p>
	draw();<br />
	}</p>
<p>function draw()<br />
{<br />
myrender.erase();<br />
myrender.drawclients();<br />
myrender.swap();<br />
}</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

