[Y-devel] shapes?
Mikko Rantalainen mira at cc.jyu.fi
Wed Feb 25 14:41:05 GMT 2004
Claude Mench wrote:
>>Let's not repeat the same mistakes the X did and implement real
>>bezier curves instead of only lines, rectangles and axis oriented
>>ellipse. A nice API would have only a line sequence method and a
>>polygon method and both take bezier curves as parameters. Something
>>like how OpenGL draws lines and polygons, but with bezier curves
>>instead of lines between vertexes. Perhaps an option to select
>>border style with a brush.
>>...
>
> Why not consider Cairo as an option. Y relies already on SDL,
> iconv,freetype, another library would not mind. Cairo as an openGl
> backend also.
https://www.cairographics.org/
At first look, it seems that Cairo is quite firmly attached to X
Window System. Do you know if that's going to be a problem? MIT
license should be free enough for us, right?
> But it seems clear that it would be better to choose the drawing
> API before everybody starts writing widgets...
We need at least drawing API wrappers. I think the best way to
continue is to create some widgets and then look for common
graphical elements in those and then create an API that can draw
*similar* elements with any kind of styling we can currently think.
I don't think the backend (SDL, OpenGL, FB, etc) really matters at
this time but one thing is important to understand: we must
represent the features of the backend as it had the best HW support
we can hope for the future. That way we don't repeat the mistakes of
the past and design the API for current technology but for future
one. I think we should first look how OpenGL 2.0 works. Then we
throw out the things that a regular UI doesn't need and keep the
stuff that makes OpenGL forward compatible.
If we decide to have OpenGL as primary backend target, making things
go fast should be pretty easy but extra caution must be taken to
correctly handle *applications* that use OpenGL -- if the graphics
driver uses the same code path for OpenGL application code and Y UI
libraries I can foresee problems with OpenGL context switches and
anti-aliasing between OpenGL "drawing areas" and other applications
unless we can come up with a carefully crafted solution.
During development, I think it would make sense to use OpenGL
backend and Cairo on X Window System (backend for OpenGL and Cairo)
to quickly implement many widgets and have nice HW support (via X).
That way we can easily see if some widgets make sense or not. If
that seems to be a reasonable way, then we can proceed to make some
homegrown code to replace Cairo with something lighter and further
proceed to replace X with real hardware support. Kind of using X as
a graphics driver for OpenGL which is a backend for Cairo which is a
backend for Y widgets. Do you want any layers with that? :D
--
Mikko
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved