diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-20 13:56:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-20 14:32:36 +0300 |
commit | ed0c9654ddfdcbe19d8094d4b4a43f0f06d9ee5c (patch) | |
tree | 3a4525b615c9c497127ff9184ecd6683b9625483 /source/blender/editors/include/BIF_glutil.h | |
parent | 3d26d1938a1e9088ca3962a0c7b615903118b138 (diff) |
Cleanup: remove unused OpenGL functions, rename some for clarity
Diffstat (limited to 'source/blender/editors/include/BIF_glutil.h')
-rw-r--r-- | source/blender/editors/include/BIF_glutil.h | 104 |
1 files changed, 41 insertions, 63 deletions
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index a2e8d6afd4b..c30674907da 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -32,35 +32,6 @@ struct ColorManagedViewSettings; struct ImBuf; struct bContext; -/* A few functions defined here are being DEPRECATED for Blender 2.8 - * - * Do not use them in new code, and you are encouraged to - * convert existing code to draw without these. - * - * These will be deleted before we ship 2.8! - * - merwin - */ - -/** - * Returns a float value as obtained by glGetFloatv. - * The param must cause only one value to be gotten from GL. - */ -float glaGetOneFloat(int param); -int glaGetOneInt(int param); - -/** - * Functions like glRasterPos2i, except ensures that the resulting - * raster position is valid. \a known_good_x and \a known_good_y - * should be coordinates of a point known to be within the current - * view frustum. - * \attention This routine should be used when the distance of \a x - * and \a y away from the known good point is small (ie. for small icons - * and for bitmap characters), when drawing large+zoomed images it is - * possible for overflow to occur, the glaDrawPixelsSafe routine should - * be used instead. - */ -void glaRasterPosSafe2f(float x, float y, float known_good_x, float known_good_y); - typedef struct IMMDrawPixelsTexState { struct GPUShader *shader; unsigned int pos; @@ -148,29 +119,47 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, float yzoom, float color[4]); -void set_inverted_drawing(int enable); - -/* own working polygon offset */ -float bglPolygonOffsetCalc(const float winmat[16], float viewdist, float dist); -void bglPolygonOffset(float viewdist, float dist); - -/* **** Color management helper functions for GLSL display/transform ***** */ - -/* Draw imbuf on a screen, preferably using GLSL display transform */ -void glaDrawImBuf_glsl(struct ImBuf *ibuf, +/* Image buffer drawing functions, with display transform + * + * The view and display settings can either be specified manually, or retrived + * from the context with the _ctx variations. + * + * For better performance clipping coordinates can be specified so parts of the + * image outside the view are skipped. */ + +void ED_draw_imbuf(struct ImBuf *ibuf, + float x, + float y, + int zoomfilter, + struct ColorManagedViewSettings *view_settings, + struct ColorManagedDisplaySettings *display_settings, + float zoom_x, + float zoom_y); +void ED_draw_imbuf_clipping(struct ImBuf *ibuf, + float x, + float y, + int zoomfilter, + struct ColorManagedViewSettings *view_settings, + struct ColorManagedDisplaySettings *display_settings, + float clip_min_x, + float clip_min_y, + float clip_max_x, + float clip_max_y, + float zoom_x, + float zoom_y); + +void ED_draw_imbuf_ctx(const struct bContext *C, + struct ImBuf *ibuf, float x, float y, int zoomfilter, - struct ColorManagedViewSettings *view_settings, - struct ColorManagedDisplaySettings *display_settings, float zoom_x, float zoom_y); -void glaDrawImBuf_glsl_clipping(struct ImBuf *ibuf, +void ED_draw_imbuf_ctx_clipping(const struct bContext *C, + struct ImBuf *ibuf, float x, float y, int zoomfilter, - struct ColorManagedViewSettings *view_settings, - struct ColorManagedDisplaySettings *display_settings, float clip_min_x, float clip_min_y, float clip_max_x, @@ -178,25 +167,14 @@ void glaDrawImBuf_glsl_clipping(struct ImBuf *ibuf, float zoom_x, float zoom_y); -/* Draw imbuf on a screen, preferably using GLSL display transform */ -void glaDrawImBuf_glsl_ctx(const struct bContext *C, - struct ImBuf *ibuf, - float x, - float y, - int zoomfilter, - float zoom_x, - float zoom_y); -void glaDrawImBuf_glsl_ctx_clipping(const struct bContext *C, - struct ImBuf *ibuf, - float x, - float y, - int zoomfilter, - float clip_min_x, - float clip_min_y, - float clip_max_x, - float clip_max_y, - float zoom_x, - float zoom_y); +/* OpenGL drawing utility functions. Do not use these in new code, these + * are intended to be moved or removed in the future. */ + +void set_inverted_drawing(int enable); + +/* own working polygon offset */ +float bglPolygonOffsetCalc(const float winmat[16], float viewdist, float dist); +void bglPolygonOffset(float viewdist, float dist); void immDrawBorderCorners(unsigned int pos, const struct rcti *border, float zoomx, float zoomy); |