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: Brandon J. Van Every
Subject: Re: [Chicken-users] 3D games in Chicken
Date: Sat, 11 Feb 2006 19:34:50 -0800
User-agent: Thunderbird 1.5 (Windows/20051201)

Peter Keller wrote:
On Sat, Feb 11, 2006 at 12:23:32AM -0700, Shawn Rutledge wrote:
  
Forgive my naivety but why do you still need SDL in that case?  To
display images you map them as textures onto rectangles, and the
OpenGL implementation takes care of the rest, right?
    

While opengl is happy to draw whatever you want into a window, it has no
idea how to acquire that window from the window manager, set it up for
the right color depth, double bufferring, etc, 
These things are trivial.  OpenGL has platform-specific functions to handle this sort of stuff, i.e. the WGL functions on Windows. 

and deal with keyboard,
mouse, window manager events, etc.
  
These are more involved.  The proper comparison, however, is SDL vs. any other cross-platform GUI.  Games benefit from their own in-game GUIs.  Various OpenGL-based GUIs exist; I have no idea how worthy they are for game development.  It's such a bog trying to compile all these stacks of stuff on Windows, that I've never really gotten that far.  I'm really not sold that the effort is worth it vs. just cooking something up yourself.  Especially since foreign libraries tend to pull away from Scheme development.


That's why you need something like GLUT (which isn't a part of opengl,
but often bundled with it) or SDL. GLUT has it's own internal event
handler loop which you cannot control, and SDL exposes this loop so in
essence you write it. After coding plenty of 3D things in my life, I've
found I very much prefer SDL to GLUT any day.
Well, yeah.  No shocker.  But I don't see why I should prefer SDL over my own code.  Especially since, I don't care about cross-platform support as a primary goal.  I need to ship games on Windows.  The Mac game market is marginal, and the Linux game market is worthless.  The real porting money is in consoles and I don't think SDL has anything to say about that.  My thought is, I'll build what I want.  If it turns out to be compelling, and worth bothering to make open source, and others want to make it work on other platforms, great they can.  Not really my problem as far as getting the ball rolling.  3D engines tend to have critical mass on one particular platform anyways.  They have to survive an awfully long time and please a lot of people for multiple platforms to be supported equally well.  Honestly I'm not sure there's any open source 3D engine that is really at that level.  Seems like, the story is usually, it works on Platform X and someone else is dinking on a broken crufty barely working version for Platform Y. 

 Plus, SDL has an audio
and mixer set to its API which are really nice. There is OpenAL, which
is the opengl equivalent for an audio library, but it had some issues
for a while politically (Loki Games wrote it, went out of business,
released it, it lied fallow for a while, then some people took it over),
I'm not sure on its completness and support at this time.
  
Yeah, dunno.  But it's out there, it's not going away, it'll get improved.  Really it's either OpenAL or Ogg Vorbis.


You'll probably have to use freetype or something to deal with the
truetype font. I've never used truetype stuff in anything I've done,
usually I just have some big bitmap of a bunch of antialiased characters
and then I select the subtexture which represents one letter out whenever
I need it. The pipeline takes care of bilenear filtering it and mapping
it onto whatever surface it needs to go on.
  
Yeah it might be less of a big deal to do it this way nowadays.  Texture maps used to be a lot smaller.

Wouldn't it be nice to get away from needing completely separate 2D
and 3D methodologies?
    

If your project deals with 2D components specifically, then a small
abstraction layer would be good to represent it, but have the back end
be opengl.
  
Agreed.  The main problem with using OpenGL for 2D is just that it's a PITA to get started with, before you've actually cooked up your 2D abstraction layer.  Sort of a baroque underlying machine for simple 2D tasks.  It's irritating that the industry never came up with standard abstractions for 2D stuff.  Instead everyone has to be good little engineers and re-implement 2D abstractions over and over and over again.  Unless you actually like SDL and the LGPL.


Cheers,
Brandon Van Every


reply via email to

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