Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] Re: (PR#7124) [FS] Drawing abstraction layer for OpenGL
Home

[Freeciv-Dev] Re: (PR#7124) [FS] Drawing abstraction layer for OpenGL

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#7124) [FS] Drawing abstraction layer for OpenGL
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Tue, 3 Feb 2004 12:53:19 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7124 >

On Mon, Feb 02, 2004 at 01:59:53PM -0800, Vasco Alexandre da Silva Costa wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7124 >
> 
> On Mon, 2 Feb 2004, Raimar Falke wrote:
> 
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=7124 >
> >
> > On Sat, Dec 20, 2003 at 10:53:20AM -0800, Raimar Falke wrote:
> >
> > X11 without extensions as a backend is quite slow if transparency is
> > used. OpenGL may be an alternative here. Note that OpenGL is used here
> > only for 2D drawing. Not 3D stuff even when OpenGL was designed for
> > this.
> >
> > I haven't coded any OpenGL applications till now except some 5 liner
> > in Python. So I want to ask about some general concepts.
> >
> > I know that GLUT is an abstraction on the things which are around the
> > actual OpenGL context like events and window management. GLX is the
> > interface between OpenGL and X11 and as such a more specialized
> > alternative to GLUT. GLUT has no events but callbacks. This is not
> > compatible with the general design of the FS client. It looks like I
> > will for now use OpenGL+GLX+X11. Bad?
> 
> GLUT is too constrained for anything but quick prototypes. GLX is too
> X11 specific. I advise you to use SDL+OpenGL. Many games use this
> combination.

SDL has no good event handling. Choosing SDL for this isn't a good
choice IMHO.

> > plan to use call-lists here. Each drawing opertion will create a
> > call-lists which will queue the drawing primitive. Than these
> > call-lists are recursively executed when actual drawing is requested.
> 
> Usually OpenGL applications have a datastructure in memory which
> represents the scene. Every time a scene needs to be refreshed or drawn, a
> function is called which traverses this datastructure and draws the
> enviroment.

Yes so far I understood it also.

> Fixed bitmaps are stored in the graphics card memory. If they don't
> fit, texture management must be used as well.

I tested ;) Allocating textures in a while(1) loop. I expected that an
OpenGL function returns GL_OUT_OF_MEMORY. No. The X server grows till
the swap is gone and the kernel kills it. See also
glPrioritizeTextures.

> > Bitmaps (sprites, rendered text) have to be transferred to the
> > server. There are several alternatives: glBitmap, glDrawPixels and
> > textures. I only have the feeling that OpenGL may scale textures and
> > so blur it. Any advise on this issue?
> 
> Yes, OpenGL scales textures. Hence the need for things like bilinear
> filtering, etc. OpenGL supports these features. You have to remember that
> in 3D graphics the position of the camera can vary and things will
> need to be scaled/rotated.
> 
> For text and other variable/peculiar bitmaps, you probably should use
> glDrawPixels to superimpose it over the rest of the graphics.

I used textures for now. At least till now I can't see that the small
text gets blurred by filtering.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I haven't lost my mind - it's backed up on tape somewhere."




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