Re: [MacRuby-devel] OpenGL/GLUT Bridgesupport

2010-01-23 Thread Jonathan Waddilove
Julien,

Thank you for the response. I'm not sure that ticket#520 is my problem. I don't 
think that the glut framework on 10.6.2 has been processed by bridge support.

I'm trying to teach myself openGL using the superbible and other web resources. 
To keep things simple I wanted to build the superbible examples in MacRuby - 
this should give me an easy to use platform for just trying to get my mind 
around the openGL paradigms.

I agree with John Shea that GLUT is not the way to develop a real application. 
But for learning and trying things out its performance is just fine.

My current thinking is to build a simple template project in MacRuby that uses 
a NSOpenGlView rather than GLUT. I would add boilerplate to provide animation, 
keyboard and mouse support (I'm thinking of using the Sojaster port of the 
Apple Cocoa OpenGL example as a basis).

I'd be happy to share or work jointly on these efforts with anyone who has a 
similar need. It would be useful if there is a web site we could use to 
document such work and share code. Any ideas?

  Jonathan


On 22 Jan 2010, at 16:04, Julien Jassaud wrote:

> Jonathan,
> 
> The MacRuby-Cocoa-OpenGL sample code you mention in your first post is not 
> complete. The reason might be a Bridgesupport problem, reported in ticket 
> #520.
> 
> I recently bought the SuperBible to better  understand the OpenGL sample code 
> I was porting to MacRuby. What example are you trying to port ? We could 
> maybe work on it together ?
> 
> 
> Julien
> 
> Le 22 janv. 2010 à 17:32, Jonathan Waddilove a écrit :
> 
>> John,
>> 
>> Thank you for the response. GLUT won't be my first choice but I'm trying to 
>> follow the examples in the SuperBible.
>> 
>> I'm wondering what the plan is to support all the 'standard' frameworks in 
>> MacRuby is? Should I be able to process the GLUT.framework with 
>> gen_bridge_metadata?
>> 
>> Meanwhile I will look at providing my own wrapper class as you suggest. As 
>> you say this provides a flexible way of handling any framework that lacks 
>> bridge support.
>> 
>> Many thank, Jonathan
>> 
>> On 21 Jan 2010, at 20:56, John Shea wrote:
>> 
>>> Yes as far as I know bridge support does not support GLUT.
>>> 
>>> So you (obviously) have two other options other than gen_bridge_metadata 
>>> (which I gave up on after a few tries) :
>>> 
>>> - don't use GLUT - use the equivalent (set of) non GLUT openGL calls
>>> - place the GLUT calls in an ObjC class - and call out to that class from 
>>> MacRuby
>>> 
>>> you might find that the second option is quite quick - i found that for 
>>> some openGL calls (but not all) that dispatching to my own bridge class 
>>> which then called opengl functions was quicker than going through 
>>> BridgeSupport.
>>> 
>>> There are other good reasons to have your own bridge class anyway - i 
>>> imagine that BridgeSupport is always going to be lagging Cocoa a bit (eg 
>>> Core Animation constants), and it might just be easier allocating OpenGL 
>>> texture memory in ObjC (well I still use objC for that)
>>> 
>>> HTH,
>>> J
>>> 
>>> 
>>> On Jan 20, 2010, at 8:14 PM, Jonathan Waddilove wrote:
>>> 
 Hi, I'm back to using MacRuby again and I'm confused about Bridge Support.
 
 I have been using the excellent sojaster port of the Cocoa OpenGL example 
 to help develop an OpenGL playpen. However, when I started using glut 
 calls (glutBitmapCharacter, glutStrokeString, etc) I started to get 
 problems.
 
 It seems that the OpenGL glut.framework (10.6.2) doesn't include bridge 
 support. I've tried using gen_bridge_metadata to add bridge support but 
 without success.
 
 Should glut work in MacRuby? How does one add BridgeSupport to the Apple 
 shipped frameworks?
 
 Sorry if I have missed some very obvious step.
 
 regards and thanks,  Jonathan
 
 ___
 MacRuby-devel mailing list
 [email protected]
 http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>> 
>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] OpenGL/GLUT Bridgesupport

2010-01-23 Thread Jonathan Waddilove
John,

I've just started to look at your IcPhage9 and CarNage8. Neither runs 'out of 
the box' under MacRuby Beta.5(2). There are various problems with the Pointer 
support having evolved (I think), e.g.: errors like "Pointer of type `i', got 
`l'" - I'm working to correct these and see if I can make the code function 
again.

It would be great if we could assemble a web page that documents some of the 
required knowledge on MAcRuby Pointers for OpenGL.

regards,  Jonathan


On 22 Jan 2010, at 16:06, John Shea wrote:

> 
> 
> Thank you again for offering the additional resources. It would be great if 
> you wanted to add them to your idisc.
> sure.
> 
> 
> 
> I did find a copy of your excellent presentation "Building Games with MacRuby 
> and OpenGL", I must work through the slides again. Did you consider sharing 
> your game tools? The presentation would make a very useful basis for a web 
> tutorial on the MacRuby/openGL topic.
> As far as tools are concerned the only one that ended up being useful in the 
> end was canning particle effects, so you run the explosion, fireworks or 
> whatever and then record a series of images, which you can use for animation 
> later. With IcePhage however it was all on the fly particle effects - canned 
> animation was not necessary - it could do with some optimisation (both in 
> look and efficiency) - and macruby speed increases have probably have 
> improved performance.
> 
> Is that what you meant by tools?
> 
> The only other software (sans MacRuby) I used was XCode, TextMate and for 3D 
> experiments Cheetah 3D, some Illustrator & Ria for drawing, graphic converter 
> to clean up the PNGs.
> 
> Let me know if you meant something else regarding tools.
> 
> Cheers,
> 
> J
> 
> 
> 
> 
> 
> 
> 
> Like you, I'm new to both openGL and MacRuby - my interest is in 
> visualisations rather than games. Right now I'm just greatfull that folks 
> like you are willing to share their hard earned skills.
> 
> Best wishes, Jonathan
> 
> jonathan 'at' waddilove.net
> 
> 
> On 22 Jan 2010, at 09:28, John Shea wrote:
> 
>> Jonathan,
>> 
>> I made some games in opengl this time last year (which now seem quite naive, 
>> as i did not know opengl or cocoa, so they could do with a good refactor).
>> 
>> I do not know if they work with the current version of macruby but they are 
>> on my idisk:
>> 
>> www.johnmacshea.org
>> 
>> navigate thru MacRuby / Game Related / Mine
>> 
>> Two 2D games CarNage8 and IcePhage9 are there.
>> 
>> They do screen setup, texture loading, writing text to opengl scenes (two 
>> different ways), canned explosions sometimes and particle effects for other 
>> explosions.
>> 
>> They do not use VAs or VBOs - but I do have some test projects which use VAs 
>> and VBOs, and a 3D test (which uses an exported c header file (from Cheetah 
>> 3D) holding vertex arrays).
>> 
>> Let me know if you are interested and I will dig them up and send them to 
>> you (only tested on MacRuby 0.4 however).
>> 
>> In that game related folder you will also see translations from other 
>> people's opengl work (also only tested on 0.4)
>> 
>> Cheers,
>> J
>> 
>> 
>> On Fri, 22 Jan 2010 09:32:57 +0100, Jonathan Waddilove 
>>  wrote:
>> 
>>> John,
>>> 
>>> Thank you for the response. GLUT won't be my first choice but I'm trying to 
>>> follow the examples in the SuperBible.
>>> 
>>> I'm wondering what the plan is to support all the 'standard' frameworks in 
>>> MacRuby is? Should I be able to process the GLUT.framework with 
>>> gen_bridge_metadata?
>>> 
>>> Meanwhile I will look at providing my own wrapper class as you suggest. As 
>>> you say this provides a flexible way of handling any framework that lacks 
>>> bridge support.
>>> 
>>> Many thank, Jonathan
>>> 
>>> On 21 Jan 2010, at 20:56, John Shea wrote:
>>> 
 Yes as far as I know bridge support does not support GLUT.
 
 So you (obviously) have two other options other than gen_bridge_metadata 
 (which I gave up on after a few tries) :
 
 - don't use GLUT - use the equivalent (set of) non GLUT openGL calls
 - place the GLUT calls in an ObjC class - and call out to that class from 
 MacRuby
 
 you might find that the second option is quite quick - i found that for 
 some openGL calls (but not all) that dispatching to my own bridge class 
 which then called opengl functions was quicker than going through 
 BridgeSupport.
 
 There are other good reasons to have your own bridge class anyway - i 
 imagine that BridgeSupport is always going to be lagging Cocoa a bit (eg 
 Core Animation constants), and it might just be easier allocating OpenGL 
 texture memory in ObjC (well I still use objC for that)
 
 HTH,
 J
 
 
 On Jan 20, 2010, at 8:14 PM, Jonathan Waddilove wrote:
 
> Hi, I'm back to using MacRuby again and I'm confused about Bridge Support.
> 
> I have been using the excellent sojaster port of the Cocoa OpenGL example 

Re: [MacRuby-devel] OpenGL/GLUT Bridgesupport

2010-01-23 Thread Julien Jassaud
Jonathan,


> I'm trying to teach myself openGL using the superbible and other web 
> resources. To keep things simple I wanted to build the superbible examples in 
> MacRuby - this should give me an easy to use platform for just trying to get 
> my mind around the openGL paradigms.

Same here.


> My current thinking is to build a simple template project in MacRuby that 
> uses a NSOpenGlView rather than GLUT. I would add boilerplate to provide 
> animation, keyboard and mouse support (I'm thinking of using the Sojaster 
> port of the Apple Cocoa OpenGL example as a basis).

Haha ! But I am Sojastar !So I think I can help you there. To get the template 
you want, it would be easier to start with the MacRuby-OpenGL-Fullscreen 
example. It has everything you want, animation callback and event loop, and 
adds fullscreen support. It is also much simpler than MacRuby-Cocoa-OpenGL. I 
can quickly make the template and push it to github if you prefer.


> I'd be happy to share or work jointly on these efforts with anyone who has a 
> similar need. It would be useful if there is a web site we could use to 
> document such work and share code. Any ideas?

We could use the wiki page for the MacRuby OpenGL sample code. I am quite new 
to this github thing, so I don't know if others than me can edit the pages. 
They call it social coding, so I imagine it is possible. If that sounds like a 
valid plan to you, I'll look into it.


Julien
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] OpenGL/GLUT Bridgesupport

2010-01-23 Thread Jordan K. Hubbard
Why stop there?   As we start to accumulate a growing collection of code 
samples and "conventional wisdom" about how to solve certain types of problems, 
it would be nice to get all of that information properly categorized and up on 
the project web site (specifically somewhere linked from 
https://www.macruby.org/documentation.html).  It would nicely compliment all 
the various tutorials and screencasts already there, most of which tend to give 
the reader a basic intro to MacRuby ("Here's how to build your first Cocoa app 
in IB!") and then leave all the really hairy stuff which follows as an exercise 
for the reader. :-)

- Jordan

On Jan 23, 2010, at 6:19 AM, Jonathan Waddilove wrote:

> It would be great if we could assemble a web page that documents some of the 
> required knowledge on MAcRuby Pointers for OpenGL.
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #575: Bug in Cocoa bindings for NSTableViewColumn + NSArrayController

2010-01-23 Thread MacRuby
#575: Bug in Cocoa bindings for NSTableViewColumn + NSArrayController
-+--
 Reporter:  n...@…   |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:  MacRuby 0.5  
Component:  MacRuby  |Keywords:   
-+--
 When an NSTableViewColumn has a subclass of NSTextFieldCell as its data
 cell, and when the column is bound to an NSArrayController, then when I
 add data to that array controller, it is expected that the arrangedObject
 of the array controller will set the datacell's objectValue property
 accordingly. The latter only seems to work for NSMutableDictionary
 strangely (maybe other cases too, but have only tested this one in
 particular) but not for other custom objects. When querying for the
 objectValue from within my subclass of NSTextFieldCell, I do however see
 that objectValue is set to an object of the right type, but its object id
 keeps changing during the draw cycle: I don't think that should be the
 case either as the objects in the arraycontroller should correspond to
 those in the datacell's objectValue.

 Also, objectValue's properties seem to be nil. This basically prevent
 people from using Cocoa bindings with NSTableViewColumns and custom
 objectValue's.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #575: Bug in Cocoa bindings for NSTableViewColumn + NSArrayController

2010-01-23 Thread MacRuby
#575: Bug in Cocoa bindings for NSTableViewColumn + NSArrayController
-+--
 Reporter:  n...@…   |Owner:  lsansone...@…
 Type:  defect   |   Status:  closed   
 Priority:  blocker  |Milestone:   
Component:  MacRuby  |   Resolution:  invalid  
 Keywords:   |  
-+--
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => invalid
  * milestone:  MacRuby 0.5 =>


Comment:

 After quick investigation and talk with Ninh, it turns out that making the
 MyCustomObject class compliant to the NSCopying protocol fixes the
 problem. Since it does not seem to be a problem with MacRuby itself, I'm
 closing the bug.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #511: GCD crash with indirect method access

2010-01-23 Thread MacRuby
#511: GCD crash with indirect method access
---+
 Reporter:  joshua.balla...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  blocker|   Milestone:   
Component:  MacRuby|Keywords:  GCD  
---+

Comment(by joshua.balla...@…):

 A day of Yak shaving later, and it seems that the root cause is calling
 "invalidate_method_cache" as part of method resolution when another thread
 already has the cached method in use. As suggested by Laurent, first
 calling the methods once on the main thread fixes the issue:

 {{{
 class Foo
   def doit
 puts "hi there!"
   end
 end

 class Bar
   def initialize
 @foo = Foo.new
   end

   def step
 100.times{ @foo.doit }
   end
 end

 @bars = []
 1000.times { @bars << Bar.new }
 @bars.each(&:step)

 steps = Dispatch::Group.new
 @bars.each do |bar|
   Dispatch::Queue.concurrent.async(steps) { bar.step }
 end
 steps.wait
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Getting involved in MacRuby development

2010-01-23 Thread Maxime Curioni
Hello MacRuby development team,

I am contacting you to have more information about how to be involved in the
development process. I have been hearing about MacRuby for many months and I
want to have a more proactive role in the project. As far as my abilities
go, I have been using Cocoa for many years and am currently working with
Ruby on Rails at work, during the day. I have no prior experience with LLVM,
but learning about it for a real-world project is a great motivation for me
to get up to speed.

I read that the 0.6 branch was merged into trunk last week-end, so I am not
sure if I am coming in at the right moment. I would be glad to try to fix
some bugs for the final 0.5 release. If you have anything in particular for
me to start on, I am up for it.

Thanks a lot for your feedback and your help,

Maxime
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel