[Gambas-devel] My first attempts to extend GL and GLU components.

Laurent Carlier lordheavym at ...176...
Mon Jul 4 22:45:38 CEST 2011

2011/7/4 Laurent Carlier <lordheavym at ...176...>

> 2011/7/4 Tomek <tommyline at ...670...>
>> Hello to all Hero Programmers!
>> Since I got intersted in OpenGL programming in Gambas, I begun to search
>> for source files and add some functions I felt I could use.
>> I'm not a C programmer, I just understand some code, so using analogy I
>> tried to attach Evaluators to GL. It works ok, but my question is if copying
>> the array and then pointing to it is the only method to pass a pointer to
>> the array from gambas to library? It slows down the process greatly. I would
>> be really happy if someone could point me to some documentation about how
>> the combination of Gambas and C works in components.
>> I attach my files and chcnaged GL.c file, so you can evaluate them, little
>> Bezier curve project and please don't be too harsh on me, I'm just a
>> beginner :)
>> Regards
>> Tomek
> Nice job!
> Personnaly, i prefer working with patches (tips: svn diff > mypatch.diff),
> Benoit prefers modified files.
> Some quick comments:
> - No need to implement double and float support, i"ve only added Float
> datatype, but it use double internally (
> http://gambasdoc.org/help/cat/datatypes) so the GL API show Gl.Map1f(),
> but we use glMap1d()
> - Associated glGets are already here (see GLinfo.c) , it seem you have
> properly added the associated constants.
> - Typos in the methods, the first letter of the variables must be in
> uppercase ((target)i(u1)f -> (Target)i(U1)f)
> - Gambas doesn't provide native C arrays support, so there is no other ways
> to provide C arrays to GL functions. But i don't think it slow down so much
> the code.
> - Perhaps the interface of maps functions can be made easier for user, i
> need to look at. Alsoe perhaps if Array sent to functions is too small, we
> should zeroing missing bytes.
> - Perhaps other things :-p
> I hope we will see more work :-)
> ++
Ok, you can find now your work in the svn trunk (after a small cleanup).
I've not tested your example, but it's building fine.

Feel free to send comments in case of bugs, or if you have additionnal work

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20110704/e0ccb419/attachment.html>

More information about the Devel mailing list