Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make your own graphics libary?

Status
Not open for further replies.

tomdacat

Programmer
Mar 24, 2014
5
GB
For a while now i have been wondering just how opengl and sdl rely
draw graphics to the screen
and how could you do it yourself?
is it rely that hard to make a function to put a pixel
at cord 50, 60?

if anyone knows how to make a very simple graphics libary
then please post a reply
thanks in advance!!
 
Writing to a pixel position: depends on what the hardware is. Sometimes it is just writing values to a couple of ports, sometimes it can be to memory mapped ports. It is probably the same setting the colours. You'll have to talk to the person who designed the hardware.

The graphics library depends on the hardware. Some hardware can draw lines and ellipses, others you have to apply Bresenham's algo to draw the lines and ellipses. On some, you can just write a value to a specific port and it will clear the screen. On others, you have to write to every single pixel.

If you want a simple graphics library, have a look for the Zortech C/C++ compiler. It used to come with the sources for a graphics library.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top