Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,I'm looking for wisdom. Let's assume i want to draw something on my screen. Normally i would use a module for that, like f.e. GD. I understand that module would have been written in C, plz. correct me if i'm wrong. Would it be possible to do this in Perl without using any modules whatsoever. I mean adress the computerscreen (pixel by pixel) so to say, and where could i find information about that. Just out of curiosity off course.Thank you.

Replies are listed 'Best First'.
Re: computer screen
by SuicideJunkie (Vicar) on Jul 23, 2013 at 20:20 UTC

    Has pixel-poking even been a thing since the 80s?

    What's your specific use case? The easiest solution could be anything from saving a BMP and then launching an image viewer, to some controls like a canvas on a TK window, to an openGL 3d viewport.

Re: computer screen
by pemungkah (Priest) on Jul 24, 2013 at 02:37 UTC
    Assuming you're talking about a Unix machine running X Windows, perhaps the Direct Rendering Infrastructure would help you find what you're looking for?

    There are probably similar animals for Windows and OS X, but I can't tell you what they are off the top of my head.

    Every device is different, so even if you manage to get something working for one set of hardware (there still is memory-mapped I/O graphic hardware out there), it likely wouldn't work on another system unless it was identical to the one you developed this code on. This is why things like X Windows were invented; to put you the programmer at a remove from the vagaries of the hardware.

Re: computer screen
by Anonymous Monk on Jul 24, 2013 at 04:21 UTC

    I chose a bad example. Thank you anyway.

Re: computer screen
by Anonymous Monk on Jul 24, 2013 at 05:15 UTC

    "Go ahead", is what they told me. Go ahead and start programming, anyone can do it. It's not even necessary to understand computers. Look at what they did to me, i hate myself.

      Full graphics is high end stuff. Normal windows with buttons and labels and other widgets is midrange. Displaying results in text is very easy.

      Actually determining the results can vary from trivial to thesis material, depending on what it is you're trying to do.

      One important bit that they left out is that you *do* have to understand what you are trying to accomplish, at a fundamental level ... no handwaving allowed, because the computer doesn't think.


      So... the main question that remains unanswered: what is it that you are really trying to accomplish?

Re: computer screen
by sparkyichi (Deacon) on Jul 23, 2013 at 22:34 UTC
    When I see "Let's assume i want to draw something on my screen" I assume it is a poor assumption.

    Sparky
    FMTEYEWTK
      Aye, there are three likely scenarios I can come up with:
      • You're on a text console with vt100 type capabilities - no pixel poking
      • You're on some variant of Microsoft Windows - no pixel poking
      • You're on some sort of X-Window variant - no pixel poking

      So, I would venture to guess the short answer to your question is "no".

      -Scott