Advertisement

Drawing a pixel under linux

Started by June 19, 2004 07:14 AM
3 comments, last by C-Junkie 20 years, 3 months ago
Im sure this has been asked a million of times so dont start getting mad at my noobishness :p Anyway, all i need to know is how to draw a simple pixel in a fullscreen or windowed application. Im not gonna use anything else then this function so id like to avoid learning the entire X server programming business :p Im not to keen on using svgalib either, but ggi looks pretty nice. Anyway, i just need the simplest way to draw a pixel to the screen.
That's really an API-dependent question. Choose a graphics API to use and consult that documetation.
Advertisement
Doing it with Xlib is probably more complex than you'll want. The function you're likely looking for is XDrawPoint. See this tutorial for much of the extra information you'll need to be able to use it. Where the tutorial uses XDrawLine, draw a point instead.

If you want something easier to use, try SDL.
Thanks :) I'll check it out.
From what I've heard Xlib is a bit to complicated for what im planning, so I'll go with SDL.
The function that draws a pixel in SDL is in the documentation, not the library (strange, huh?)

So find it and cut-and-paste to use it.

This topic is closed to new replies.

Advertisement