Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #389837

Re: Can 'graphics' be a file descriptor?

From wij <wyniijj5@gmail.com>
Newsgroups comp.lang.c
Subject Re: Can 'graphics' be a file descriptor?
Date 2025-01-02 15:16 +0800
Organization A noiseless patient Spider
Message-ID <08be9710b964a1b236ba75a2fbec97c9a7ea6297.camel@gmail.com> (permalink)
References <d0fcbe9e7b29ce6f9a0604058475b0aa9a23d5cb.camel@gmail.com> <87msgaubjj.fsf@nosuchdomain.example.com> <0bfa49a6d580546ab2db91aeac7627afb19e492d.camel@gmail.com> <87ikqytb9d.fsf@nosuchdomain.example.com>

Show all headers | View raw


On Wed, 2025-01-01 at 14:33 -0800, Keith Thompson wrote:
> wij <wyniijj5@gmail.com> writes:
> > On Wed, 2025-01-01 at 01:29 -0800, Keith Thompson wrote:
> [...]
> > > A file *descriptor* is a small integer referring to some file-like
> > > entity, used with open/close/read/write.  There's no such thing in
> > > standard C; it's a POSIX concept.
> [...]
> > I would like to have opinions about the idea "graphics being a file
> > descriptor".  The implement is irrevent for the discussion. Some
> > imagination is required.
> 
> Why do you insist on referring to "file descriptors"?  That's a specific
> term with a specific meaning: a small integer value used in POSIX I/O
> (not in standard C).

I do not insist anything. I would just like to have an opinion on the idea 
"graphics being a file descriptor".

> If you mean FILE* pointers, the discussion might have some relevance to
> C.  If you really mean POSIX file descriptors, comp.unix.programmer
> might be a better place.

In one scenario, I can take that as 'the opinion'.

> Sure, you could have a graphics system where a program interacts with
> the display by reading and writing to FILE* pointers.  You'd have to
> encode the operations and returned data as streams of bytes.  I'm not
> convinced there would be much advantage.

FILE* is full of 'upgrade' enough not to consider (technically this is only my 
30 year ago opinion. Nowadays, it becomes more complicated, seemingly only 
functions to support old software in the name of 'standard'. In the confinement,
you are doomed not going too far, which should not be the goal of 'standard').
With file descriptor, there is at least mmap. The concern might be that 'the 
display' may not simply be a range of memory (this is not a strong enough
reason for me). But this may still be fine, we can have option of I/O by read/
write or by mmap. These are hardware things. I had implemented a simple GUI in 
DOS (DOS4G) and 3D rendering pipeline based on plain 'frame buffer'. That
experience tell me the idea "graphics being a file descriptor" is plausible 
except I don't feel comfortable with this idea after these years. What involved
can be huge (desktop, graphics terminal, matrix, AI, parallel computing), but 
I think from C's point of view (building OS), something to draw image should be  
simpler and discussable, at least just opinion should be fine.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Can 'graphics' be a file descriptor? wij <wyniijj5@gmail.com> - 2025-01-01 15:48 +0800
  Re: Can 'graphics' be a file descriptor? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-01 08:11 +0000
  Re: Can 'graphics' be a file descriptor? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-01-01 01:29 -0800
    Re: Can 'graphics' be a file descriptor? wij <wyniijj5@gmail.com> - 2025-01-01 19:05 +0800
      Re: Can 'graphics' be a file descriptor? bart <bc@freeuk.com> - 2025-01-01 12:07 +0000
        Re: Can 'graphics' be a file descriptor? wij <wyniijj5@gmail.com> - 2025-01-01 21:40 +0800
          Re: Can 'graphics' be a file descriptor? bart <bc@freeuk.com> - 2025-01-02 11:28 +0000
        Re: Can 'graphics' be a file descriptor? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-01 19:25 +0000
      Re: Can 'graphics' be a file descriptor? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-01-01 14:33 -0800
        Re: Can 'graphics' be a file descriptor? Alexis <flexibeast@gmail.com> - 2025-01-02 10:22 +1100
        Re: Can 'graphics' be a file descriptor? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-02 00:50 +0000
        Re: Can 'graphics' be a file descriptor? wij <wyniijj5@gmail.com> - 2025-01-02 15:16 +0800
          Re: Can 'graphics' be a file descriptor? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-01-02 13:06 -0800
            Re: Can 'graphics' be a file descriptor? BGB <cr88192@gmail.com> - 2025-01-02 16:08 -0600
              Re: Can 'graphics' be a file descriptor? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2025-01-02 23:35 +0000
                Re: Can 'graphics' be a file descriptor? BGB <cr88192@gmail.com> - 2025-01-03 00:10 -0600
              Re: Can 'graphics' be a file descriptor? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-03 00:07 +0000
              Re: Can 'graphics' be a file descriptor? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-01-02 23:24 -0800

csiph-web