Dark Bit Factory & Gravity
PROGRAMMING => C / C++ /C# => Topic started 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
-
As far as I know, you will need to use some graphics library such Opengl / Directx or win32 GDI.
-
@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 ::)
-
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.
-
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?
-
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