[Gambas-devel] A simplest component example

Marcio Roger Ferrari marcio.roger at ...153...
Sat Sep 4 00:24:05 CEST 2004


Thanks for the tips about components Minisini :-)

Now, I have a job to do, but before this I would to talk a little bit more 
abou threads. As you said, there is no plans no Gambas suport threads and the 
interpreter was not design for this. However, when I talk about threads (and 
my desire to implement it - you were right: I didn't know that could be so 
difficult), I was think in one thing: Games and the SDL Gambas Component!
I don't have many experience doing linux apps, but as I know (I can be wrong), 
timers does not offer the best performance. Some years ago (before discover 
Linux) I develop a small game using Directx and MFC (with VC++). And in MFC 
there is function named OnAppIdle, that can is called when the aplication is 
idle, or in other words, just waiting for events. So I could use this 
function to make all the game loop (read keys, joystick, move caracters of 
game, colision detection, etc) using lowlevel hardware access functions 
provided by DirectX ( as SDL probably works) with a good performance. 

Is there is a chance to implement it in Gambas 2.0 (of course if you doesn't 
have already a better plan) :-)   

Regards and thanks for provide for us a excellent IDE .

Marcio Ferrari
 

On Thursday 02 September 2004 17:35, Benoit Minisini wrote:
> On Thursday 02 September 2004 22:02, marcio.roger wrote:
> > Greeting for everybody
> >
> > I'm interested ... no ..., I must, develop a comedilib
> > (www.comedi.org) component to Gambas. For those who doesn't know
> > what is comedilib, it's a library used to access measurement devices
> > interfaces mainly used device for industry automation.
> > Yes ... I know that this component could be useless for 99% of
> > users, but for me it's very (and maybe other people) important and
> > it's the way which I found to insert Linux at the company which I
> > work.
> > However I have a lot of doubts about develop Gambas Components even
> > looking the Wiki. I tried to look the example, located in src/lib/
> > but it doens't compile.
> >
> > So, I would ask if anyone has a ridiculous,very,very simple, source
> > of a component, that works, which I can started. In the Wiki I found
> > the topic "HowToProgramComponentsWrapping", but it's incomplete (I
> > know that it's the worst way to develop a component, but I could
> > help me to start and step by step I could adquire more knowledge
> > about it and develop better and easy-to-use components).
> >
> > Thanks and sorry for my English mistakes.
>
> Try with the gb.sdl component, it is very simple: only four source files.
>
> > ps: Benoît Minisini, is there a reason for Gambas does not allow to
> > use a a Boolean array or it's was not implemented yet? It's sees
> > boolean[] as byte[] ...
>
> Just lazyness. True Boolean[] needs special implementation of the array
> methods.
>
> > Is There something like thread in Gambas (or plans to create it) ?
>
> No, and there is no plan to do it.
>
> > I would like, in the future (after get more experience), to also
> > create a QThread component.
>
> Mmm... I'm afraid you don't see the difficulties :-) The interpreter was
> never designed to be manage threads. Maybe it needs a complete rewrite to
> do that!
>
> Regards,




More information about the Devel mailing list