←back to thread

Hands-On Graphics Without X11

(blogsystem5.substack.com)
166 points ingve | 1 comments | | HN request time: 0.217s | source
1. int_19h ◴[] No.42762823[source]
Once upon a time there was a tiny library called TinyPTC that let you write code like this:

   if (!ptc_open("test",WIDTH,HEIGHT)) return 1;
   while (1)
   {
       for (index=0; index<SIZE; index++)
       {
           noise = seed;
           noise >>= 3;
           noise ^= seed;
           carry = noise & 1;
           noise >>= 1;
           seed >>= 1;
           seed |= (carry << 30);
           noise &= 0xFF;
           pixel[index] = (noise<<16) | (noise<<8) | noise;
       }
       ptc_update(pixel);
   }
I wish we had something equally simple these days.