back
4 comments
I 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.

You could write to /dev/fb0 and use ioctl's on it to make some adjustments.
You could use a speech synthesizer to describe what you want to draw in words, and let the user render the graphics in their imagination.
You could open your own socket to the xclient and speak xprotocol yourself.