Saturday, August 30, 2014

Genius G-Pen 560 under Debian 7.6

Download https://launchpad.net/wizardpen sources.
in the README file there are instructions to install dependencies.
Do ./configure, sudo make install.

edit /usr/share/X11/xorg.conf.d/70-wizardpen.conf

Section "InputClass"
   Identifier "wizardpen"
   MatchIsTablet "on"
   MatchDevicePath "/dev/input/event*"
   MatchTag "wizardpen"
   Driver "wizardpen"
   Option               "TopX"          "185"
   Option               "TopY"          "372"
   Option               "BottomX"       "11811"
   Option               "BottomY"       "8793"
   Option               "TopZ"          "32"
EndSection

Restart and enjoy!

Wednesday, July 16, 2014

Opengl 2d

https://www.mapbox.com/blog/drawing-antialiased-lines/

Monday, October 14, 2013

Scheme as embeddable language for C

Tried guile 2.0.9, tinyScheme, chibi-scheme and lua 5.2.

On MacOSX 10.8.5 memory footprint of default interpreter is:

guile 12.4 MB,
tinyScheme 984 KB,
chibi-scheme 2.7 MB,
lua 760 KB.

Executing 'hello world' with 'time' takes:

time guile -c '(display "hello, world!\n")' --- real 0m0.027s
time ./scheme -c '(display "hello, world!\n")' --- real 0m0.007s
time ./chibi-scheme -e '(display "hello, world!\n")' --- real 0m0.046s
 time lua -e 'print("hello, world!\n")' --- real 0m0.004s

 To sum up, for config files tiny-scheme or lua are perfect. Taking into account that lua is a full-featured language while tiny-scheme is a shrinked down one, lua is a clear winner.

Wednesday, September 4, 2013

Inkscape and lessons for 2d art.

Inkscape and lessons for 2d art. http://2dgameartforprogrammers.blogspot.com/

Saturday, June 22, 2013

What every programmer should know about memory

http://lwn.net/Articles/250967/ Software optimization resources http://www.agner.org/optimize/

Friday, May 31, 2013

2D math, fixed point, angles etc.

http://www.helixsoft.nl/articles/circle/sincos.htm

Thursday, May 30, 2013

Multithreading in FLTK

The very smart way: http://www.fltk.org/doc-1.3/advanced.html
int main() {
      Fl::lock();
      /* run thread */
      while (Fl::wait() > 0) {
        if (Fl::thread_message()) {
          /* process your data */
        }
      }
    }

//////////////
void *msg;       // "msg" is a pointer to your message
Fl::awake(msg);  // send "msg" to main thread

//////////////

void do_something(void *userdata) {
      // running with the main thread
    }

    // running in another thread
    void *data;       // "data" is a pointer to your user data
    Fl::awake(do_something, data);  // call something in main thread