Log in

View Full Version : ZEngine


Jeff Greenberg
12-22-2003, 10:13 PM
I'm wondering if anyone has given this engine a try:

ZEngine (http://zengine.sourceforge.net/about.php)

Basically it is an API that sits on top of SDL, uses OpenGL for 2D rendering by default, and looks dead simple. I think I'll give it a workout in any case, but if someone has an informed opinion, I'd love to hear it.

ggambett
12-23-2003, 05:11 AM
I didn't know of ZEngine until I read your post. However, looking at the documentation and tutorials, I don't really see the point of using it - it's just a thin API on top of SDL, as you say (and their site says).

I'm using my own engine, which does everything ZEngine does but it also provides a much higher level framework to make games (events, animations, a basic compositing engine,...). I really don't believe you need yet another thin layer of abstraction.

I also don't like providing OpenGL as the only backend. I'd like to have SDL, OpenGL and Direct3D (I'm going to implement at least these in my engine).

I get the same feeling from the PTK documentation. Looks too low level.

Edit : I've taken a look at the source... it uses textures for the images (obviously) but doesn't even attempt to manage the texture space (since OpenGL texture dimensions must be powers of 2, this wastes a lot of space) - this is a cardinal sin for any serious OpenGL backend, IMO.

Jake Stine
12-23-2003, 05:30 AM
Originally posted by ggambett
Edit : I've taken a look at the source... it uses textures for the images (obviously) but doesn't even attempt to manage the texture space (since OpenGL texture dimensions must be powers of 2, this wastes a lot of space) - this is a cardinal sin for any serious OpenGL backend, IMO. Yeah. This essentially means any game made with that engine probably won't work right at all on the plephora of Voodoo, Intel, and other low-end video cards still out there and being used (or look very very gross at best). It's more or less like saying "ATI and NVIDIA only please!"

- Air

ggambett
12-23-2003, 06:54 AM
Hmmmm....

SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, mBPP==32 ? 24 : mBPP); //use 24 if BPP is 32

The color depth and the depth buffer resolution are completely unrelated, right? This library doesn't really inspire much confidence...

Jeff Greenberg
12-23-2003, 08:57 AM
Yeah, I just happened upon the site for this engine last night before I went to bed and figured I see if anyone had used it already, but didn't have a chance to look through the code before I passed out.

I'll probably look through it myself sometime this afternoon, but thanks for your opinions.

patrox
12-23-2003, 09:08 AM
Originally posted by ggambett

Edit : I've taken a look at the source... it uses textures for the images (obviously) but doesn't even attempt to manage the texture space (since OpenGL texture dimensions must be powers of 2, this wastes a lot of space) - this is a cardinal sin for any serious OpenGL backend, IMO.

This was back in the days or the rage128 :)
GL_RECTANGULAR_TEXTURE_NV handles any texture size. ( 137x13 if you like )

pat.

ggambett
12-23-2003, 09:13 AM
Hmmm, it seems I didn't express myself correctly. ZEngine makes all textures powers of 2, but it allocates one texture for each surface, thus wasting texture space.

Your 137x13 image will get a 256x16 texture, wasting 57% of the memory allocated. In that same texture you can store a 119x16 image, for example (I'm sure you know this, I'm detailing it for the benefit of all readers)

And at least for me, one reason to use OpenGL to do 2D graphics is to be able to run the game in low-end machines with an old 3D accelerator. I used to play Jedi Knight with a S3 ViRGE... that's more than enough horsepower to do 2D graphics.

mkovacic
12-23-2003, 09:44 AM
Originally posted by ggambett
Hmmmm....
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, mBPP==32 ? 24 : mBPP); //use 24 if BPP is 32
The color depth and the depth buffer resolution are completely unrelated, right? This library doesn't really inspire much confidence...
There was a range of nVidia D3D drivers that required that the backbuffer (any rendertarget actually) and depthbuffer be of the same depth and size. Don't know about OGL ones, though.

So it could be a compatibility workaround.

aldacron
12-23-2003, 09:45 AM
Originally posted by ggambett
Hmmmm....

SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, mBPP==32 ? 24 : mBPP); //use 24 if BPP is 32

The color depth and the depth buffer resolution are completely unrelated, right? This library doesn't really inspire much confidence...

They aren't entirely unrelated, no. You might not have a 24 bit depth buffer available with a 16 bpp display. When you set the attributes of the pixel format, you are saying 'these are the minimum values I'll accept'. The pixel format you get contain higher values if available, but will fail if the minimum is not available. This code uses sensible values. Basing the depth of the depth buffer upon the depth of the color buffer is not an uncommon practice.

ggambett
12-23-2003, 09:53 AM
OK... my bad... the depth buffer depth and the color buffer depth should be completely unrelated, anyway :D

princec
12-23-2003, 11:05 AM
And a depth buffer is exactly how useful in 2D...?
Myself I can't see the point in a thin layer over OpenGL when they're so simple to write yourself and have absolute control over.

Cas :)

Fenix Down
12-23-2003, 11:12 AM
What depth buffer? Orthographic projection is what you should be using! :p

RTF
12-30-2003, 06:58 PM
It's easy to find libraries that are basically wrappers, especially for OpenGL or SDL....

...what's difficult is finding and then choosing among the few that go any further than that.

Henrik
12-31-2003, 06:35 AM
patrox, GL_RECTANGULAR_TEXTURE_NV is only supported by quite high-end cards and shouldn't be relied on, especially not for indie games. It also carries limitations (no wrapping, no mipmapping, etc).

patrox
12-31-2003, 10:16 AM
well... :rolleyes: happy new year.


pat.
if ( cardCanDoRectangular ) then yeah baby.

princec
01-01-2004, 11:54 AM
(Quick technical note: the Nvidia extension has been superceded by the considerably more useful ARB_texture_non_power_of_two extension which does allow all the things you're expecting it to allow).

Cas :)

Henrik
01-02-2004, 06:38 AM
But there's still no wrapping or mipmapping, is there? I can't really see how mipmapping would work in any reasonable way on nonpow2 textures..