OpenGL patches from Bill.

git-svn-id: file:///fltk/svn/fltk/trunk@152 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
1998-12-08 21:04:40 +00:00
parent 02646a21dc
commit d3fb66b4dd
7 changed files with 32 additions and 29 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
// //
// "$Id: Fl_Menu.cxx,v 1.7 1998/12/02 15:39:32 mike Exp $" // "$Id: Fl_Menu.cxx,v 1.8 1998/12/08 21:04:35 mike Exp $"
// //
// Menu code for the Fast Light Tool Kit (FLTK). // Menu code for the Fast Light Tool Kit (FLTK).
// //
@@ -266,7 +266,7 @@ menuwindow::~menuwindow() {
void menuwindow::position(int X, int Y) { void menuwindow::position(int X, int Y) {
if (title) {title->position(X, title->y()+Y-y());} if (title) {title->position(X, title->y()+Y-y());}
Fl_Menu_Window::position(X, Y); Fl_Menu_Window::position(X, Y);
x(X); y(Y); // don't wait for response from X // x(X); y(Y); // don't wait for response from X
} }
// scroll so item i is visible on screen // scroll so item i is visible on screen
@@ -279,7 +279,7 @@ void menuwindow::autoscroll(int i) {
Y = -Y-10; Y = -Y-10;
} }
Fl_Menu_Window::position(x(), y()+Y); Fl_Menu_Window::position(x(), y()+Y);
y(y()+Y); // don't wait for response from X // y(y()+Y); // don't wait for response from X
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@@ -703,5 +703,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
} }
// //
// End of "$Id: Fl_Menu.cxx,v 1.7 1998/12/02 15:39:32 mike Exp $". // End of "$Id: Fl_Menu.cxx,v 1.8 1998/12/08 21:04:35 mike Exp $".
// //
+4 -3
View File
@@ -1,5 +1,5 @@
// //
// "$Id: Fl_Tile.cxx,v 1.3 1998/10/21 14:20:23 mike Exp $" // "$Id: Fl_Tile.cxx,v 1.4 1998/12/08 21:04:36 mike Exp $"
// //
// Tile widget for the Fast Light Tool Kit (FLTK). // Tile widget for the Fast Light Tool Kit (FLTK).
// //
@@ -168,7 +168,8 @@ int Fl_Tile::handle(int event) {
break; break;
case FL_DRAG: case FL_DRAG:
if (damage()) return 1; // don't fall behind // This is necessary if CONSOLIDATE_MOTION in Fl_x.C is turned off:
// if (damage()) return 1; // don't fall behind
case FL_RELEASE: { case FL_RELEASE: {
if (!sdrag) return 0; // should not happen if (!sdrag) return 0; // should not happen
Fl_Widget* r = resizable(); if (!r) r = this; Fl_Widget* r = resizable(); if (!r) r = this;
@@ -195,5 +196,5 @@ int Fl_Tile::handle(int event) {
} }
// //
// End of "$Id: Fl_Tile.cxx,v 1.3 1998/10/21 14:20:23 mike Exp $". // End of "$Id: Fl_Tile.cxx,v 1.4 1998/12/08 21:04:36 mike Exp $".
// //
+3 -3
View File
@@ -1,5 +1,5 @@
// //
// "$Id: fl_boxtype.cxx,v 1.6 1998/12/02 15:47:30 mike Exp $" // "$Id: fl_boxtype.cxx,v 1.7 1998/12/08 21:04:37 mike Exp $"
// //
// Box drawing code for the Fast Light Tool Kit (FLTK). // Box drawing code for the Fast Light Tool Kit (FLTK).
// //
@@ -48,7 +48,7 @@ static uchar inactive_ramp[24] = {
48, 48, 48, 49, 48, 48, 48, 49,
49, 49, 50, 50, 49, 49, 50, 50,
51, 51, 52, 52}; 51, 51, 52, 52};
static int draw_it_active; static int draw_it_active = 1;
uchar *fl_gray_ramp() {return (draw_it_active?active_ramp:inactive_ramp)-'A';} uchar *fl_gray_ramp() {return (draw_it_active?active_ramp:inactive_ramp)-'A';}
void fl_frame(const char* s, int x, int y, int w, int h) { void fl_frame(const char* s, int x, int y, int w, int h) {
@@ -282,5 +282,5 @@ const {
} }
// //
// End of "$Id: fl_boxtype.cxx,v 1.6 1998/12/02 15:47:30 mike Exp $". // End of "$Id: fl_boxtype.cxx,v 1.7 1998/12/08 21:04:37 mike Exp $".
// //
+3 -3
View File
@@ -1,5 +1,5 @@
// //
// "$Id: fl_draw.cxx,v 1.4 1998/10/21 14:20:48 mike Exp $" // "$Id: fl_draw.cxx,v 1.5 1998/12/08 21:04:37 mike Exp $"
// //
// Label drawing code for the Fast Light Tool Kit (FLTK). // Label drawing code for the Fast Light Tool Kit (FLTK).
// //
@@ -158,7 +158,6 @@ void fl_draw(
p = e; p = e;
} }
if (align & FL_ALIGN_CLIP) fl_pop_clip();
} }
void fl_draw( void fl_draw(
@@ -169,6 +168,7 @@ void fl_draw(
if (w && h && !fl_not_clipped(x, y, w, h)) return; if (w && h && !fl_not_clipped(x, y, w, h)) return;
if (align & FL_ALIGN_CLIP) fl_clip(x, y, w, h); if (align & FL_ALIGN_CLIP) fl_clip(x, y, w, h);
fl_draw(str, x, y, w, h, align, fl_draw); fl_draw(str, x, y, w, h, align, fl_draw);
if (align & FL_ALIGN_CLIP) fl_pop_clip();
} }
void fl_measure(const char* str, int& w, int& h) { void fl_measure(const char* str, int& w, int& h) {
@@ -193,5 +193,5 @@ void fl_measure(const char* str, int& w, int& h) {
} }
// //
// End of "$Id: fl_draw.cxx,v 1.4 1998/10/21 14:20:48 mike Exp $". // End of "$Id: fl_draw.cxx,v 1.5 1998/12/08 21:04:37 mike Exp $".
// //
+8 -6
View File
@@ -1,5 +1,5 @@
// //
// "$Id: fl_symbols.cxx,v 1.4 1998/12/02 18:55:58 mike Exp $" // "$Id: fl_symbols.cxx,v 1.5 1998/12/08 21:04:38 mike Exp $"
// //
// Symbol drawing code for the Fast Light Tool Kit (FLTK). // Symbol drawing code for the Fast Light Tool Kit (FLTK).
// //
@@ -158,10 +158,10 @@ int fl_draw_symbol(const char *label,int x,int y,int w,int h,Fl_Color col) {
#define vv(x,y) fl_vertex(x,y) #define vv(x,y) fl_vertex(x,y)
static void rectangle(double x,double y,double x2,double y2,Fl_Color c) { static void rectangle(double x,double y,double x2,double y2,Fl_Color c) {
fl_color(c); fl_color(c);
BP; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EP; BP; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EP;
fl_color(FL_BLACK); //fl_color(FL_BLACK);
BC; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EC; //BC; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EC;
} }
/* The drawing routines */ /* The drawing routines */
@@ -203,6 +203,7 @@ static void draw_arrowbox(Fl_Color col)
{ {
fl_color(col); fl_color(col);
BP; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EP; BP; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EP;
BC; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EC;
} }
static void draw_bararrow(Fl_Color col) static void draw_bararrow(Fl_Color col)
@@ -247,6 +248,7 @@ static void draw_arrow(Fl_Color col)
{ {
fl_color(col); fl_color(col);
BP; vv(0.65,0.1); vv(1.0,0.0); vv(0.65,-0.1); EP; BP; vv(0.65,0.1); vv(1.0,0.0); vv(0.65,-0.1); EP;
BL; vv(-1.0,0.0); vv(0.65,0.0); EL;
} }
#if 0 #if 0
@@ -353,5 +355,5 @@ void Fl::enable_symbols() {
} }
// //
// End of "$Id: fl_symbols.cxx,v 1.4 1998/12/02 18:55:58 mike Exp $". // End of "$Id: fl_symbols.cxx,v 1.5 1998/12/08 21:04:38 mike Exp $".
// //
+6 -6
View File
@@ -1,5 +1,5 @@
// //
// "$Id: checkers.cxx,v 1.7 1998/12/02 17:35:59 mike Exp $" // "$Id: checkers.cxx,v 1.8 1998/12/08 21:04:39 mike Exp $"
// //
// Checkers game for the Fast Light Tool Kit (FLTK). // Checkers game for the Fast Light Tool Kit (FLTK).
// //
@@ -921,10 +921,10 @@ void draw_piece(int which, int x, int y) {
case WHITEKING: which = 3; break; case WHITEKING: which = 3; break;
default: return; default: return;
} }
fl_color(0, 1, 0); bm[which][0]->draw(x, y); fl_color(FL_BLACK); bm[which][0]->draw(x, y);
fl_color(200, 100, 200); bm[which][1]->draw(x, y); fl_color(FL_INACTIVE_COLOR); bm[which][1]->draw(x, y);
fl_color(100, 100, 200); bm[which][2]->draw(x, y); fl_color(FL_SELECTION_COLOR); bm[which][2]->draw(x, y);
fl_color(200, 200, 100); bm[which][3]->draw(x, y); fl_color(FL_WHITE); bm[which][3]->draw(x, y);
} }
//---------------------------------------------------------------- //----------------------------------------------------------------
@@ -1366,5 +1366,5 @@ int main(int argc, char **argv) {
} }
// //
// End of "$Id: checkers.cxx,v 1.7 1998/12/02 17:35:59 mike Exp $". // End of "$Id: checkers.cxx,v 1.8 1998/12/08 21:04:39 mike Exp $".
// //
+4 -4
View File
@@ -1,5 +1,5 @@
// //
// "$Id: glpuzzle.cxx,v 1.3 1998/10/21 14:21:28 mike Exp $" // "$Id: glpuzzle.cxx,v 1.4 1998/12/08 21:04:40 mike Exp $"
// //
// OpenGL puzzle demo for the Fast Light Tool Kit (FLTK). // OpenGL puzzle demo for the Fast Light Tool Kit (FLTK).
// //
@@ -474,7 +474,7 @@ redraw(void)
{ {
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
gluPerspective(45, 1.0, 0.1, 100.0); gluPerspective(45, viewport[2]*1.0/viewport[3], 0.1, 100.0);
drawAll(); drawAll();
@@ -793,7 +793,7 @@ selectPiece(int mousex, int mousey)
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
gluPickMatrix(mousex, H - mousey, 4, 4, viewport); gluPickMatrix(mousex, H - mousey, 4, 4, viewport);
gluPerspective(45, 1.0, 0.1, 100.0); gluPerspective(45, viewport[2]*1.0/viewport[3], 0.1, 100.0);
drawAll(); drawAll();
@@ -1479,5 +1479,5 @@ main(int argc, char **argv)
#endif // added for fltk's distribution #endif // added for fltk's distribution
// //
// End of "$Id: glpuzzle.cxx,v 1.3 1998/10/21 14:21:28 mike Exp $". // End of "$Id: glpuzzle.cxx,v 1.4 1998/12/08 21:04:40 mike Exp $".
// //