Deutsch English Français Italiano |
<08be9710b964a1b236ba75a2fbec97c9a7ea6297.camel@gmail.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: wij <wyniijj5@gmail.com> Newsgroups: comp.lang.c Subject: Re: Can 'graphics' be a file descriptor? Date: Thu, 02 Jan 2025 15:16:27 +0800 Organization: A noiseless patient Spider Lines: 61 Message-ID: <08be9710b964a1b236ba75a2fbec97c9a7ea6297.camel@gmail.com> References: <d0fcbe9e7b29ce6f9a0604058475b0aa9a23d5cb.camel@gmail.com> <87msgaubjj.fsf@nosuchdomain.example.com> <0bfa49a6d580546ab2db91aeac7627afb19e492d.camel@gmail.com> <87ikqytb9d.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Date: Thu, 02 Jan 2025 08:16:28 +0100 (CET) Injection-Info: dont-email.me; posting-host="d1b0284356da0b107574561b234ddbaa"; logging-data="3356877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gwybZ2Ugl0XxLOYCiZOHl" User-Agent: Evolution 3.54.2 (3.54.2-1.fc41) Cancel-Lock: sha1:lg9HC1WBTSNdH7kfLgukeCdy0Uo= In-Reply-To: <87ikqytb9d.fsf@nosuchdomain.example.com> Bytes: 3718 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.=C2=A0 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".=C2=A0 The implement is irrevent for the discussion. Some > > imagination is required. >=20 > Why do you insist on referring to "file descriptors"?=C2=A0 That's a spec= ific > 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= =20 "graphics being a file descriptor". > If you mean FILE* pointers, the discussion might have some relevance to > C.=C2=A0 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.=C2=A0 You'd have to > encode the operations and returned data as streams of bytes.=C2=A0 I'm no= t > convinced there would be much advantage. FILE* is full of 'upgrade' enough not to consider (technically this is only= my=C2=A0 30 year ago opinion. Nowadays, it becomes more complicated, seemingly only= =20 functions to support old software in the name of 'standard'. In the confine= ment, 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 'th= e=20 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 re= ad/ write or by mmap. These are hardware things. I had implemented a simple GUI= in=20 DOS (DOS4G) and 3D rendering pipeline based on plain 'frame buffer'. That experience tell me the idea "graphics being a file descriptor" is plausible= =20 except I don't feel comfortable with this idea after these years. What invo= lved can be huge (desktop, graphics terminal, matrix, AI, parallel computing), b= ut=C2=A0 I think from C's point of view (building OS), something to draw image shoul= d be =20 simpler and discussable, at least just opinion should be fine.