chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] 3D games in Chicken


From: Peter Keller
Subject: Re: [Chicken-users] 3D games in Chicken
Date: Sat, 11 Feb 2006 17:31:21 -0600
User-agent: Mutt/1.4.2.1i

Hello,

On Sat, Feb 11, 2006 at 04:05:57PM -0700, Shawn Rutledge wrote:
> I imagine you're just referring to game menus and such?  Whereas most
> non-game apps will involve much more text, so one needs text rendering
> to be as fast as possible, and also to support scalable fonts etc. 
> And I think soon there will be a lot more attention paid to aesthetics
> of the text too - evolving towards the kind of quality on-screen that
> you get out of TeX on paper.

Yeah, then definitely mix the truetype library with opengl. I found a link
with a ridiculous amount of knowledge on it:

http://www.opengl.org/resources/features/fontsurvey/

> > Yikes! Don't bother doing a raw 2D library anymore. It isn't worth
> > it. Opengl has the ability to ask for pixel perfect placement on the
> > window in a 2D setting, even though to coordinates are floating point. Use
> > that instead.
> 
> Can you point me to some examples?

Sure, here is a transform which will setup up the window as a 2D coordinate
system with the origin in the upper left hand corner:

glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, w, h, 0, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

You can pick where you want the origin to be with glOrtho()....

Then when you want to set the raster position at a pixel position, do this:

glVertex2i(x, y);
glRasterPos2i(x, y);

If you're mixing 2d and 3d, then lookup the implementation of
MESA_window_pos() in raw Opengl and use that so you dn't disturb the
current opengl settings when switching back and forth.

> So do you agree that Scheme ought to have portable flonums even when
> the hardware doesn't support floating-point, by substituting
> fixed-point instead?

Honestly, I can't make a good statement about it because I never develop
for hardware which doesn't have floating-point hardware. 

> What I'm proposing is to do that, and then use OpenGL ES or something
> like it on small devices, and regular OpenGL on large devices, and
> keep the API the same so that the Scheme OpenGL programs will run
> unchanged on either one.

After skimming the OpenGL ES docs, it appears that it can natively
deal with fixed point mathematics. And so you're asking (in essenace)
can the numeric tower be implemented in fixed point?

-pete




reply via email to

[Prev in Thread] Current Thread [Next in Thread]