Blender V2.61 - r43446
|
Go to the source code of this file.
Classes | |
struct | bglMats |
Typedefs | |
typedef struct gla2DDrawInfo | gla2DDrawInfo |
typedef struct bglMats | bglMats |
Functions | |
void | fdrawbezier (float vec[4][3]) |
void | fdrawline (float x1, float y1, float x2, float y2) |
void | fdrawbox (float x1, float y1, float x2, float y2) |
void | sdrawline (short x1, short y1, short x2, short y2) |
void | sdrawtri (short x1, short y1, short x2, short y2) |
void | sdrawtrifill (short x1, short y1, short x2, short y2) |
void | sdrawbox (short x1, short y1, short x2, short y2) |
void | sdrawXORline (int x0, int y0, int x1, int y1) |
void | sdrawXORline4 (int nr, int x0, int y0, int x1, int y1) |
void | fdrawXORellipse (float xofs, float yofs, float hw, float hh) |
void | fdrawXORcirc (float xofs, float yofs, float rad) |
void | glutil_draw_lined_arc (float start, float angle, float radius, int nsegments) |
void | glutil_draw_filled_arc (float start, float angle, float radius, int nsegments) |
int | glaGetOneInteger (int param) |
float | glaGetOneFloat (int param) |
void | glaRasterPosSafe2f (float x, float y, float known_good_x, float known_good_y) |
void | glaDrawPixelsSafe (float x, float y, int img_w, int img_h, int row_w, int format, int type, void *rect) |
void | glaDrawPixelsTex (float x, float y, int img_w, int img_h, int format, void *rect) |
void | glaDrawPixelsTexScaled (float x, float y, int img_w, int img_h, int format, void *rect, float scaleX, float scaleY) |
void | glaDefine2DArea (struct rcti *screen_rect) |
gla2DDrawInfo * | glaBegin2DDraw (struct rcti *screen_rect, struct rctf *world_rect) |
void | gla2DDrawTranslatePt (gla2DDrawInfo *di, float wo_x, float wo_y, int *sc_x_r, int *sc_y_r) |
void | gla2DDrawTranslatePtv (gla2DDrawInfo *di, float world[2], int screen_r[2]) |
void | glaEnd2DDraw (gla2DDrawInfo *di) |
void | gla2DGetMap (gla2DDrawInfo *di, struct rctf *rect) |
void | gla2DSetMap (gla2DDrawInfo *di, struct rctf *rect) |
void | bglBegin (int mode) |
void | bglEnd (void) |
int | bglPointHack (void) |
void | bglVertex3fv (float *vec) |
void | bglVertex3f (float x, float y, float z) |
void | bglVertex2fv (float *vec) |
void | bglFlush (void) |
void | set_inverted_drawing (int enable) |
void | setlinestyle (int nr) |
void | bglPolygonOffset (float viewdist, float dist) |
void | bgl_get_mats (bglMats *mats) |
Variables | |
unsigned char | stipple_halftone [128] |
unsigned char | stipple_quarttone [128] |
unsigned char | stipple_diag_stripes_pos [128] |
unsigned char | stipple_diag_stripes_neg [128] |
Definition in file BIF_glutil.h.
typedef struct gla2DDrawInfo gla2DDrawInfo |
Definition at line 159 of file BIF_glutil.h.
void bgl_get_mats | ( | bglMats * | mats | ) |
Definition at line 841 of file glutil.c.
References bglMats::modelview, bglMats::projection, and bglMats::viewport.
Referenced by ED_view3d_autodist(), ED_view3d_autodist_simple(), view3d_cached_text_draw_end(), and view3d_zoom_border_exec().
void bglBegin | ( | int | mode | ) |
Definition at line 763 of file glutil.c.
References curmode, and pointhack.
Referenced by bbs_mesh_solid_EM(), bbs_mesh_verts(), bbs_obmode_mesh_verts(), draw_dm_bweights(), draw_dm_face_centers(), draw_dm_verts(), draw_dm_verts__mapFunc(), draw_fcurve_modifier_controls_envelope(), draw_fcurve_vertices_keyframes(), draw_hooks(), draw_object(), draw_uvs(), drawshadbuflimits(), lattice_draw_verts(), tekenvertsN(), and ui_draw_but_CURVE().
void bglEnd | ( | void | ) |
Definition at line 833 of file glutil.c.
References pointhack.
Referenced by bbs_mesh_solid_EM(), bbs_mesh_verts(), bbs_obmode_mesh_verts(), draw_dm_bweights(), draw_dm_face_centers(), draw_dm_verts(), draw_dm_verts__mapFunc(), draw_fcurve_modifier_controls_envelope(), draw_fcurve_vertices_keyframes(), draw_hooks(), draw_object(), draw_uvs(), drawshadbuflimits(), lattice_draw_verts(), tekenvertsN(), and ui_draw_but_CURVE().
void bglPolygonOffset | ( | float | viewdist, |
float | dist | ||
) |
Definition at line 866 of file glutil.c.
References glLoadMatrixf, and offs.
Referenced by draw_ebones(), draw_em_fancy(), draw_mesh_face_select(), draw_mesh_fancy(), draw_object_backbufsel(), draw_pose_bones(), drawWireExtra(), and gp_draw_strokes().
void bglVertex2fv | ( | float * | vec | ) |
Definition at line 819 of file glutil.c.
References curmode, pointhack, and Squaredot.
Referenced by draw_uvs(), and ui_draw_but_CURVE().
void bglVertex3f | ( | float | x, |
float | y, | ||
float | z | ||
) |
void bglVertex3fv | ( | float * | vec | ) |
Definition at line 793 of file glutil.c.
References curmode, pointhack, and Squaredot.
Referenced by bbs_mesh_solid__drawCenter(), bbs_mesh_verts__mapFunc(), bbs_obmode_mesh_verts__mapFunc(), draw_dm_bweights__mapFunc(), draw_dm_face_centers__mapFunc(), draw_dm_verts__mapFunc(), draw_fcurve_vertices_keyframes(), draw_hooks(), draw_object(), drawshadbuflimits(), lattice_draw_verts(), and tekenvertsN().
void fdrawbezier | ( | float | vec[4][3] | ) |
void fdrawbox | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Definition at line 171 of file glutil.c.
Referenced by draw_seq_extensions(), drawlamp(), drawmeta_contents(), file_draw_preview(), node_draw_preview(), ui_draw_but_COLORBAND(), ui_draw_but_CURVE(), and ui_draw_but_HSVCUBE().
void fdrawline | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Definition at line 159 of file glutil.c.
Referenced by ANIM_channel_draw(), area_draw_azone(), draw_nla_channel_list_gl(), draw_nla_main_data(), draw_scope_end(), draw_seq_extensions(), drawcursor_sima(), drawgrid(), nla_draw_strip(), node_draw_hidden(), node_scaling_widget(), outliner_draw_restrictcols(), outliner_draw_rnacols(), outliner_draw_struct_marks(), radial_control_paint_cursor(), seq_draw_sfra_efra(), time_draw_sfra_efra(), ui_draw_aligned_panel(), ui_draw_anti_x(), ui_draw_but_HISTOGRAM(), ui_draw_panel_dragwidget(), ui_draw_panel_scalewidget(), and uiEmboss().
void fdrawXORcirc | ( | float | xofs, |
float | yofs, | ||
float | rad | ||
) |
Definition at line 353 of file glutil.c.
References glutil_draw_lined_arc(), M_PI, and set_inverted_drawing().
void fdrawXORellipse | ( | float | xofs, |
float | yofs, | ||
float | hw, | ||
float | hh | ||
) |
Definition at line 339 of file glutil.c.
References glutil_draw_lined_arc(), M_PI, and set_inverted_drawing().
void gla2DDrawTranslatePt | ( | gla2DDrawInfo * | di, |
float | wo_x, | ||
float | wo_y, | ||
int * | sc_x_r, | ||
int * | sc_y_r | ||
) |
Translate the (wo_x, wo_y) point from world coordinates into screen space.
Definition at line 731 of file glutil.c.
References gla2DDrawInfo::wo_to_sc, gla2DDrawInfo::world_rect, rctf::xmin, and rctf::ymin.
void gla2DDrawTranslatePtv | ( | gla2DDrawInfo * | di, |
float | world[2], | ||
int | screen_r[2] | ||
) |
Translate the world point from world coordiantes into screen space.
Definition at line 736 of file glutil.c.
References gla2DDrawInfo::wo_to_sc, gla2DDrawInfo::world_rect, rctf::xmin, and rctf::ymin.
void gla2DGetMap | ( | gla2DDrawInfo * | di, |
struct rctf * | rect | ||
) |
Adjust the transformation mapping of a 2d area
Definition at line 675 of file glutil.c.
References gla2DDrawInfo::world_rect.
void gla2DSetMap | ( | gla2DDrawInfo * | di, |
struct rctf * | rect | ||
) |
Definition at line 680 of file glutil.c.
References gla2DDrawInfo::screen_rect, gla2DDrawInfo::wo_to_sc, gla2DDrawInfo::world_rect, rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, and rctf::ymin.
gla2DDrawInfo* glaBegin2DDraw | ( | struct rcti * | screen_rect, |
struct rctf * | world_rect | ||
) |
Save the current OpenGL state and initialize OpenGL for 2D rendering. glaEnd2DDraw should be called on the returned structure to free it and to return OpenGL to its previous state. The scissor rectangle is set to match the viewport.
This routine sets up an OpenGL state appropriate for drawing using both vertice (glVertex, etc) and raster (glRasterPos, glRect) commands. All coordinates should be at integer positions. There is little to no reason to use glVertex2f etc. functions during 2D rendering, and thus no reason to +-0.5 the coordinates or perform other silly tricks.
screen_rect | The screen rectangle to be used for 2D drawing. |
world_rect | The world rectangle that the 2D area represented by screen_rect is supposed to represent. If NULL it is assumed the world has a 1 to 1 mapping to the screen. |
Definition at line 697 of file glutil.c.
References glaDefine2DArea(), MEM_mallocN(), gla2DDrawInfo::orig_projmat, gla2DDrawInfo::orig_sc, gla2DDrawInfo::orig_viewmat, gla2DDrawInfo::orig_vp, gla2DDrawInfo::screen_rect, gla2DDrawInfo::wo_to_sc, gla2DDrawInfo::world_rect, rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, and rctf::ymin.
void glaDefine2DArea | ( | struct rcti * | screen_rect | ) |
Define a 2D area (viewport, scissor, matrices) for OpenGL rendering. This routine sets up an OpenGL state appropriate for drawing using both vertice (glVertex, etc) and raster (glRasterPos, glRect) commands. All coordinates should be at integer positions. There is little to no reason to use glVertex2f etc. functions during 2D rendering, and thus no reason to +-0.5 the coordinates or perform other silly tricks.
screen_rect | The screen rectangle to be defined for 2D drawing. |
Definition at line 642 of file glutil.c.
References rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by draw_nodespace_back_pix(), and glaBegin2DDraw().
void glaDrawPixelsSafe | ( | float | x, |
float | y, | ||
int | img_w, | ||
int | img_h, | ||
int | row_w, | ||
int | format, | ||
int | type, | ||
void * | rect | ||
) |
Functions like a limited glDrawPixels, except ensures that the image is displayed onscreen even if the x and y coordinates for would be clipped. The routine respects the glPixelZoom values, pixel unpacking parameters are _not_ respected.
Definition at line 562 of file glutil.c.
References glaGetOneFloat(), glaGetOneInteger(), glaRasterPosSafe2f(), MAX2, and MIN2.
Referenced by draw_image_buffer(), draw_image_buffer_tiled(), draw_image_paint_helpers(), draw_movieclip_buffer(), draw_nodespace_back_pix(), ed_preview_draw_rect(), icon_draw_rect(), sima_draw_alpha_pixels(), sima_draw_alpha_pixelsf(), sima_draw_zbuf_pixels(), sima_draw_zbuffloat_pixels(), ui_draw_but_IMAGE(), and ui_draw_but_TRACKPREVIEW().
void glaDrawPixelsTex | ( | float | x, |
float | y, | ||
int | img_w, | ||
int | img_h, | ||
int | format, | ||
void * | rect | ||
) |
Functions like a limited glDrawPixels, but actually draws the image using textures, which can be tremendously faster on low-end cards, and also avoids problems with the raster position being clipped when offscreen. The routine respects the glPixelZoom values, pixel unpacking parameters are _not_ respected.
Definition at line 557 of file glutil.c.
References glaDrawPixelsTexScaled().
Referenced by draw_bgpic(), draw_empty_image(), and node_draw_preview().
void glaDrawPixelsTexScaled | ( | float | x, |
float | y, | ||
int | img_w, | ||
int | img_h, | ||
int | format, | ||
void * | rect, | ||
float | scaleX, | ||
float | scaleY | ||
) |
Definition at line 454 of file glutil.c.
References get_cached_work_texture(), GL_CLAMP_TO_EDGE, glaGetOneFloat(), and glaGetOneInteger().
Referenced by file_draw_preview(), glaDrawPixelsTex(), and wm_drags_draw().
void glaEnd2DDraw | ( | gla2DDrawInfo * | di | ) |
Definition at line 742 of file glutil.c.
References glLoadMatrixf, MEM_freeN(), gla2DDrawInfo::orig_projmat, gla2DDrawInfo::orig_viewmat, and gla2DDrawInfo::orig_vp.
float glaGetOneFloat | ( | int | param | ) |
Routines a float value as obtained by glGetIntegerv. The param must cause only one value to be gotten from GL.
Definition at line 401 of file glutil.c.
Referenced by glaDrawPixelsSafe(), and glaDrawPixelsTexScaled().
int glaGetOneInteger | ( | int | param | ) |
Routines an integer value as obtained by glGetIntegerv. The param must cause only one value to be gotten from GL.
Definition at line 394 of file glutil.c.
References i.
Referenced by draw_image_seq(), get_cached_work_texture(), glaDrawPixelsSafe(), and glaDrawPixelsTexScaled().
void glaRasterPosSafe2f | ( | float | x, |
float | y, | ||
float | known_good_x, | ||
float | known_good_y | ||
) |
Functions like glRasterPos2i, except ensures that the resulting raster position is valid. known_good_x and known_good_y should be coordinates of a point known to be within the current view frustum.
Definition at line 408 of file glutil.c.
Referenced by glaDrawPixelsSafe().
void glutil_draw_filled_arc | ( | float | start, |
float | angle, | ||
float | radius, | ||
int | nsegments | ||
) |
Draw a filled arc with the given radius, starting at angle start and arcing through angle. The arc is centered at the origin and drawn in the XY plane.
start | The initial angle (in radians). |
angle | The length of the arc (in radians). |
radius | The arc radius. |
nsegments | The number of segments to use in drawing the arc. |
Definition at line 365 of file glutil.c.
References angle(), cosf, i, and sinf.
Referenced by radial_control_paint_tex(), ui_hsv_cursor(), and wm_gesture_draw_circle().
void glutil_draw_lined_arc | ( | float | start, |
float | angle, | ||
float | radius, | ||
int | nsegments | ||
) |
Draw a lined (non-looping) arc with the given radius, starting at angle start and arcing through angle. The arc is centered at the origin and drawn in the XY plane.
start | The initial angle (in radians). |
angle | The length of the arc (in radians). |
radius | The arc radius. |
nsegments | The number of segments to use in drawing the arc. |
Definition at line 380 of file glutil.c.
References angle(), cosf, i, and sinf.
Referenced by brush_drawcursor(), fdrawXORcirc(), fdrawXORellipse(), paint_draw_cursor(), radial_control_paint_cursor(), ui_draw_but_HSVCIRCLE(), ui_draw_but_NORMAL(), ui_hsv_cursor(), and wm_gesture_draw_circle().
void sdrawbox | ( | short | x1, |
short | y1, | ||
short | x2, | ||
short | y2 | ||
) |
Definition at line 238 of file glutil.c.
Referenced by wm_gesture_draw_rect().
void sdrawline | ( | short | x1, |
short | y1, | ||
short | x2, | ||
short | y2 | ||
) |
Definition at line 191 of file glutil.c.
Referenced by draw_dividers(), drawcursor(), drawscredge_area_draw(), ED_screen_draw(), paint_draw_smooth_stroke(), region_draw_azone_icon(), region_draw_emboss(), ui_draw_separator(), wm_gesture_draw_cross(), and wm_gesture_draw_line().
void sdrawtri | ( | short | x1, |
short | y1, | ||
short | x2, | ||
short | y2 | ||
) |
Definition at line 224 of file glutil.c.
References sdrawtripoints().
void sdrawtrifill | ( | short | x1, |
short | y1, | ||
short | x2, | ||
short | y2 | ||
) |
Definition at line 231 of file glutil.c.
References sdrawtripoints().
void sdrawXORline | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1 | ||
) |
Definition at line 284 of file glutil.c.
References set_inverted_drawing().
void sdrawXORline4 | ( | int | nr, |
int | x0, | ||
int | y0, | ||
int | x1, | ||
int | y1 | ||
) |
Definition at line 298 of file glutil.c.
References set_inverted_drawing().
void set_inverted_drawing | ( | int | enable | ) |
Definition at line 277 of file glutil.c.
References glToggle.
Referenced by draw_object(), draw_textcurs(), drawPropCircle(), fdrawXORcirc(), fdrawXORellipse(), sdrawXORline(), and sdrawXORline4().
void setlinestyle | ( | int | nr | ) |
Definition at line 261 of file glutil.c.
Referenced by draw_ebones(), draw_fcurve_modifier_controls_envelope(), draw_forcefield(), draw_hooks(), draw_image_seq(), draw_marker(), draw_mesh_face_select(), draw_new_particle_system(), draw_object(), draw_pose_bones(), draw_uvs(), drawConstraint(), drawcursor(), drawcursor_sima(), drawgrid(), drawHelpline(), drawlamp(), drawLine(), drawRBpivot(), drawtexspace(), drawviewborder(), gp_draw_data(), gp_draw_stroke_buffer(), graph_draw_curves(), graph_draw_ghost_curves(), nla_draw_strip(), pchan_draw_IK_root_lines(), and ui_draw_but_COLORBAND().
unsigned char stipple_diag_stripes_neg[128] |
Definition at line 112 of file glutil.c.
Referenced by draw_seq_strip().
unsigned char stipple_diag_stripes_pos[128] |
Definition at line 93 of file glutil.c.
Referenced by draw_seq_strip().
unsigned char stipple_halftone[128] |
Definition at line 56 of file glutil.c.
Referenced by console_draw_sel(), draw_shadedstrip(), and drawmeta_stipple().
unsigned char stipple_quarttone[128] |