5 #include "../gfxdevice.h"
6 #include "../gfxtools.h"
14 typedef struct _fontlist {
17 struct _fontlist*next;
20 typedef struct _internal {
27 int opengl_setparameter(struct _gfxdevice*dev, const char*key, const char*value)
32 void opengl_startpage(struct _gfxdevice*dev, int width, int height)
34 internal_t*i = (internal_t*)dev->internal;
39 void opengl_startclip(struct _gfxdevice*dev, gfxline_t*line)
43 glColor3f(1.0,1.0,1.0);
45 glVertex3f(-t*10,-t*10,0);
46 glVertex3f(-t*10,t*10,0);
47 glVertex3f(t*10,t*10,0);
48 glVertex3f(t*10,-t*10,0);
51 //glRectf(-50,-50,0.0,0.0);
54 void opengl_endclip(struct _gfxdevice*dev)
58 void opengl_stroke(struct _gfxdevice*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit)
62 void opengl_fill(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color)
66 void opengl_fillbitmap(struct _gfxdevice*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform)
70 void opengl_fillgradient(struct _gfxdevice*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix)
74 void opengl_addfont(struct _gfxdevice*dev, char*fontid, gfxfont_t*font)
78 void opengl_drawchar(struct _gfxdevice*dev, char*fontid, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix)
82 void opengl_drawlink(struct _gfxdevice*dev, gfxline_t*line, char*action)
86 void opengl_endpage(struct _gfxdevice*dev)
91 int opengl_result_save(struct _gfxresult*gfx, char*filename)
95 void* opengl_result_get(struct _gfxresult*gfx, char*name)
99 void opengl_result_destroy(struct _gfxresult*gfx)
104 gfxresult_t*opengl_finish(struct _gfxdevice*dev)
106 internal_t*i = (internal_t*)dev->internal;
107 gfxresult_t*result = (gfxresult_t*)malloc(sizeof(gfxresult_t));
108 memset(result, 0, sizeof(gfxresult_t));
109 result->save = opengl_result_save;
110 result->get = opengl_result_get;
111 result->destroy = opengl_result_destroy;
115 void gfxdevice_opengl_init(gfxdevice_t*dev)
117 internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t));
118 memset(dev, 0, sizeof(gfxdevice_t));
122 dev->setparameter = opengl_setparameter;
123 dev->startpage = opengl_startpage;
124 dev->startclip = opengl_startclip;
125 dev->endclip = opengl_endclip;
126 dev->stroke = opengl_stroke;
127 dev->fill = opengl_fill;
128 dev->fillbitmap = opengl_fillbitmap;
129 dev->fillgradient = opengl_fillgradient;
130 dev->addfont = opengl_addfont;
131 dev->drawchar = opengl_drawchar;
132 dev->drawlink = opengl_drawlink;
133 dev->endpage = opengl_endpage;
134 dev->finish = opengl_finish;