From 36a317741a2eca593d083534b290afcc6d1661ef Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 3 Oct 2015 09:59:30 +0200 Subject: Initial! --- .gitignore | 3 +++ Makefile | 3 +++ flogo.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 flogo.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e3ca3a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +flogo +*.o +*.dSYM diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..811d88e --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +CXX = g++ +LIBS = -lfltk +CXXFLAGS = -Wall -Wextra -std=c++11 -O2 $(LIBS) diff --git a/flogo.cpp b/flogo.cpp new file mode 100644 index 0000000..96ba34d --- /dev/null +++ b/flogo.cpp @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +const int WIDTH=1000,HEIGHT=1000; + + +Fl_Window *window; +Fl_Scroll *drawscroll; +Fl_Box *drawimagebox; +Fl_RGB_Image *drawimage; +Fl_Input *cmdinput; +uchar *imagebuf; + + +const uchar* someimg(void){ + uchar *buf=new uchar[3*WIDTH*HEIGHT]; + int x,y; + for(y=0;yvalue()<value(NULL); +} + +int main(int argc,char **argv){ + window=new Fl_Window(1016,700); + Fl_Group::current(0); + + imagebuf=new uchar[WIDTH*HEIGHT*3]; + memset(imagebuf,255,WIDTH*HEIGHT*3*sizeof(uchar)); + + drawscroll=new Fl_Scroll(0,0,window->w(),window->h()-150); + drawimagebox=new Fl_Box(0,0,WIDTH,HEIGHT); + drawimage=new Fl_RGB_Image(imagebuf,WIDTH,HEIGHT); + drawimagebox->image(drawimage); + drawscroll->add(drawimagebox); + window->add(drawscroll); + + cmdinput=new Fl_Input(0,window->h()-25,window->w()-150,25); + cmdinput->when(FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED); + cmdinput->callback(cmdinputcallback); + window->add(cmdinput); + + window->resizable(drawscroll); + + window->end(); + Fl::visual(FL_RGB); + //window->callback(maincallback); //disable esc window closing + window->show(argc,argv); + return Fl::run(); +} -- cgit v1.2.3