Remember what I was saying about passing in a GraphicsContext to each
graphics call.
This is the sort of thing you run into.
As we add more powerful graphics ops it just gets worse.

Better to just add a single graphics context object with all state
info and we can extend it..

Then we have a single SetContext/GetContext   and  maybe later
postscript style push/pop.

A added advantage of a context is you can often do pipeline set up in
the set call
and you can use a context from another surface without knowing
everything about it.


On Feb 12, 2008 6:33 AM, Denis Oliver Kropp <[EMAIL PROTECTED]> wrote:
> NEERAJ SOLANKI wrote:
> > Hi,
> > I want to draw poly lines using Gtk+ over DirectFB backend.
> > The code i am using, is given below.
> >
> > GdkGCValues values;
> >
> > values.line_width = 15;
> > values.line_style = GDK_LINE_ON_OFF_DASH;
> > values.cap_style = GDK_CAP_ROUND;
> > values.join_style = GDK_JOIN_BEVEL;
> >
> > gdk_gc_set_values (GdkGraphDescPool[gdkGraphDesc].gc, &values,
> > GDK_GC_LINE_WIDTH | GDK_GC_LINE_STYLE | GDK_GC_CAP_STYLE | 
> > GDK_GC_JOIN_STYLE);
> > /*for (i = 0; i < nPoints-1; i++) {
> > gdk_draw_line (GdkImageDescPool[GdkGraphDescPool[gdkGraphDesc].gid].pixmap, 
> > GdkGraphDescPool[gdkGraphDesc].gc, points[i].x, points[i].y, points[i+1].x, 
> > points[i+1].y);
> > }*/
> >
> > gdk_draw_lines(GdkImageDescPool[GdkGraphDescPool[gdkGraphDesc].gid].pixmap,GdkGraphDescPool[gdkGraphDesc].gc,points,
> >  (gint)nPoints);
> >
> >
> > I am facing problem regarding line attributes.
> > The line attributes (e.g. line width, line style, cap style, join style) 
> > that i am setting has no effect on output.
> > For example, line width in the output, is same irrespective of "line_width" 
> > value in the code.
> >
> > I think the setting the attributes of line is not supported in DirectFB.
>
> Sad, but true. It should be in the API at least. A software implementation 
> could
> be done later and should not be enabled by default, like the smooth scaling.
>
> Some ideas (IDirectFBSurface):
>
> - SetLineAttributes( width, style, cap, join )
>
> All in one, or:
>
> - SetLineWidth( width )
> - ...
>
>
> Better all in one, but with extensibility without changing the method(s):
>
> - struct DFBLineAttributes (flags, width, ...)
> - enum DFBLineAttibutesFlags (DLAF_WIDTH,...)
> - SetLineAttributes( const DFBLineAttributes *attributes )
>    (NULL = reset to defaults)
>
> Should unset flags mean 'current' or 'default' value?
>
> --
> Best regards,
>    Denis Oliver Kropp
>
> .------------------------------------------.
> | DirectFB - Hardware accelerated graphics |
> | http://www.directfb.org/                 |
> "------------------------------------------"
>
>
> _______________________________________________
> directfb-dev mailing list
> directfb-dev@directfb.org
> http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
>

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to