Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/glutil.c
| Context not available. | |||||
| glDisable(GL_POLYGON_STIPPLE); | glDisable(GL_POLYGON_STIPPLE); | ||||
| } | } | ||||
| void sdrawline(int x1, int y1, int x2, int y2) | void sdrawline(short x1, short y1, short x2, short y2) | ||||
| { | { | ||||
| int v[2]; | short v[2]; | ||||
| glBegin(GL_LINE_STRIP); | glBegin(GL_LINE_STRIP); | ||||
| v[0] = x1; v[1] = y1; | v[0] = x1; v[1] = y1; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| v[0] = x2; v[1] = y2; | v[0] = x2; v[1] = y2; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| glEnd(); | glEnd(); | ||||
| } | } | ||||
| Context not available. | |||||
| * x1,y1-- x2,y1 | * x1,y1-- x2,y1 | ||||
| */ | */ | ||||
| static void sdrawtripoints(int x1, int y1, int x2, int y2) | static void sdrawtripoints(short x1, short y1, short x2, short y2) | ||||
| { | { | ||||
| int v[2]; | short v[2]; | ||||
| v[0] = x1; v[1] = y1; | v[0] = x1; v[1] = y1; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| v[0] = x1; v[1] = y2; | v[0] = x1; v[1] = y2; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| v[0] = x2; v[1] = y1; | v[0] = x2; v[1] = y1; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| } | } | ||||
| void sdrawtri(int x1, int y1, int x2, int y2) | void sdrawtri(short x1, short y1, short x2, short y2) | ||||
| { | { | ||||
| glBegin(GL_LINE_STRIP); | glBegin(GL_LINE_STRIP); | ||||
| sdrawtripoints(x1, y1, x2, y2); | sdrawtripoints(x1, y1, x2, y2); | ||||
| glEnd(); | glEnd(); | ||||
| } | } | ||||
| void sdrawtrifill(int x1, int y1, int x2, int y2) | void sdrawtrifill(short x1, short y1, short x2, short y2) | ||||
| { | { | ||||
| glBegin(GL_TRIANGLES); | glBegin(GL_TRIANGLES); | ||||
| sdrawtripoints(x1, y1, x2, y2); | sdrawtripoints(x1, y1, x2, y2); | ||||
| Context not available. | |||||
| } | } | ||||
| #endif | #endif | ||||
| void sdrawbox(int x1, int y1, int x2, int y2) | void sdrawbox(short x1, short y1, short x2, short y2) | ||||
| { | { | ||||
| int v[2]; | short v[2]; | ||||
| glBegin(GL_LINE_STRIP); | glBegin(GL_LINE_STRIP); | ||||
| v[0] = x1; v[1] = y1; | v[0] = x1; v[1] = y1; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| v[0] = x1; v[1] = y2; | v[0] = x1; v[1] = y2; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| v[0] = x2; v[1] = y2; | v[0] = x2; v[1] = y2; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| v[0] = x2; v[1] = y1; | v[0] = x2; v[1] = y1; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| v[0] = x1; v[1] = y1; | v[0] = x1; v[1] = y1; | ||||
| glVertex2iv(v); | glVertex2sv(v); | ||||
| glEnd(); | glEnd(); | ||||
| } | } | ||||
| Context not available. | |||||
| void sdrawXORline4(int nr, int x0, int y0, int x1, int y1) | void sdrawXORline4(int nr, int x0, int y0, int x1, int y1) | ||||
| { | { | ||||
| static int old[4][2][2]; | static short old[4][2][2]; | ||||
| static char flags[4] = {0, 0, 0, 0}; | static char flags[4] = {0, 0, 0, 0}; | ||||
| /* with builtin memory, max 4 lines */ | /* with builtin memory, max 4 lines */ | ||||
| Context not available. | |||||
| if (nr == -1) { /* flush */ | if (nr == -1) { /* flush */ | ||||
| for (nr = 0; nr < 4; nr++) { | for (nr = 0; nr < 4; nr++) { | ||||
| if (flags[nr]) { | if (flags[nr]) { | ||||
| glVertex2iv(old[nr][0]); | glVertex2sv(old[nr][0]); | ||||
| glVertex2iv(old[nr][1]); | glVertex2sv(old[nr][1]); | ||||
| flags[nr] = 0; | flags[nr] = 0; | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| else { | else { | ||||
| if (nr >= 0 && nr < 4) { | if (nr >= 0 && nr < 4) { | ||||
| if (flags[nr]) { | if (flags[nr]) { | ||||
| glVertex2iv(old[nr][0]); | glVertex2sv(old[nr][0]); | ||||
| glVertex2iv(old[nr][1]); | glVertex2sv(old[nr][1]); | ||||
| } | } | ||||
| old[nr][0][0] = x0; | old[nr][0][0] = x0; | ||||
| Context not available. | |||||