diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-10 18:39:26 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-10 18:39:26 +0300 |
commit | 4eb6b35926c5481714848bcdfa5bcf228ecb609e (patch) | |
tree | c6e43fffe929a3722c03bedd2c8a9737020fc9fe | |
parent | 0d8b701e2570d4f47c65514df09590d415622f0b (diff) |
Use an enum for enabled GPU Fx
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 2 | ||||
-rw-r--r-- | source/blender/gpu/GPU_compositing.h | 3 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_compositing.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpu_types.h | 6 |
5 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 4facb2fc6e8..cb8a3eb854d 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -64,6 +64,7 @@ struct wmWindow; struct GPUFX; struct GPUOffScreen; struct GPUFXOptions; +enum GPUFxFlags; /* for derivedmesh drawing callbacks, for view3d_select, .... */ typedef struct ViewContext { @@ -307,7 +308,7 @@ int ED_view3d_scene_layer_set(int lay, const int *values, int *active); bool ED_view3d_context_activate(struct bContext *C); void ED_view3d_draw_offscreen_init(struct Scene *scene, struct View3D *v3d); void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int winx, int winy, float viewmat[4][4], - float winmat[4][4], bool do_bgpic, bool do_sky, struct GPUFX *fx, bool is_persp, struct GPUOffScreen *ofs, struct GPUFXOptions *fxoptions, int fxflags); + float winmat[4][4], bool do_bgpic, bool do_sky, struct GPUFX *fx, bool is_persp, struct GPUOffScreen *ofs, struct GPUFXOptions *fxoptions, enum GPUFxFlags fxflags); struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag, bool draw_background, int alpha_mode, char err_out[256]); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 7c80c71da28..63890ba4a3d 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -3052,7 +3052,7 @@ static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar, bool */ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, float viewmat[4][4], float winmat[4][4], - bool do_bgpic, bool do_sky, GPUFX *fx, bool is_persp, GPUOffScreen *ofs, GPUFXOptions *fxoptions, int fxflags) + bool do_bgpic, bool do_sky, GPUFX *fx, bool is_persp, GPUOffScreen *ofs, GPUFXOptions *fxoptions, GPUFxFlags fxflags) { struct bThemeState theme_state; int bwinx, bwiny; diff --git a/source/blender/gpu/GPU_compositing.h b/source/blender/gpu/GPU_compositing.h index cc00185075c..fe2bc5b5660 100644 --- a/source/blender/gpu/GPU_compositing.h +++ b/source/blender/gpu/GPU_compositing.h @@ -45,6 +45,7 @@ struct RegionView3D; struct rcti; struct Scene; struct View3D; +enum GPUFXFlags; /**** Public API *****/ @@ -70,7 +71,7 @@ GPUFX *GPU_create_fx_compositor(void); void GPU_destroy_fx_compositor(GPUFX *fx); /* initialize a framebuffer with size taken from the viewport */ -bool GPU_initialize_fx_passes(GPUFX *fx, struct rcti *rect, rcti *scissor_rect, int fxflags, struct GPUFXOptions *options); +bool GPU_initialize_fx_passes(GPUFX *fx, struct rcti *rect, rcti *scissor_rect, enum GPUFxFlags fxflags, struct GPUFXOptions *options); /* do compositing on the fx passes that have been initialized */ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, struct Scene *scene, struct GPUOffScreen *ofs); diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c index 73c4a31d73d..9dabbb3140e 100644 --- a/source/blender/gpu/intern/gpu_compositing.c +++ b/source/blender/gpu/intern/gpu_compositing.c @@ -253,7 +253,7 @@ static GPUTexture * create_jitter_texture(void) } -bool GPU_initialize_fx_passes(GPUFX *fx, rcti *rect, rcti *scissor_rect, int fxflags, GPUFXOptions *options) +bool GPU_initialize_fx_passes(GPUFX *fx, rcti *rect, rcti *scissor_rect, GPUFxFlags fxflags, GPUFXOptions *options) { int w = BLI_rcti_size_x(rect) + 1, h = BLI_rcti_size_y(rect) + 1; char err_out[256]; diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h index 2874a3c5833..d889687ec8a 100644 --- a/source/blender/makesdna/DNA_gpu_types.h +++ b/source/blender/makesdna/DNA_gpu_types.h @@ -57,7 +57,9 @@ typedef struct GPUFXOptions { /* shaderfx enables */ -#define GPU_FX_DEPTH_OF_FIELD 1 -#define GPU_FX_SSAO (1 << 1) +typedef enum GPUFxFlags{ + GPU_FX_DEPTH_OF_FIELD = 1, + GPU_FX_SSAO = (1 << 1) +} GPUFxFlags; #endif |