4 ms·
It’s common to use e.g. GLWF or SDL if you want an OpenGL context on Linux. It uses Xlib underneath but you don’t have to touch it yourself.
by klodolph 7y ago
It’s common to use e.g. GLWF or SDL if you want an OpenGL context on Linux. It uses Xlib underneath but you don’t have to touch it yourself.
- matheusmoreira 7y agoBut is it possible to render graphics without any libraries whatsoever?
- therein 7y agoYou could write to /dev/fb0 and use ioctl's on it to make some adjustments.
- abainbridge 7y agoYou could open your own socket to the xclient and speak xprotocol yourself.
- klodolph 7y agoI think if you ask this question you had better be prepared to add some clarifying information here. Are you asking if it is technically possible? Yes, because libraries are just code + data, and you can trivially just duplicate the library functionality in your own library. Are you trying to eliminate library dependencies for some kind of demoscene competition? You could just use the framebuffer. Are you trying to write portable code that doesn’t depend on particular libraries being installed? That’s possible too, in various ways, such as dynamic linking. Are you doing a homework assignment and want to render graphics, but the rules for the homework state “no libraries”? Also possible, but I would recommend talking to the teacher to clarify things. Do you just need to display something simple to the user? You can use ASCII art and set colors by writing ANSI escape sequences, and you can also use emoji. Some people use this to make command-line applications with some simple graphics. Finally, when you say “without any libraries” do you mean to include the standard library, or is that library OK? In general I find the “without using libraries” questions that people ask a bit vague and difficult to answer.
- DonHopkins 7y agoYou could use a speech synthesizer to describe what you want to draw in words, and let the user render the graphics in their imagination.