[Y-devel] shapes?
Aaron drizzt321 at phpfreaks.com
Wed Feb 25 12:15:23 GMT 2004
Mikko Rantalainen wrote:
>
>> Date: Tue, 24 Feb 2004 12:18:12 -0500
>> From: Aaron <drizzt321 at phpfreaks.com>
>>
>> I don't think anybody has started work on, or thought about shapes,
>> but what about them? I've been poking around trying to figure out how
>> I would implement an ellipse/oval(that and line and rectangle are the
>> base shapes in most places), but I'm having a little bit of trouble
>> seeing where exactly I would fit the pieces together. For example,
>> where exactly would I have the work of putting each pixel on the
>> screen? I think the painter, but I haven't quite gotten how to
>> specifically extend/implement/use it to have it put stuff up on the
>> screen. I would like some guidence from those of you who have been
>> poking around in the source and are more familiar with the APIs and such.
>
>
> 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.
well, I've got the beginnings of an ellipse. I can get it to draw the
outline to the screen, and rotate it. I'm using setPixel currently,
although I also intend to write another function that uses line filling.
It does look pretty rough right now, but I think my next task will be to
add in some AA onto the outline version, and then once everything there
is working well, move to the line fill. I was advised against using a
bezier curve to draw out the ellipse by those who know more about
graphics currently than I do in #y-windows, so perhaps we can have that
as an additional future function for people who want to use them,
instead of just saying give me an ellipse, or give me a rectangle.
> Brush* createBrush(Size* s, Color* c, Model* m);
> creates a brush of some kind. Basic brush could be a round spot, but
> perhaps we could have different models for galligraphic lines or
> something like that.
well, currently there is a setPixel function, which all we have to do is
adjust the properties of the painter object that it uses to paint, or
the uins32_t object(not really sure whats in this one). between those 2
I belive everything about drawing on the screen are controlled such as
color, width, etc. Thats my guess anyway, someone please confirm or
denounce that?
>
> I think many graphics adapters have some HW support for drawing 2D
> bezier curves so the graphics API should expose similar features or
> we'll have unneeded performance problems in the future.
I assume that we will be doing this, however we raen't to the stage of
specific graphics adapter drivers yet, so this is in the future. right
now it seems most people are using the sdl lib driver for development
work, or some are using the fbdev.
>
> Has there been some decisions about the cordinate system used? I hope it
> isn't fixed to pixels so that the UI can easily scale when we have
> 200dpi displays after a couple of years.
>
no clue, I'm sure this will be discussed and decided upon in the near
future.
Aaron
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved