Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/workspace/screen_draw.c
- This file was moved from source/blender/editors/screen/screen_draw.c.
| Show All 12 Lines | |||||
| * | * | ||||
| * You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
| * along with this program; if not, write to the Free Software Foundation, | * along with this program; if not, write to the Free Software Foundation, | ||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file blender/editors/screen/screen_draw.c | /** \file blender/editors/workspace/screen_draw.c | ||||
| * \ingroup edscr | * \ingroup edworkspace | ||||
| */ | */ | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "GPU_framebuffer.h" | #include "GPU_framebuffer.h" | ||||
| #include "GPU_immediate.h" | #include "GPU_immediate.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| ▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | static void drawscredge_area(ScrArea *sa, int sizex, int sizey) | ||||
| drawscredge_area_draw(sizex, sizey, x1, y1, x2, y2); | drawscredge_area_draw(sizex, sizey, x1, y1, x2, y2); | ||||
| } | } | ||||
| /** | /** | ||||
| * Only for edge lines between areas, and the blended join arrows. | * Only for edge lines between areas, and the blended join arrows. | ||||
| */ | */ | ||||
| void ED_screen_draw(wmWindow *win) | void ED_screen_draw(wmWindow *win) | ||||
| { | { | ||||
| bScreen *screen = WM_window_get_active_screen(win); | |||||
| const int winsize_x = WM_window_pixels_x(win); | const int winsize_x = WM_window_pixels_x(win); | ||||
| const int winsize_y = WM_window_pixels_y(win); | const int winsize_y = WM_window_pixels_y(win); | ||||
| ScrArea *sa; | ScrArea *sa; | ||||
| ScrArea *sa1 = NULL; | ScrArea *sa1 = NULL; | ||||
| ScrArea *sa2 = NULL; | ScrArea *sa2 = NULL; | ||||
| ScrArea *sa3 = NULL; | ScrArea *sa3 = NULL; | ||||
| wmSubWindowSet(win, win->screen->mainwin); | wmSubWindowSet(win, screen->mainwin); | ||||
| /* Note: first loop only draws if U.pixelsize > 1, skip otherwise */ | /* Note: first loop only draws if U.pixelsize > 1, skip otherwise */ | ||||
| if (U.pixelsize > 1.0f) { | if (U.pixelsize > 1.0f) { | ||||
| /* FIXME: doesn't our glLineWidth already scale by U.pixelsize? */ | /* FIXME: doesn't our glLineWidth already scale by U.pixelsize? */ | ||||
| glLineWidth((2.0f * U.pixelsize) - 1); | glLineWidth((2.0f * U.pixelsize) - 1); | ||||
| glColor3ub(0x50, 0x50, 0x50); | glColor3ub(0x50, 0x50, 0x50); | ||||
| glBegin(GL_LINES); | glBegin(GL_LINES); | ||||
| for (sa = win->screen->areabase.first; sa; sa = sa->next) | for (sa = screen->areabase.first; sa; sa = sa->next) | ||||
| drawscredge_area(sa, winsize_x, winsize_y); | drawscredge_area(sa, winsize_x, winsize_y); | ||||
| glEnd(); | glEnd(); | ||||
| } | } | ||||
| glLineWidth(1); | glLineWidth(1); | ||||
| glColor3ub(0, 0, 0); | glColor3ub(0, 0, 0); | ||||
| glBegin(GL_LINES); | glBegin(GL_LINES); | ||||
| for (sa = win->screen->areabase.first; sa; sa = sa->next) { | for (sa = screen->areabase.first; sa; sa = sa->next) { | ||||
| drawscredge_area(sa, winsize_x, winsize_y); | drawscredge_area(sa, winsize_x, winsize_y); | ||||
| /* gather area split/join info */ | /* gather area split/join info */ | ||||
| if (sa->flag & AREA_FLAG_DRAWJOINFROM) sa1 = sa; | if (sa->flag & AREA_FLAG_DRAWJOINFROM) sa1 = sa; | ||||
| if (sa->flag & AREA_FLAG_DRAWJOINTO) sa2 = sa; | if (sa->flag & AREA_FLAG_DRAWJOINTO) sa2 = sa; | ||||
| if (sa->flag & (AREA_FLAG_DRAWSPLIT_H | AREA_FLAG_DRAWSPLIT_V)) sa3 = sa; | if (sa->flag & (AREA_FLAG_DRAWSPLIT_H | AREA_FLAG_DRAWSPLIT_V)) sa3 = sa; | ||||
| } | } | ||||
| glEnd(); | glEnd(); | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | else { | ||||
| glColor4ub(0, 0, 0, 100); | glColor4ub(0, 0, 0, 100); | ||||
| glVertex2s(win->eventstate->x + 1, sa3->totrct.ymin); | glVertex2s(win->eventstate->x + 1, sa3->totrct.ymin); | ||||
| glVertex2s(win->eventstate->x + 1, sa3->totrct.ymax); | glVertex2s(win->eventstate->x + 1, sa3->totrct.ymax); | ||||
| } | } | ||||
| glEnd(); | glEnd(); | ||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| } | } | ||||
| win->screen->do_draw = false; | screen->do_draw = false; | ||||
| } | } | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Screen Thumbnail Preview */ | /* Screen Thumbnail Preview */ | ||||
| /** | /** | ||||
| * Calculates a scale factor to squash the preview for \a screen into a rectangle of given size and aspect. | * Calculates a scale factor to squash the preview for \a screen into a rectangle of given size and aspect. | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||