chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Any way to draw lines with bb *without* using GL?


From: Matt Welland
Subject: [Chicken-users] Any way to draw lines with bb *without* using GL?
Date: Tue, 4 Sep 2007 13:59:33 -0700

I'd like to draw simple polygons etc. in bb but I can't figure out
how. Here is some example code from the web that does the kind of
thing I want to do. Can it be done using bb?

Thanks,

Matt
--

// DEMONSTRATE HOW TO DRAW AN 'X' IN FLTK
#include <FL/Fl.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Double_Window.H>

// SIMPLE BOX WIDGET THAT DRAWS AN 'X'
class DrawX : public Fl_Widget {
public:
     DrawX(int X, int Y, int W, int H, const char*L=0) : Fl_Widget(X,Y,W,H,L) {
     }
     void draw() {
         // DRAW BLACK 'X'
         fl_color(FL_BLACK);
         fl_line(x(), y(),       x()+w()-1, y()+h()-1);
         fl_line(x(), y()+h()-1, x()+w()-1, y());
     }
};
int main() {
     Fl_Double_Window win(200,200);
     DrawX draw_x(0, 0, win.w(), win.h());
     win.resizable(draw_x);
     win.show();
     return(Fl::run());
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]