Dark Bit Factory & Gravity

PROGRAMMING => C / C++ /C# => Topic started by: Kurisu42 on March 08, 2008

Title: Is there way to make graphics in [C]
Post by: Kurisu42 on March 08, 2008
Just wondering is there a way to make graphics such as 2d and 3d shapes in C, is it possible to do this without calling on functions outside the program?

sorry meant graphic libraries etc
Title: Re: Is there way to make graphics in [C]
Post by: Rbz on March 08, 2008
As far as I know, you will need to use some graphics library such Opengl / Directx or win32 GDI.
Title: Re: Is there way to make graphics in [C]
Post by: benny! on March 08, 2008
@Kurisu42:
Do you mean like accessing directly the graphic card ???

AFAIK, it is not possible with Windows since Windows is
a protected OS and it doesnt allow any direct access to
a hardware port.

Correct me if I am wrong  ::)
Title: Re: Is there way to make graphics in [C]
Post by: rain_storm on March 08, 2008
Not impossible but very hard to do. You have to convince windows to allow you into ring0 then you have to enter real mode, protected mode is no good. but windows doesnt just give out those priveledges to anyone. There are examples from people who wrote their own operating system that can access GFX cards directly Iv even seen an example of how to do this under Linux but no one seems to have done it for windows yet.
Title: Re: Is there way to make graphics in [C]
Post by: Kurisu42 on March 09, 2008
bah graphics libraries it is then, would any of you be able to give me a link to some good tutorials on or of the site?
Title: Re: Is there way to make graphics in [C]
Post by: Jim on March 10, 2008
Well, it was a pretty big ask - you're running under an OS which is controlling all the hardware and making it very easy to program for any graphics card via some standard APIs.  If you could do what you want to do you'd end up coding for every graphics card individually which would set you back to where we all were in 1995!
You've already had a pretty good link to an OpenGL framework, here's my Direct3D one
http://dbfinteractive.com/index.php?topic=1536.0 (http://dbfinteractive.com/index.php?topic=1536.0).  It's C++ but I have a straight C version if you'd prefer that?

Jim