Skip to main content
GameDev.net gamedev.net
🔒 Locked

Graphics Library

Started by Xanth Apr 13, 2002 at 4:01 PM 4 replies 800+ views
Original Post
Xanth
Xanth
I''m just curious if it''s possible for someone to write they''re own graphics library? Nothing fancy just lame stuff and only for the learning experience.
"I thought Genius lived in bottles..." - Patrick Star
intransigent-seal
intransigent-seal
What exactly do you mean by "graphics library"??
If you mean something like OpenGL, Direct3D, or DirectDraw, then it's possible, but you won't be able to get hardware acceleration (unless you write your own drivers).

If you mean something like the Quake3 engine, or CrystalSpace then yeah - you can write your own graphics library. I think it's a very good idea as well, because when you've written one you'll know a lot more about how they work inside, and therefore, you'll know how to get the best out of external libraries.

Anyway, it must be possible, because if it wasn't then there wouldn't be any graphics libraries.

John B

EDIT :: some grammar

[edited by - JohnBSmall on April 13, 2002 5:28:44 PM]
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
Xanth
Xanth
>>>>>What exactly do you mean by "graphics library"??
If you mean something like OpenGL, Direct3D, or DirectDraw, then it''s still possible, but you won''t be able to get hardware acceleration (unless you write your own drivers).<<<<<

Yup that''s what I meant.


>>>>>If you mean something like the Quake3 engine, or CrystalSpace then yeah - you can write your own graphics library. I think it''s a very good idea as well, because when you''ve written one you''ll know a lot more about how they work inside, and therefore, you''ll know how to get the best out of external libraries.<<<<<

Yeah this is something I want to do as well. Which is why for learning purposes I wanted to write a Graphics Library, so I''ll have more understanding when I write an engine.


>>>>>Anyway, it must be possible, because if it wasn''t then there wouldn''t be any graphics libraries.<<<<<

Excellent point. That''s what I said to myself when I posted hehehe.
"I thought Genius lived in bottles..." - Patrick Star
cruZ
cruZ
I''m currently writing my own graphics library. I do this just for fun. It''s a really cool feeling if you render 3d models with your own engine. The engine is written totally from the scratch, I even implemented my own PlotPixel function and a virtual framebuffer, so no predefined functions or 3rd party stuff.
If anyone is interested, just ask

greets flo.
Xanth
Xanth
I assume you''re talking about source? I''d be interested in looking at it, although I''m not great at following other peoples code LoL.

In addition do you have any useful information to give about writing ones own graphics library?
"I thought Genius lived in bottles..." - Patrick Star
cruZ
cruZ
Well, first you should have a clear idea of what your library should be capeable of. Then you can start choosing a language and a platform. Unless you''re into driver developement, forget about hardware acceleration. (I assume you want to do everything yourself, else you could gain acceleration by using some API like OpenGL or D3D).

The next steps are:

-Choose a way to draw to the screen. (GDI, OpenGL, DirectDraw /D3D)
I use a virtual framebuffer which I copy to the OpenGL framebuffer every frame
-Implement the basics (pixel, line and circle drawing)
If you want to display Bitmaps, write a BMP loader.
-If you want to do 3D, implement a transformation pipeline and
some polygone filling algortihms to display solid 3d models.
...and so on

I''m currently working on a website were I publish my whole stuff plus a few HowTo''s and tutorials.
If you''ve any specific questions (algorithms, design, source) drop me a mail.
greets flo

bionicman@aon.at

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.