X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fopengl.c;h=076eefbf45364fbaa9101e09417c4072c773698d;hb=d4e0ae0071722b1cc50bfc41fe64066783aa24a5;hp=366f24934bddcf153ea686b6821e4e28973bd33a;hpb=d3fb559b6b8ca9c122b310cae1a3e8b0805f97ad;p=swftools.git diff --git a/lib/devices/opengl.c b/lib/devices/opengl.c index 366f249..076eefb 100644 --- a/lib/devices/opengl.c +++ b/lib/devices/opengl.c @@ -16,7 +16,8 @@ #include //#define ZSTEP (1/65536.0) -#define ZSTEP (1/4.0) +#define ZSTEP (1/32.0) +//#define ZSTEP (1/4.0) typedef struct _fontlist { gfxfont_t*font; @@ -67,12 +68,12 @@ void CALLBACK errorCallback(GLenum errorCode) { const GLubyte *estring; estring = gluErrorString(errorCode); - dbg("Tessellation Error: %s\n", estring); + printf("Tessellation Error: %s\n", estring); exit(0); } void CALLBACK beginCallback(GLenum which) { - glBegin(which); + glBegin(which); } void CALLBACK endCallback(void) { @@ -263,7 +264,8 @@ void opengl_fill(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color) double z; dbg("fill"); internal_t*i = (internal_t*)dev->internal; - + + glDisable(GL_TEXTURE_2D); glColor4f(color->r/255.0, color->g/255.0, color->b/255.0, color->a/255.0); i->currentz ++; @@ -492,8 +494,10 @@ void opengl_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*co l = l->next; } if(i->font == 0) { - fprintf(stderr, "Unknown font id: %s", font->id); - return; + opengl_addfont(dev, font); + i->font = font; + //fprintf(stderr, "Unknown font id: %s", font->id); + //return; } } @@ -511,7 +515,7 @@ void opengl_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*co -void opengl_drawlink(struct _gfxdevice*dev, gfxline_t*line, char*action) +void opengl_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) { dbg("link"); } @@ -521,12 +525,12 @@ void opengl_endpage(struct _gfxdevice*dev) dbg("endpage"); } -int opengl_result_save(struct _gfxresult*gfx, char*filename) +int opengl_result_save(struct _gfxresult*gfx, const char*filename) { dbg("result:save"); return 0; } -void* opengl_result_get(struct _gfxresult*gfx, char*name) +void* opengl_result_get(struct _gfxresult*gfx, const char*name) { dbg("result:get"); return 0; @@ -580,7 +584,7 @@ void gfxdevice_opengl_init(gfxdevice_t*dev) gluTessCallback(i->tesselator, GLU_TESS_VERTEX, (callbackfunction_t)vertexCallback); gluTessCallback(i->tesselator, GLU_TESS_BEGIN, (callbackfunction_t)beginCallback); gluTessCallback(i->tesselator, GLU_TESS_END, (callbackfunction_t)endCallback); - //gluTessCallback(i->tesselator, GLU_TESS_COMBINE, (callbackfunction_t)combineCallback); + gluTessCallback(i->tesselator, GLU_TESS_COMBINE, (callbackfunction_t)combineCallback); i->tesselator_line = gluNewTess(); gluTessCallback(i->tesselator_line, GLU_TESS_ERROR, (callbackfunction_t)errorCallback);