PDA

View Full Version : Newbie



Canderel
21-04-2004, 02:12 PM
Hi, I am *very* new to graphical API's etc. and I want to start off slowly. :)

I've written a game in normal Delphi (just moved buttons with images on around), and though the game runs fine, I was wondering what would be the easiest/quickest way to rewrite it for openGL or DirectX. I've downloaded DelphiX and MNOgl, but DelphiX seems a lot simpler.

On the other hand, in principal (not practice though), I'd like to develop games that are easily portable to other OS's, so I dunno if I want to learn every nook and cranny of DirectX.

I saw in some other posts people refering to PowerDraw (or something like that). Is that also a free component, and is it an easy alternative? (uses DirectX or OpenGL?)

Maybe you could also point me to some easy tutorials about these stuff.

Thanks all!

-Canderel

WILL
22-04-2004, 12:09 AM
Hi and welcome to the Delphi Games Development community. :)

Yes, DelphiX is rather simple and easy to use. However it is also very old and doesn't really take advantage of the latest in video card hardware. It is because of this that others have gone to great lengths to find and create new libraries that will run faster and take advantage of the newer versions of DirectX. It think most will make use of DirectX 8.x, however there are a good few that will support 9.x aswell.

That is all well and good for Win32 exclusive programmers, however there have been a few projects for OpenGL fans. I prefer this myself because it allows you to develop on essentially any platform of which either Delphi, Kylix or FreePascal(it's being considered and support for it impoved by at least one library I know of) will compile on.

Which API or library you wish to use will depend on which type of graphics you wish to use(2D or 3D?). Alot of people first use DelphiX at first to get their toes wet or for a quick solution. However if you plan a bit farther into the project it often fails to meet certant needs.

The DirectX libraries I know of are:

DelphiX (http://turbo.gamedev.net/delphix.asp)
UnDelphiX (http://turbo.gamedev.net/undelphix.asp) (modified version of DelphiX for support of DirectX 8.1 and made to work in Delphi 7)
Omega Project (http://www.delphisanctuary.com/)
PowerDraw (http://turbo.gamedev.net/powerdraw.asp) (to be replaced by a new component set based on the old versions of PowerDraw called Ashfire)
XCESS (http://www.xsdevkit.com/)

The OpenGL libraries I know of are:

JEDI-SDL (http://sourceforge.net/projects/jedi-sdl/) (not really a graphics API, but rather a media/game API that supports opensource SDL)
GLScene (http://glscene.sourceforge.net/index.php) (3D graphics primarily)
GLXtreem (http://www.glxtreem.tk/) (again 3D)

Other interesting APIs, libraries and components I can point you towards are:

ISO Engine / Map Editor (http://sourceforge.net/projects/jedi-isoax) (Not really a library, but an example of how to make an ISO game engine)
JEDI-SDL (http://sourceforge.net/projects/jedi-sdl/) (listed again, but it has all the nice API support for inputs, etc)
OpenAL (http://www.openal.org/) (for sound with OpenGL, this is the daddy. It also follows the same conventions and 'style' as OpenGL)

For MOD playback try(if you don't know what this is visit this site (http://www.modplug.com/)):

BASS (http://www.un4seen.com/music/) (free for freeware only, shareware and commercial will cost you)
FMOD (http://www.fmod.org/) (free for freeware only, shareware and commercial will cost you)
OpenMOD (http://sourceforge.net/projects/openmodpas/) (this is just barely out of the starting line as far as development, but it will be completely open source and won't cost you a dime even if you create a WMD with it ;))

I've written a thread or two on this before here is the last one I can find. link (http://terraqueous.f2o.org/dgdev/viewtopic.php?p=7328)

[Small note to anyone else reading: There really should be some kind of list or posting here for this sort of thing. When the new site arives look for this as I am sure most of the staff are probably stating the same.]

Canderel
22-04-2004, 06:02 AM
Yes, I think that this post (or it's kind) should be sticky.

My game is 2d, but I thought I could make the buttons that I used rotating cubes... though that is only nice graphics, not really functional at all.

Does OpenGL have 2d support?

WILL
22-04-2004, 08:19 AM
Even though your game is only 2D, you will want to make use of your video cards 3D hardware functions. You are basically drawing in 2D, but using only the 3D libraries to do so.


3 reasons:

:arrow: Rotations
:arrow: Resizing & Stretching/Skewing
:arrow: Alpha Blending(for fading in and out)


These are the basic 3 things that you can do with your 2D sprites that will take up alot of computing power depending on a few basic factors.


To name a few off the top of my head:

:arrow: size of image(s)
:arrow: color-depth of image(s) and/or screen
:arrow: frame-rate


OpenGL can do both 2D and 3D. You can go bare-bones API and just get DirectX and OpenGL headers. Where to get those specifically you can try the JEDI homepage. It's actually late here so I'm a bit too tired to go digging, but Clootie has his own version of the DirectX 7 through 9 headers aswell. I'm sure you can find out this by doing a basic search either here or at www.delphigamer.com or even at turbo's site (turbo.gamedev.net)