<?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: lua questions</title>
		<atom:link href="http://cycling74.com/forums/topic/lua-questions/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/lua-questions/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 15:57:55 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-35172</guid>
					<title><![CDATA[lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-35172</link>
					<pubDate>Tue, 01 Jan 2008 22:58:23 +0000</pubDate>
					<dc:creator>yair reshef</dc:creator>

					<description>
						<![CDATA[
						<p>hi, all (err&#8230; wesly)<br />
i have been doing some lua coding on an xp machine.</p>
<p>i have a few questions,<br />
1. something strange about the screentoworld routine, when z is set to 0. or<br />
1. i get unusable results. when at 0.95 its almost there, why?<br />
2. i use display lists, is that good? were do i plug the gl states in that<br />
situation. i want blend effects. i commented the lines i think i need.<br />
3. when i enter fullscreen i lose the drawing.</p>
<p>thanks , it&#8217;s fun coding in lua. and i feel can tackle some of nehe&#8217;s opengl<br />
tutorial with it.<br />
posting on the list so i hope it will not break in the forum.</p>
<p>autowatch = 1<br />
print(&#8220;compiled&#8221;)<br />
render_context = this.drawto<br />
angle=0<br />
mouseXY={0,0}<br />
dir=1</p>
<p>function BuildLists()</p>
<p>    box = gl.GenLists(2)<br />
    gl.NewList(box    ,&#8221;COMPILE&#8221;);<br />
        gl.Begin(&#8220;QUADS&#8221;)<br />
            gl.Vertex (-0.5 , 0.5 , 0. )                &#8212; Top Left<br />
            gl.Vertex ( 0.5 , 0.5 , 0. )                &#8212; Top Right<br />
            gl.Vertex ( 0.5 ,-0.5 , 0. )            &#8212; Bottom Right<br />
            gl.Vertex (-0.5 ,-0.5 , 0. )<br />
        gl.End();<br />
    gl.EndList()<br />
end<br />
function init()<br />
&#8211;initialize the dispaly list<br />
    BuildLists()<br />
end<br />
init()</p>
<p>function draw()<br />
    gl.Clear(&#8220;COLOR_BUFFER_BIT&#8221; , &#8220;DEPTH_BUFFER_BIT&#8221;)<br />
    &#8211;gl.LoadIdentity()<br />
    &#8211;gl.Enable(&#8220;BLEND&#8221;)<br />
    &#8211;gl.BlendFunc(1,6)<br />
    &#8211;gl.ClearColor(1,1,0,1)<br />
    rot()<br />
    for i=0,1000 do<br />
    gl.Translate(mouseXY[1],mouseXY[2],(i/1000)-1);<br />
    gl.Rotate(angle,0,0,1)<br />
    gl.Color(i/1000, math.random(), 1, i/1000)<br />
    gl.CallList(box)<br />
    end</p>
<p>end</p>
<p>function rot()<br />
    angle = angle+dir<br />
    if angle==15 then dir= -0.5<br />
    elseif angle==0 then dir=0.5<br />
    end<br />
end</p>
<p>&#8211;create the listener callback function<br />
function callback(event)<br />
    if(event.eventname == &#8220;mouseidle&#8221;) then<br />
        local _glXmouse = event.args[1]<br />
        local _glYmouse = event.args[2]<br />
        &#8211;need to transform mouse ccordinates to world domain<br />
        &#8211;dono why, but 0.95 needed<br />
        mouseXY=jit.gl.screentoworld({_glXmouse,_glYmouse, 0.95})<br />
    end<br />
end</p>
<p>&#8211;create a listener object<br />
listener = jit.listener(render_context, &#8220;callback&#8221;)</p>
<p>++++++++++++++++++<br />
patch<br />
++++++++++++++++<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 22 154 311 9109513 jit.gl.lua nehe @file nehe1_displaylist.lua<br />
@autogarbage 1 @autowatch 1;<br />
#P toggle 123 71 15 0;<br />
#P message 123 91 68 9109513 fullscreen $1;<br />
#N vpatcher 30 89 166 253;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P newex 50 71 35 9109513 sel 27;<br />
#P newex 50 50 40 9109513 key;<br />
#P outlet 50 93 15 0;<br />
#P connect 1 0 2 0;<br />
#P connect 2 0 0 0;<br />
#P pop;<br />
#P newobj 123 51 33 9109513 p Esc;<br />
#P newex 123 109 70 9109513 jit.window nehe;<br />
#P toggle 21 45 15 0;<br />
#P newex 21 64 57 9109513 qmetro 30;<br />
#P newex 21 85 50 9109513 t b erase;<br />
#P newex 21 111 77 9109513 jit.gl.render nehe;<br />
#P connect 6 0 4 0;<br />
#P connect 7 0 6 0;<br />
#P connect 5 0 7 0;<br />
#P fasten 1 0 0 0 26 106 26 106;<br />
#P fasten 1 1 0 0 66 106 26 106;<br />
#P connect 2 0 1 0;<br />
#P connect 3 0 2 0;<br />
#P window clipboard copycount 9;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119502</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119502</link>
					<pubDate>Wed, 02 Jan 2008 03:24:06 +0000</pubDate>
					<dc:creator>Wesley Smith</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Yair,<br />
Welcome to Lua land.  I dig the feedback spiral.  The screentoworld<br />
function is basically doing gluUnproject.  See the doc here:</p>
<p><a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/gluUnProject.3.html" rel="nofollow">http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/gluUnProject.3.html</a></p>
<p>The 0 for Z depth in window coordinates is mapped to the near clip<br />
plane value and 1 to the far clip value.  Z depth is non-linear and<br />
thus annoyingly not intuitive to our typical sense of parameter values<br />
mapping to euclidean coordinates.</p>
<p>As for displaylists, these things have to be created when there is a<br />
valid context and _must_ be rebuilt when that context changes like<br />
when you go fullscreen.  In jit.gl.lua, there are a few functions<br />
defined to notify a script of things like context changes or scripts<br />
loading happen. These are:</p>
<p>script_load<br />
dest_changed<br />
dest_closing<br />
etc.<br />
see the PDF doc for a complete list</p>
<p>So, to properly handle displaylists, You need to create it whenever<br />
the context changes or your script reloads with a valid context.<br />
jit.gl.lua has an attr called context which is 0 when there is no<br />
valid context and non-zero when there is a valid context (it is also<br />
unique per-context).</p>
<p>Here&#8217;s a slight mod I made to your script (full script is further<br />
below) using some of the nice aspects of having functions as<br />
variables:</p>
<p>&#8211; functions as variables!<br />
function setOnReloadOrDestChanged(func)<br />
	script_load = func<br />
	det_changed = func<br />
end<br />
setOnReloadOrDestChanged(init)</p>
<p>&#8211;[[<br />
This section is equivalent to the above</p>
<p>function script_load()<br />
	init()<br />
end</p>
<p>function dest_changed()<br />
	init()<br />
end<br />
--]]</p>
<p>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<br />
Full script<br />
+++++++++++++++++++++++++++++++++++++++++++++++++++++++<br />
 autowatch = 1<br />
print(&#8220;compiled&#8221;)<br />
render_context = this.drawto<br />
angle=0<br />
mouseXY={0,0}<br />
dir=1</p>
<p>function BuildLists()</p>
<p>    box = gl.GenLists(2)<br />
    gl.NewList(box    ,&#8221;COMPILE&#8221;);<br />
        gl.Begin(&#8220;QUADS&#8221;)<br />
            gl.Vertex (-0.5 , 0.5 , 0. )                &#8212; Top Left<br />
            gl.Vertex ( 0.5 , 0.5 , 0. )                &#8212; Top Right<br />
            gl.Vertex ( 0.5 ,-0.5 , 0. )            &#8212; Bottom Right<br />
            gl.Vertex (-0.5 ,-0.5 , 0. )<br />
        gl.End();<br />
    gl.EndList()<br />
end<br />
function init()<br />
&#8211;initialize the dispaly list<br />
	if(this.context ~= 0) then<br />
	    BuildLists()<br />
	end<br />
end</p>
<p>
&#8211; functions as variables!<br />
function setOnReloadOrDestChanged(func)<br />
	script_load = func<br />
	det_changed = func<br />
end<br />
setOnReloadOrDestChanged(init)</p>
<p>&#8211;[[<br />
This section is equivalent to the above</p>
<p>function script_load()<br />
	init()<br />
end</p>
<p>function dest_changed()<br />
	init()<br />
end<br />
--]]</p>
<p>function draw()<br />
    gl.Clear(&#8220;COLOR_BUFFER_BIT&#8221; , &#8220;DEPTH_BUFFER_BIT&#8221;)<br />
    &#8211;gl.LoadIdentity()<br />
    &#8211;gl.Enable(&#8220;BLEND&#8221;)<br />
    &#8211;gl.BlendFunc(1,6)<br />
    &#8211;gl.ClearColor(1,1,0,1)<br />
    rot()<br />
    for i=0,1000 do<br />
    gl.Translate(mouseXY[1],mouseXY[2],(i/1000)-1);<br />
    gl.Rotate(angle,0,0,1)<br />
    gl.Color(i/1000, math.random(), 1, i/1000)<br />
    gl.CallList(box)<br />
    end</p>
<p>end</p>
<p>function rot()<br />
    angle = angle+dir<br />
    if angle==15 then dir= -0.5<br />
    elseif angle==0 then dir= 0.5<br />
    end<br />
end</p>
<p>&#8211;create the listener callback function<br />
function callback(event)<br />
    if(event.eventname == &#8220;mouseidle&#8221;) then<br />
        local _glXmouse = event.args[1]<br />
        local _glYmouse = event.args[2]<br />
        &#8211;need to transform mouse ccordinates to world domain<br />
        &#8211;dono why, but 0.95 needed<br />
        mouseXY=jit.gl.screentoworld({_glXmouse,_glYmouse, 0.95})<br />
    end<br />
end</p>
<p>&#8211;create a listener object<br />
listener = jit.listener(render_context, &#8220;callback&#8221;)</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119503</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119503</link>
					<pubDate>Wed, 02 Jan 2008 03:26:07 +0000</pubDate>
					<dc:creator>Wesley Smith</dc:creator>

					<description>
						<![CDATA[
						<p>Sorry, there was a slight typo in my script in the last post.  Here&#8217;s<br />
a fixed version:</p>
<p>
autowatch = 1<br />
print(&#8220;compiled&#8221;)<br />
render_context = this.drawto<br />
angle=0<br />
mouseXY={0,0}<br />
dir=1</p>
<p>function BuildLists()</p>
<p>    box = gl.GenLists(2)<br />
    gl.NewList(box    ,&#8221;COMPILE&#8221;);<br />
        gl.Begin(&#8220;QUADS&#8221;)<br />
            gl.Vertex (-0.5 , 0.5 , 0. )                &#8212; Top Left<br />
            gl.Vertex ( 0.5 , 0.5 , 0. )                &#8212; Top Right<br />
            gl.Vertex ( 0.5 ,-0.5 , 0. )            &#8212; Bottom Right<br />
            gl.Vertex (-0.5 ,-0.5 , 0. )<br />
        gl.End();<br />
    gl.EndList()<br />
end<br />
function init()<br />
&#8211;initialize the dispaly list<br />
	if(this.context ~= 0) then<br />
	    BuildLists()<br />
	end<br />
end</p>
<p>
&#8211; functions as variables!<br />
function setOnReloadOrDestChanged(func)<br />
	script_load = func<br />
	dest_changed = func<br />
end<br />
setOnReloadOrDestChanged(init)</p>
<p>&#8211;[[<br />
This section is equivalent to the above</p>
<p>function script_load()<br />
	init()<br />
end</p>
<p>function dest_changed()<br />
	init()<br />
end<br />
--]]</p>
<p>function draw()<br />
    gl.Clear(&#8220;COLOR_BUFFER_BIT&#8221; , &#8220;DEPTH_BUFFER_BIT&#8221;)<br />
    &#8211;gl.LoadIdentity()<br />
    &#8211;gl.Enable(&#8220;BLEND&#8221;)<br />
    &#8211;gl.BlendFunc(1,6)<br />
    &#8211;gl.ClearColor(1,1,0,1)<br />
    rot()<br />
    for i=0,1000 do<br />
    gl.Translate(mouseXY[1],mouseXY[2],(i/1000)-1);<br />
    gl.Rotate(angle,0,0,1)<br />
    gl.Color(i/1000, math.random(), 1, i/1000)<br />
    gl.CallList(box)<br />
    end</p>
<p>end</p>
<p>function rot()<br />
    angle = angle+dir<br />
    if angle==15 then dir= -0.5<br />
    elseif angle==0 then dir= 0.5<br />
    end<br />
end</p>
<p>&#8211;create the listener callback function<br />
function callback(event)<br />
    if(event.eventname == &#8220;mouseidle&#8221;) then<br />
        local _glXmouse = event.args[1]<br />
        local _glYmouse = event.args[2]<br />
        &#8211;need to transform mouse ccordinates to world domain<br />
        &#8211;dono why, but 0.95 needed<br />
        mouseXY=jit.gl.screentoworld({_glXmouse,_glYmouse, 0.95})<br />
    end<br />
end</p>
<p>&#8211;create a listener object<br />
listener = jit.listener(render_context, &#8220;callback&#8221;)</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119504</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119504</link>
					<pubDate>Wed, 02 Jan 2008 11:18:15 +0000</pubDate>
					<dc:creator>yair reshef</dc:creator>

					<description>
						<![CDATA[
						<p>thanks wes, lua is so flexible</p>
<p>i&#8217;m still having difficulties with the placement of<br />
  gl.Enable(&#8220;BLEND&#8221;)<br />
  gl.BlendFunc(1,6)<br />
  gl.ClearColor(0,0,0,0.5)<br />
my intuition tells me it should be in the init function, but no go.</p>
<p>On Jan 2, 2008 5:26 AM, Wesley Smith <wesley .hoke@gmail.com> wrote:</wesley></p>
<p>> Sorry, there was a slight typo in my script in the last post.  Here&#8217;s<br />
> a fixed version:<br />
><br />
><br />
> autowatch = 1<br />
> print(&#8220;compiled&#8221;)<br />
> render_context = this.drawto<br />
> angle=0<br />
> mouseXY={0,0}<br />
> dir=1<br />
><br />
><br />
><br />
> function BuildLists()<br />
><br />
>    box = gl.GenLists(2)<br />
>    gl.NewList(box    ,&#8221;COMPILE&#8221;);<br />
>        gl.Begin(&#8220;QUADS&#8221;)<br />
>            gl.Vertex (-0.5 , 0.5 , 0. )                &#8212; Top Left<br />
>            gl.Vertex ( 0.5 , 0.5 , 0. )                &#8212; Top Right<br />
>            gl.Vertex ( 0.5 ,-0.5 , 0. )            &#8212; Bottom Right<br />
>            gl.Vertex (-0.5 ,-0.5 , 0. )<br />
>        gl.End();<br />
>    gl.EndList()<br />
> end<br />
> function init()<br />
> &#8211;initialize the dispaly list<br />
>        if(this.context ~= 0) then<br />
>            BuildLists()<br />
>        end<br />
> end<br />
><br />
><br />
> &#8212; functions as variables!<br />
> function setOnReloadOrDestChanged(func)<br />
>        script_load = func<br />
>        dest_changed = func<br />
> end<br />
> setOnReloadOrDestChanged(init)<br />
><br />
> &#8211;[[<br />
> This section is equivalent to the above<br />
><br />
> function script_load()<br />
>        init()<br />
> end<br />
><br />
> function dest_changed()<br />
>        init()<br />
> end<br />
> --]]<br />
><br />
> function draw()<br />
>    gl.Clear(&#8220;COLOR_BUFFER_BIT&#8221; , &#8220;DEPTH_BUFFER_BIT&#8221;)<br />
>    &#8211;gl.LoadIdentity()<br />
>    &#8211;gl.Enable(&#8220;BLEND&#8221;)<br />
>    &#8211;gl.BlendFunc(1,6)<br />
>    &#8211;gl.ClearColor(1,1,0,1)<br />
>    rot()<br />
>    for i=0,1000 do<br />
>    gl.Translate(mouseXY[1],mouseXY[2],(i/1000)-1);<br />
>    gl.Rotate (angle,0,0,1)<br />
>    gl.Color(i/1000, math.random(), 1, i/1000)<br />
>    gl.CallList(box)<br />
>    end<br />
><br />
> end<br />
><br />
> function rot()<br />
>    angle = angle+dir<br />
>    if angle==15 then dir= -0.5<br />
>    elseif angle==0 then dir= 0.5<br />
>    end<br />
> end<br />
><br />
> &#8211;create the listener callback function<br />
> function callback(event)<br />
>    if(event.eventname == &#8220;mouseidle&#8221;) then<br />
>        local _glXmouse = event.args[1]<br />
>        local _glYmouse = event.args[2]<br />
>        &#8211;need to transform mouse ccordinates to world domain<br />
>        &#8211;dono why, but 0.95 needed<br />
>        mouseXY=jit.gl.screentoworld({_glXmouse,_glYmouse, 0.95})<br />
>    end<br />
> end<br />
><br />
> &#8211;create a listener object<br />
> listener = jit.listener(render_context, &#8220;callback&#8221;)<br />
></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119505</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119505</link>
					<pubDate>Wed, 02 Jan 2008 12:51:23 +0000</pubDate>
					<dc:creator>Erik Mijwaard</dc:creator>

					<description>
						<![CDATA[
						<p>
try this:</p>
<p>gl.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA)</p>
<p>like the redbook says, but without the GL_</p>
<p><a href="http://www.cs.rutgers.edu/~decarlo/428/gl_man/blendfunc.html" rel="nofollow">http://www.cs.rutgers.edu/~decarlo/428/gl_man/blendfunc.html</a></p>
<p>
hth,<br />
erik</p>
<p>
Quote: yair r. wrote on Wed, 02 January 2008 04:18<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
> thanks wes, lua is so flexible<br />
> <br />
> i&#8217;m still having difficulties with the placement of<br />
>   gl.Enable(&#8220;BLEND&#8221;)<br />
>   gl.BlendFunc(1,6)<br />
>   gl.ClearColor(0,0,0,0.5)<br />
> my intuition tells me it should be in the init function, but no go.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119506</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119506</link>
					<pubDate>Wed, 02 Jan 2008 16:42:01 +0000</pubDate>
					<dc:creator>Wesley Smith</dc:creator>

					<description>
						<![CDATA[
						<p>On Jan 2, 2008 4:51 AM, Erik Mijwaard <erik @videotroopers.com> wrote:<br />
><br />
><br />
> try this:<br />
><br />
> gl.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA)<br />
></erik></p>
<p>Indeed, this is the way to go.  The Jitter constants for blend<br />
functions just enumerate the list of enums.  In jit.gl.lua, the enums<br />
have become strings corresponding to the name of the enum.  BTW, if<br />
you get errors from the ONE enum and you have the latest version of<br />
jit.gl.lua for your platform, let me know.</p>
<p>wes</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119507</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119507</link>
					<pubDate>Wed, 02 Jan 2008 17:05:14 +0000</pubDate>
					<dc:creator>yair reshef</dc:creator>

					<description>
						<![CDATA[
						<p>ye, i got an error. im on beta4<br />
ob3d_draw_preamble initial: GL Error: Invalid enumeration</p>
<p>function init()<br />
&#8211;initialize the dispaly list<br />
       if(this.context ~= 0) then<br />
           BuildLists()<br />
   gl.Enable(&#8220;BLEND&#8221;)<br />
   gl.BlendFunc(&#8220;ONE&#8221;, &#8220;ONE_MINUS_SRC_ALPHA&#8221;)<br />
   &#8211;gl.ClearColor(1,1,0,1)<br />
       end<br />
end</p>
<p>
On Jan 2, 2008 6:42 PM, Wesley Smith <wesley .hoke@gmail.com> wrote:</wesley></p>
<p>> On Jan 2, 2008 4:51 AM, Erik Mijwaard <erik @videotroopers.com> wrote:<br />
> ><br />
> ><br />
> > try this:<br />
> ><br />
> > gl.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA)<br />
> ><br />
><br />
> Indeed, this is the way to go.  The Jitter constants for blend<br />
> functions just enumerate the list of enums.  In jit.gl.lua, the enums<br />
> have become strings corresponding to the name of the enum.  BTW, if<br />
> you get errors from the ONE enum and you have the latest version of<br />
> jit.gl.lua for your platform, let me know.<br />
><br />
> wes<br />
></erik></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119508</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119508</link>
					<pubDate>Wed, 02 Jan 2008 17:33:19 +0000</pubDate>
					<dc:creator>Wesley Smith</dc:creator>

					<description>
						<![CDATA[
						<p>ok, I&#8217;ll have an update soon.  I&#8217;m assuming you&#8217;re on windows?</p>
<p>wes</p>
<p>On Jan 2, 2008 9:05 AM, yair reshef <yair99 @gmail.com> wrote:<br />
> ye, i got an error. im on beta4<br />
> ob3d_draw_preamble initial: GL Error: Invalid enumeration<br />
><br />
><br />
> function init()<br />
> &#8211;initialize the dispaly list<br />
>        if(this.context ~= 0) then<br />
>            BuildLists()<br />
>    gl.Enable (&#8220;BLEND&#8221;)<br />
><br />
>    gl.BlendFunc(&#8220;ONE&#8221;, &#8220;ONE_MINUS_SRC_ALPHA&#8221;)<br />
>    &#8211;gl.ClearColor(1,1,0,1)<br />
>        end<br />
> end<br />
><br />
><br />
><br />
><br />
> On Jan 2, 2008 6:42 PM, Wesley Smith < wesley.hoke@gmail.com> wrote:<br />
> ><br />
> ><br />
> ><br />
> ><br />
> > On Jan 2, 2008 4:51 AM, Erik Mijwaard < erik@videotroopers.com> wrote:<br />
> > ><br />
> > ><br />
> > > try this:<br />
> > ><br />
> > > gl.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA)<br />
> > ><br />
> ><br />
> > Indeed, this is the way to go.  The Jitter constants for blend<br />
> > functions just enumerate the list of enums.  In jit.gl.lua, the enums<br />
> > have become strings corresponding to the name of the enum.  BTW, if<br />
> > you get errors from the ONE enum and you have the latest version of<br />
> > jit.gl.lua for your platform, let me know.<br />
> ><br />
> > wes<br />
> ><br />
> ><br />
> ><br />
> ><br />
> ><br />
><br />
><br />
><br />
></yair99></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119509</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119509</link>
					<pubDate>Wed, 02 Jan 2008 18:11:27 +0000</pubDate>
					<dc:creator>Wesley Smith</dc:creator>

					<description>
						<![CDATA[
						<p>ok, I&#8217;ve updated to beta4.1 with a new windows external fixing the ONE<br />
enum problem.  Let me know if you still have issues.<br />
wes</p>
<p>On Jan 2, 2008 9:33 AM, Wesley Smith <wesley .hoke@gmail.com> wrote:<br />
> ok, I&#8217;ll have an update soon.  I&#8217;m assuming you&#8217;re on windows?<br />
><br />
> wes<br />
><br />
><br />
> On Jan 2, 2008 9:05 AM, yair reshef <yair99 @gmail.com> wrote:<br />
> > ye, i got an error. im on beta4<br />
> > ob3d_draw_preamble initial: GL Error: Invalid enumeration<br />
> ><br />
> ><br />
> > function init()<br />
> > &#8211;initialize the dispaly list<br />
> >        if(this.context ~= 0) then<br />
> >            BuildLists()<br />
> >    gl.Enable (&#8220;BLEND&#8221;)<br />
> ><br />
> >    gl.BlendFunc(&#8220;ONE&#8221;, &#8220;ONE_MINUS_SRC_ALPHA&#8221;)<br />
> >    &#8211;gl.ClearColor(1,1,0,1)<br />
> >        end<br />
> > end<br />
> ><br />
> ><br />
> ><br />
> ><br />
> > On Jan 2, 2008 6:42 PM, Wesley Smith < wesley.hoke@gmail.com> wrote:<br />
> > ><br />
> > ><br />
> > ><br />
> > ><br />
> > > On Jan 2, 2008 4:51 AM, Erik Mijwaard < erik@videotroopers.com> wrote:<br />
> > > ><br />
> > > ><br />
> > > > try this:<br />
> > > ><br />
> > > > gl.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA)<br />
> > > ><br />
> > ><br />
> > > Indeed, this is the way to go.  The Jitter constants for blend<br />
> > > functions just enumerate the list of enums.  In jit.gl.lua, the enums<br />
> > > have become strings corresponding to the name of the enum.  BTW, if<br />
> > > you get errors from the ONE enum and you have the latest version of<br />
> > > jit.gl.lua for your platform, let me know.<br />
> > ><br />
> > > wes<br />
> > ><br />
> > ><br />
> > ><br />
> > ><br />
> > ><br />
> ><br />
> ><br />
> ><br />
> ><br />
></yair99></wesley></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119510</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119510</link>
					<pubDate>Wed, 02 Jan 2008 20:52:02 +0000</pubDate>
					<dc:creator>yair reshef</dc:creator>

					<description>
						<![CDATA[
						<p>the &#8220;one&#8221; enumeration error disappeared but i tried the others and &#8220;ZERO&#8221;<br />
gave the error.</p>
<p>On Jan 2, 2008 8:11 PM, Wesley Smith <wesley .hoke@gmail.com> wrote:</wesley></p>
<p>> ok, I&#8217;ve updated to beta4.1 with a new windows external fixing the ONE<br />
> enum problem.  Let me know if you still have issues.<br />
> wes<br />
><br />
> On Jan 2, 2008 9:33 AM, Wesley Smith <wesley .hoke@gmail.com> wrote:<br />
> > ok, I&#8217;ll have an update soon.  I&#8217;m assuming you&#8217;re on windows?<br />
> ><br />
> > wes<br />
> ><br />
> ><br />
> > On Jan 2, 2008 9:05 AM, yair reshef <yair99 @gmail.com> wrote:<br />
> > > ye, i got an error. im on beta4<br />
> > > ob3d_draw_preamble initial: GL Error: Invalid enumeration<br />
> > ><br />
> > ><br />
> > > function init()<br />
> > > &#8211;initialize the dispaly list<br />
> > >        if(this.context ~= 0) then<br />
> > >            BuildLists()<br />
> > >    gl.Enable (&#8220;BLEND&#8221;)<br />
> > ><br />
> > >    gl.BlendFunc(&#8220;ONE&#8221;, &#8220;ONE_MINUS_SRC_ALPHA&#8221;)<br />
> > >    &#8211;gl.ClearColor(1,1,0,1)<br />
> > >        end<br />
> > > end<br />
> > ><br />
> > ><br />
> > ><br />
> > ><br />
> > > On Jan 2, 2008 6:42 PM, Wesley Smith < wesley.hoke@gmail.com> wrote:<br />
> > > ><br />
> > > ><br />
> > > ><br />
> > > ><br />
> > > > On Jan 2, 2008 4:51 AM, Erik Mijwaard < erik@videotroopers.com><br />
> wrote:<br />
> > > > ><br />
> > > > ><br />
> > > > > try this:<br />
> > > > ><br />
> > > > > gl.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA)<br />
> > > > ><br />
> > > ><br />
> > > > Indeed, this is the way to go.  The Jitter constants for blend<br />
> > > > functions just enumerate the list of enums.  In jit.gl.lua, the<br />
> enums<br />
> > > > have become strings corresponding to the name of the enum.  BTW, if<br />
> > > > you get errors from the ONE enum and you have the latest version of<br />
> > > > jit.gl.lua for your platform, let me know.<br />
> > > ><br />
> > > > wes<br />
> > > ><br />
> > > ><br />
> > > ><br />
> > > ><br />
> > > ><br />
> > ><br />
> > ><br />
> > ><br />
> > ><br />
> ><br />
></yair99></wesley></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lua-questions/#post-119511</guid>
					<title><![CDATA[Re: lua questions]]></title>
					<link>http://cycling74.com/forums/topic/lua-questions/#post-119511</link>
					<pubDate>Wed, 02 Jan 2008 21:31:27 +0000</pubDate>
					<dc:creator>Wesley Smith</dc:creator>

					<description>
						<![CDATA[
						<p>argh. thanks for checking.  I had tried doing some &#8220;fancy&#8221; scripting<br />
on the enum definitions from GLEW and apparently there are several<br />
definitions of ZERO and ONE.  I&#8217;ll get this patched up with a full<br />
update in a few days.</p>
<p>wes</p>
<p>On Jan 2, 2008 12:52 PM, yair reshef <yair99 @gmail.com> wrote:<br />
> the &#8220;one&#8221; enumeration error disappeared but i tried the others and &#8220;ZERO&#8221;<br />
> gave the error.<br />
><br />
><br />
><br />
><br />
><br />
> On Jan 2, 2008 8:11 PM, Wesley Smith < wesley.hoke@gmail.com> wrote:<br />
> > ok, I&#8217;ve updated to beta4.1 with a new windows external fixing the ONE<br />
> > enum problem.  Let me know if you still have issues.<br />
> > wes<br />
> ><br />
> ><br />
> ><br />
> ><br />
> > On Jan 2, 2008 9:33 AM, Wesley Smith <wesley .hoke@gmail.com> wrote:<br />
> > > ok, I&#8217;ll have an update soon.  I&#8217;m assuming you&#8217;re on windows?<br />
> > ><br />
> > > wes<br />
> > ><br />
> > ><br />
> > > On Jan 2, 2008 9:05 AM, yair reshef <yair99 @gmail.com > wrote:<br />
> > > > ye, i got an error. im on beta4<br />
> > > > ob3d_draw_preamble initial: GL Error: Invalid enumeration<br />
> > > ><br />
> > > ><br />
> > > > function init()<br />
> > > > &#8211;initialize the dispaly list<br />
> > > >        if(this.context ~= 0) then<br />
> > > >            BuildLists()<br />
> > > >    gl.Enable (&#8220;BLEND&#8221;)<br />
> > > ><br />
> > > >    gl.BlendFunc(&#8220;ONE&#8221;, &#8220;ONE_MINUS_SRC_ALPHA&#8221;)<br />
> > > >    &#8211;gl.ClearColor(1,1,0,1)<br />
> > > >        end<br />
> > > > end<br />
> > > ><br />
> > > ><br />
> > > ><br />
> > > ><br />
> > > > On Jan 2, 2008 6:42 PM, Wesley Smith < wesley.hoke@gmail.com> wrote:<br />
> > > > ><br />
> > > > ><br />
> > > > ><br />
> > > > ><br />
> > > > > On Jan 2, 2008 4:51 AM, Erik Mijwaard < erik@videotroopers.com ><br />
> wrote:<br />
> > > > > ><br />
> > > > > ><br />
> > > > > > try this:<br />
> > > > > ><br />
> > > > > > gl.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA)<br />
> > > > > ><br />
> > > > ><br />
> > > > > Indeed, this is the way to go.  The Jitter constants for blend<br />
> > > > > functions just enumerate the list of enums.  In jit.gl.lua, the<br />
> enums<br />
> > > > > have become strings corresponding to the name of the enum.  BTW, if<br />
> > > > > you get errors from the ONE enum and you have the latest version of<br />
> > > > > jit.gl.lua for your platform, let me know.<br />
> > > > ><br />
> > > > > wes<br />
> > > > ><br />
> > > > ><br />
> > > > ><br />
> > > > ><br />
> > > > ><br />
> > > ><br />
> > > ><br />
> > > ><br />
> > > ><br />
> > ><br />
> ><br />
><br />
><br />
><br />
></yair99></wesley></yair99></p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

