How the actual graphics library works?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
luxianos
Posts: 4
Joined: Thu Feb 09, 2012 8:28 pm

How the actual graphics library works?

Post by luxianos »

Hi, I have been reading for weeks and i've readed a lot of code but I have many doubts yet. In graphics libraries like Cairo, Allegro, or in the Xorg, the Windows GUI, Linux GUI, or Android; how implements the contact with the hardware?
In primitive code we can access to the video memory and start writing there, but in moderns systems applies the same method? What about the graphics cards? I think these are not mapped in memory ¿its true?

I readed the code of Cairo, Allegro, and the code of Android from https://github.com/android but I don't found the low level contact with the hardware.
Thanks a lot!! :D
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: How the actual graphics library works?

Post by bluemoon »

The GUI is not bound to hardware, you don't want to have infinite versions of GUI framework with all the video cards.
The hardware specific things is handled by the driver, and each OS has a defined driver interface.
TylerH
Member
Member
Posts: 285
Joined: Tue Apr 13, 2010 8:00 pm
Contact:

Re: How the actual graphics library works?

Post by TylerH »

I think OP is asking how the drivers do what they do.

Unfortunately, AFAIK, the answer to that is pretty much unavailable to us for most current video cards. See here for a lot of what has been disclosed: http://wiki.osdev.org/Accelerated_Graphic_Cards.
And here for drawing without interfacing with video cards: http://wiki.osdev.org/Drawing_In_Protected_Mode.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: How the actual graphics library works?

Post by gerryg400 »

luxianos wrote:I readed the code of Cairo, Allegro, and the code of Android from https://github.com/android but I don't found the low level contact with the hardware.
Thanks a lot!!
I've just started porting Cairo and Freetype to my primitive VBE based graphics driver. Unfortunately it's not simple because the libraries you mention need a 'backend' between the library and the driver. There are numerous backends, X, openGL, glitz, pdf and also a frame-buffer backend but they are of no use to us.

The frame-buffer sounds promising but the bad news is that the 'frame-buffer' is a Linux kernel driver. Not a simple frame buffer in memory. I'm still weighing up my options but will probably end up modifying the frame buffer backend to be more generic and fit it to my driver.
If a trainstation is where trains stop, what is a workstation ?
Post Reply