Blender V2.61 - r43446

BIF_glutil.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * Contributor(s): Blender Foundation 2002-2008
00022  *
00023  * ***** END GPL LICENSE BLOCK *****
00024  */
00025 
00030 #ifndef BIF_GLUTIL_H
00031 #define BIF_GLUTIL_H
00032 
00033 struct rcti;
00034 struct rctf;
00035 
00036 void fdrawbezier(float vec[4][3]);
00037 void fdrawline(float x1, float y1, float x2, float y2);
00038 void fdrawbox(float x1, float y1, float x2, float y2);
00039 void sdrawline(short x1, short y1, short x2, short y2);
00040 void sdrawtri(short x1, short y1, short x2, short y2);
00041 void sdrawtrifill(short x1, short y1, short x2, short y2);
00042 void sdrawbox(short x1, short y1, short x2, short y2);
00043 
00044 void sdrawXORline(int x0, int y0, int x1, int y1);
00045 void sdrawXORline4(int nr, int x0, int y0, int x1, int y1);
00046 
00047 void fdrawXORellipse(float xofs, float yofs, float hw, float hh);
00048 void fdrawXORcirc(float xofs, float yofs, float rad);
00049 
00050 /* glStipple defines */
00051 extern unsigned char stipple_halftone[128];
00052 extern unsigned char stipple_quarttone[128];
00053 extern unsigned char stipple_diag_stripes_pos[128];
00054 extern unsigned char stipple_diag_stripes_neg[128];
00055 
00067 void glutil_draw_lined_arc  (float start, float angle, float radius, int nsegments);
00068 
00080 void glutil_draw_filled_arc (float start, float angle, float radius, int nsegments);
00081 
00086 int glaGetOneInteger        (int param);
00087 
00092 float glaGetOneFloat        (int param);
00093 
00105 void glaRasterPosSafe2f     (float x, float y, float known_good_x, float known_good_y);
00106 
00126 void glaDrawPixelsSafe      (float x, float y, int img_w, int img_h, int row_w, int format, int type, void *rect);
00127 
00141 void glaDrawPixelsTex       (float x, float y, int img_w, int img_h, int format, void *rect);
00142 
00143 void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, void *rect, float scaleX, float scaleY);
00144 
00145     /* 2D Drawing Assistance */
00146 
00157 void glaDefine2DArea        (struct rcti *screen_rect);
00158 
00159 typedef struct gla2DDrawInfo gla2DDrawInfo;
00160 
00178 gla2DDrawInfo*  glaBegin2DDraw          (struct rcti *screen_rect, struct rctf *world_rect);
00179 
00181 void            gla2DDrawTranslatePt    (gla2DDrawInfo *di, float wo_x, float wo_y, int *sc_x_r, int *sc_y_r);
00182 
00184 void            gla2DDrawTranslatePtv   (gla2DDrawInfo *di, float world[2], int screen_r[2]);
00185 
00186     /* Restores the previous OpenGL state and free's the auxilary
00187      * gla data.
00188      */
00189 void            glaEnd2DDraw            (gla2DDrawInfo *di);
00190 
00192 void gla2DGetMap(gla2DDrawInfo *di, struct rctf *rect);
00193 void gla2DSetMap(gla2DDrawInfo *di, struct rctf *rect);
00194 
00195 
00196 /* use this for platform hacks. glPointSize is solved here */
00197 void bglBegin(int mode);
00198 void bglEnd(void);
00199 int bglPointHack(void);
00200 void bglVertex3fv(float *vec);
00201 void bglVertex3f(float x, float y, float z);
00202 void bglVertex2fv(float *vec);
00203 /* intel gfx cards frontbuffer problem */
00204 void bglFlush(void);
00205 void set_inverted_drawing(int enable);
00206 void setlinestyle(int nr);
00207 
00208 /* own working polygon offset */
00209 void bglPolygonOffset(float viewdist, float dist);
00210 
00211 /* For caching opengl matrices (gluProject/gluUnProject) */
00212 typedef struct bglMats {
00213     double modelview[16];
00214     double projection[16];
00215     int viewport[4];
00216 } bglMats;
00217 void bgl_get_mats(bglMats *mats);
00218 
00219 #endif /* BIF_GLUTIL_H */
00220