Question about Html5

Previous topic - Next topic

mentalthink

It's possible call to native Html5 from GLBasic?¿, I'm not sure but whit inline?¿

MrTAToad

No, I don't think it's possible, although there may be an interface system

Kitty Hello

Yes. Just use the import "C" and write a javascript function.

mentalthink

Ok Kitty, it's too much disturb, if when you have a bit of free time can put an example, equal you did whit the .ddl and some examples in C++, only like a little guide?¿...

Thanks

backslider

You could try to create a file "bla.js" in your glbasic project folder open it in a Text Editor and put

Code (glbasic) Select

function yeehaa(){
alert("yeehaa!");
}


into it.

Save and close the file.
Now write in your glbasic Project

Code (glbasic) Select

Require "bla.js"

Import "C" void yeehaa()

yeehaa()


And Run it...

I dont know of it Works! But its a try worth.

Let us know if this works :)

mentalthink

Hi Backslider thanks a lot for your example very easy...  :good:

I comment what happends...
I put the file and I compile in Html...

At the first time give an error comment me about Linker whit "-C" don't attach linked files... or something similar... Ok
I think I try whit -v in the Compiler Options of GLbasic, this it's Beacuse I read something... but I'm not sure 100% this it's functional... Well the files compies and now I have my Html and output file... But don't appears nothing...

I don't know if I try the code whitout too much effort, I think I do something Wrong... but the good things it's this Compiles.. and well I think this can add a lot of capabilities to GLbasic, like efects sound and all this nice things Html do at this moment.

Another question it's... If I do the same process this works whit Android... I know the Android Compiler it's based in the NDK, C++ compiler, but if the file can goes into the phone... it's Java, will works?¿, or simply the Compiler told me errors... I thin it's the last option.