Welcome, Guest. Please login or register.
February 05, 2012, 10:35:24 PM
Home Help Search Login Register
News: A significant upgrade to OpenCL Studio 1.1 has been released including new OpenCL library elements, addtions to the scripting interface and various bug fixes.

+  opencldev.com
|-+  OpenCL Studio
| |-+  Bug Reports
| | |-+  Nil Values when following tutorial
« previous next »
Pages: [1] Print
Author Topic: Nil Values when following tutorial  (Read 394 times)
raistlin969
Newbie
*
Posts: 13


« on: January 19, 2011, 10:20:37 AM »

Hey all,
I just started to experiment with OpenCL Studio and I think it looks like a really great platform.  I started to follow the tutorial videos that are posted and I am running in to trouble. Part 4 of the tutorial has you add a point set and a program, and then add some scripting code to it.  I followed the video step by step, but I get errors.  The errors I get are about nil values.  For example, the first line of my script is:

vertex = b0:getVertexBuffer()

and the error I get when in the scene view is attempt to index global b0 (a nil value).  Also I notice that the registers on the script interface are not labeled, and when I type b0: I do not get the pop up menu.  When looking through some of the sample apps I saw that they used event:getVertexBuffer() instead of the column and row labels, so I tried that and got the same error.  The same problem happens when trying to get the Kernal as well. 

I am on Windows 7 64, I have a GeForce 480, and I can run all of the sample apps.  If anyone can help me out I would really appreciate it, as I really like what I see so far from this environment. 
Thanks.
Michael
Logged
opencldev
Administrator
Jr. Member
*****
Posts: 59


« Reply #1 on: January 19, 2011, 11:18:16 AM »

Unfortunately the tutorials are outdated, but we will release a whole new series of in a few weeks. At that time we will also "officially" release another version of OpenCL Studio with a number of improvements. However, the download on the website is updated every two weeks or so with the latest build and demos. That's why the tutorials are outdated.

The nil pointer problem you are experiencing with b0:getVertexBuffer is because this addressing scheme has been removed. These identifiers added a level of abstraction that many people found difficult to get used to. It also created fixed addresses which makes it difficult to move code between different event handlers.

One way to address objects is via the treeview. For example, if you add a pointset called points under the OpenGL subtree then you can reference that object using

vertexbuffer = OpenGL.points:getVertexBuffer()

The event variable always reference the object that has generated the event. This means that if you drag and drop the pointset into a slot then you can also access the
vertex buffer using

event:getVertexBuffer()

in any of the event handlers for that object. A simple example you could try is to drop a slider into a register and implement the OnMove handler as

print(event:getPosition())


Keep posting any questions you may have. I can help you out with getting something up and running. Until the new tutorials are out, the demos and the forum are to only way
to learn more about the tool.



Logged
raistlin969
Newbie
*
Posts: 13


« Reply #2 on: January 19, 2011, 02:32:45 PM »

Thanks for your help.  I was able to get a small example working by using the tree view like you stated.  I will continue to play with the demos and I look forward to the next set of tutorials.   
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!