SDL, OpengL, etc (was: Squeak + Darwin)
Joshua Channing Gargus
schwa at cc.gatech.edu
Thu Apr 12 12:27:56 UTC 2001
On Thu, Apr 12, 2001 at 12:16:14AM -0700, Raab, Andreas wrote:
> Bert,
>
> > > >So, by hook or by crook, I'd say that OpenGL support is coming.
> > >
> > > See "OpenGL for Squeak":
> > > http://minnow.cc.gatech.edu/squeak/1759
> >
> > Yeah, I tried to refactor this to allow the same protocol for
> > Win32 and X11, but no luck so far. That is, I did the refactoring,
> > but now as soon as I call any OpenGL function via FFI Squeak crashes
> > (seg fault) *sigh*.
> >
> > Besides, I'm not sure if it would even work the same way on
> > X. I think you can't just create a GL context for a window,
> > because it has to have a GLX visual.
>
> Correct. But what you *can* do is to create a GL capable visual to begin
> with. If you look at my old code for the VW/OpenGL wrapper (if you're lucky
> it's still somewhere in the SGI pool) it created its own window to draw in.
>
I have a class project where I'm doing this via a hacked vm that creates
the GL visual when Squeak first creates its two XWindows. It is horrible
(no, make that HORRIBLE), but it hangs together.
> > And then, I'm not sure if I can mix X11 drawing with GL drawing on
> > the same drawable ...
>
There doesn't seem to be a problem.
> This might not be a problem if you mix in the ExternalScreen primitives
> appropriately (which might be hard to do without some sample code but I've
> been thinking about it). If you have PBuffers available (IIRC, this is part
> of GLX 1.3 but I'm uncertain if current XFree's support it) the
> ExternalScreen stuff is *definitely* the way to go.
YDRC (You Do Recall Correctly). Unfortunately, current XFrees do not support
it.
A question about your engine: does it support translucent polygons?
While I'm at it, here's another question. I want to use two Forms to create
a single texture. One Form provides the RGB components, and the other uses
its R component as the Alpha of the new form (this makes it easier to add
translucency with the painting tools in Squeak). Right now, I use a loop
that iterates over the pixels of both Forms (I first make sure they are the
same size, and scale with WarpBlt if they are not), and uses pixelValueAt:
and pixelValueAt:put: to manipulate the pixels.
Unfortunately, this is rather slooooow. I suspect that there must be a
way to do this using BitBlt, but I couldn't figure it out. Any ideas?
Thanks,
Joshua
>
> Cheers,
> - Andreas
More information about the Squeak-dev
mailing list
|