[SDL] Attempting to make SDL wrapper for QB64 - First hurdle!
alex.barry at gmail.com
Tue Dec 7 11:59:16 PST 2010
Pointers has actually been on the dev's todo list since 2007. I suppose a
wrapper can be made, and I'll talk to Galleon about that, too.
@Unseen Machine: As David suggested, you could probably use arrays of
pointers in c/c++ and the interface just does basic lookups.
On Tue, Dec 7, 2010 at 2:41 PM, David Olofson <david at olofson.net> wrote:
> On Tuesday 07 December 2010, at 17.22.24, Alex Barry <
> alex.barry at gmail.com> wrote:
> > If QB64 can't handle pointers, then I don't think there is really any way
> > that you can port SDL (which almost exclusively uses pointers for it's
> > types).
> Uhm... There are several languages without pointers (including my own EEL)
> that have SDL bindings - and this often comes with additional bonuses such
> as automatic memory management and a nicer, safer API than the C version.
> What you do is just wrap the "API objects" in whatever way makes most sense
> in the language at hand. In EEL, I wrap them up as "objects" (memory managed
> entities with an interface based on a fixed set of methods), which are then
> handled by means of opaque references. That is, essentially pointers to
> wrapper objects, but all wrapped up and "fool proof". Most VM based
> scripting languages, and many others, would support this model, I think.
> For a language that doesn't support "native" objects or custom types AT
> ALL, there is a salution that is actually pretty common in native C APIs:
> integer handles - or as OpenGL (among others) calls them: "names." You can
> implement some variant of this even if you have only a single data type, be
> it strings, integers, real numbers, "bignums" or whatever.
> > I'll chat with Galleon to see where he's at for implementing pointers
> > (which probably should have been done at QB64's first launch!).
> > I'll let you know what I find out and I'll get back to you.
> If you have a language that is already getting by just fine without
> pointers, why open up that massive, evil can of worms at all? In a high
> level language, pointers don't really solve anything that cannot be handled
> much better with other constructs.
> Well, either way, that's pretty off topic for this list, anyway. :-)
> //David Olofson - Consultant, Developer, Artist, Open Source Advocate
> .--- Games, examples, libraries, scripting, sound, music, graphics ---.
> | http://consulting.olofson.net http://olofsonarcade.com |
> SDL mailing list
> SDL at lists.libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL