[Freeciv-Dev] Re: Using opengl in ftwl
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Mar 24, 2005 at 06:33:07PM +0000, Per Inge Mathisen wrote:
> I'm looking at how hard it would be to combine what I am working on with
> OpenGL with the ftwl client. Here are some thoughts.
>
> For OpenGL I would upload every graphics element as a texture to video
> memory. These would then be drawn onto the video memory back buffer. The
> z-dimension indicates the drawing order. Freeciv's built-in double buffer
> would be skipped.
>
> ftwl has a z-dimension for windows, which is nice. However, ftwl uses a
> 'pixel buffer' method for drawing which is hard to use with OpenGL. The
> changes necessary to fix this may not be very large, though. All we need
> is to turn the 'off-screen drawing area' which is blitted onto a final
> composite in a z-order into an 'on-screen drawing area with a
> z-dimension'.
Any idea how this can be done?
> This means we need a clear separation and abstraction between unchangable
> graphics sources (textures) and the destination (the OpenGL back buffer).
> In ftwl this separation is not yet present.
>
> The functions be_copy_osda_to_osda() and be_is_transparent_pixel() would
> have to be removed. Where the former is used to draw graphics,
> be_draw_sprite() should be used instead. There are some uses I just do not
> understand.
be_copy_osda_to_osda is used for example in the list widget. A list is
a container. All elements in the container are drawn to a windows (and
so to an OSDA) which is not shown. Than part of this windows is used
to represent the list widget.
In general: a window widget has a OSDA as the backing store. All
elements of the window draw on this. The window than may draw into the
parent backing store. There is a root window.
No idea how this can be supported with opengl.
> Whenever it is used draw into the ftwl back buffer, this
> should back buffer should not be just any osda, but be handled specially,
> so that OpenGL can draw into the OpenGL back buffer instead.
> The code using be_is_transparent_pixel() needs a different mechanic
> altogether (it is used to find click-throughs on windows).
How?
> be_multiply_alphas() needs to be combined with be_crop_sprite(), as it is
> already in the Freeciv common code, since that has to be done before the
> graphics is uploaded as a texture, which would typically be done in
> be_crop_sprite().
This sounds like the easiest problem.
Raimar
--
email: i-freeciv-lists@xxxxxxxxxxxxx
"We just typed make..."
-- Stephen Lambrigh, Director of Server Product Marketing at Informix,
about porting their Database to Linux
|
|