diff options
author | Ton Roosendaal <ton@blender.org> | 2008-12-19 17:14:43 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-12-19 17:14:43 +0300 |
commit | 62a03ea1b6ef84ac80e40ab092393214c6032b88 (patch) | |
tree | b77ebd05c5cceb6eb6d79db65b73f22780fcdd4a /source/blender/editors/screen/area.c | |
parent | 63195b01794e42243b1bcac01de43eccaa89fade (diff) |
2.5
All of the view3d drawing code is now 'Context' free.
The idea is:
- ED_region_do_draw() sets and freezes drawing context
- regiontype draw() callback then can pass on other relevant
context stuff as function args.
Also cleaned up the WM opengl wrappers, to mimic opengl state;
no reason to give window pointer anymore.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index cec34155610..3f7ca19c1f0 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -92,14 +92,13 @@ static void region_draw_emboss(ARegion *ar) glDisable( GL_BLEND ); } -void ED_region_pixelspace(const bContext *C, ARegion *ar) +void ED_region_pixelspace(ARegion *ar) { - wmWindow *win= CTX_wm_window(C); int width= ar->winrct.xmax-ar->winrct.xmin+1; int height= ar->winrct.ymax-ar->winrct.ymin+1; - wmOrtho2(win, -0.375, (float)width-0.375, -0.375, (float)height-0.375); - wmLoadIdentity(win); + wmOrtho2(-0.375, (float)width-0.375, -0.375, (float)height-0.375); + wmLoadIdentity(); } void ED_region_do_listen(ARegion *ar, wmNotifier *note) @@ -149,7 +148,7 @@ void ED_area_overdraw(bContext *C) ScrArea *sa; /* Draw AZones, in screenspace */ - wm_subwindow_set(win, screen->mainwin); + wmSubWindowSet(win, screen->mainwin); glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); @@ -176,7 +175,8 @@ void ED_region_do_draw(bContext *C, ARegion *ar) ScrArea *sa= CTX_wm_area(C); ARegionType *at= ar->type; - wm_subwindow_set(win, ar->swinid); + /* note; this sets state, so we can use wmOrtho and friends */ + wmSubWindowSet(win, ar->swinid); if(ar->swinid && at->draw) { UI_SetTheme(sa); @@ -201,7 +201,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar) region_draw_emboss(ar); /* XXX test: add convention to end regions always in pixel space, for drawing of borders/gestures etc */ - ED_region_pixelspace(C, ar); + ED_region_pixelspace(ar); ar->do_draw= 0; } |