Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-05

Next language feature for pas2js...

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ingemar Ragnemalm
Ryan Joseph wrote 8 lines
> On Apr 25, 2018, at 9:43 PM, Michael Van Canneyt wrote: > > Ah, webgl... > > I had a look at this some time ago, and got depressed. Quickly closed the browser and didn't look back. Same for webaudio:( I’m actually a little curious about this myself because I’ve been using OpenGL often recently. I’ve seen the Ingemar’s demos but I only slightly grasp how it’s working. The wiki says you’re actually parsing the Pascal (not compiling it) and outputting JavaScript. If that’s the case then how does porting libraries work in practice? For examples lets say I want to translate a single OpenGL function, how does that look?

I found it surprisingly easy to import undefined JavaScript functions working from examples in the interfaces. I believe web.pas was particularly useful. I also made some changes in web.pas. Well, why not say what: I made localStorage public instead of private. And I think "strokeStyle" was spelled "strokeStye". Also added

     procedure ellipse(x, y, radiusX, radiusY: TCanvasCoordType;
rotation, startAngle, endAngle: Real; anticlockwise: Boolean);

into TJSCanvasRenderingContext2D.

Not that much though.

WebGL is interesting for me, and being an OpenGL expert (teaching it for many years, written two course books on the subject and tons of code), I am happy to contribute any way I can. If nothing else, I can promise some decent demos, and testing of course.

/Ingemar

Reply by email

Michael Van Canneyt
to Ingemar Ragnemalm
Ingemar Ragnemalm wrote 22 lines
Den 2018-05-01 kl. 09:50, Ryan Joseph wrote: >> On Apr 25, 2018, at 9:43 PM, Michael Van Canneyt >> wrote: >> >> Ah, webgl... >> >> I had a look at this some time ago, and got depressed. Quickly closed the >> browser and didn't look back. Same for webaudio:( > I’m actually a little curious about this myself because I’ve been using > OpenGL often recently. I’ve seen the Ingemar’s demos but I only slightly > grasp how it’s working. > > The wiki says you’re actually parsing the Pascal (not compiling it) and > outputting JavaScript. If that’s the case then how does porting libraries > work in practice? For examples lets say I want to translate a single OpenGL > function, how does that look? I found it surprisingly easy to import undefined JavaScript functions working from examples in the interfaces. I believe web.pas was particularly useful. I also made some changes in web.pas. Well, why not say what: I made localStorage public instead of private.

It is public ?

And I think "strokeStyle" was spelled "strokeStye". Also added

Fixed, rev 82.

Show quoted text 5 lines
    procedure ellipse(x, y, radiusX, radiusY: TCanvasCoordType; rotation, startAngle, endAngle: Real; anticlockwise: Boolean); into TJSCanvasRenderingContext2D.

I did not add that on purpose, because it is marked experimental in the documentation.

I only add 'stable' calls.

Show quoted text 7 lines
Not that much though. WebGL is interesting for me, and being an OpenGL expert (teaching it for many years, written two course books on the subject and tons of code), I am happy to contribute any way I can. If nothing else, I can promise some decent demos, and testing of course.

I will see if today I can come up with a basic translation based on the IDL that Ryan posted. I had webgl for version 1.0 on my wishlist.

I'll get back on that later today, and examples would be *hugely* appreciated.

Michael.

Reply by email