Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to forget about DX, OpenGL, SDL, etc. Basically any low-level libraries I'm against.

I would like to write my own OS-compatible library that is closer to the OS-API for window-systems, and make my own low-level graphics library that makes adequate calls to the OS drivers and such.

How should I get started?

share|improve this question

closed as not constructive by Trevor Powell, Jari Komppa, Sean Middleditch, Maik Semder, Josh Petrie Jan 4 '13 at 0:17

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
This really falls under the "If you can imagine an entire book answering your question" clause of the FAQ's section on questions not to ask here. (in this case, a whole series of books). Also, "How to get started". –  Trevor Powell Dec 28 '12 at 23:01
3  
Whatever you make WILL be slower than DirectX/OpenGL. Even if you get GPU acceleration working on your machine, it won't work on any other GPUs because the architecture of the graphics card will be different. DirectX/OpenGL lightly abstract the hardware differences between GPUs. For learning purposes, writing your own renderer is a lot of fun, but it's not going to be at all practical if you want to make a game. –  Robert Rouhani Dec 29 '12 at 13:14
3  
There are no open specifications of the internal GPU architecture for any modern graphics card. You're going to be doing more reverse-engineering than writing graphics code. And that's for a single graphics card. There are over 1,200 graphics card models out there, each of which have a slightly different architecture. –  Robert Rouhani Dec 31 '12 at 22:30
1  
If you really want to do this, though, I'd recommend you learn a lot about the modern graphics pipeline, then crack open nVidia or AMD drivers and figure out what happens where. The drivers also do a lot of the work that isn't done on the GPU (like emulate immediate mode, compile shaders, etc.) so you'd probably be able to rip those right out of the drivers. –  Robert Rouhani Dec 31 '12 at 22:32
3  
You might also be interested in the open-source software implementation of OpenGL, Mesa 3D, which alone is over 1 million lines of code. –  Robert Rouhani Dec 31 '12 at 22:39

1 Answer 1

I assume you want your library to work for more than one specific videocard. So you will need to make assumptions about the minimal set of features current videocards support. You can assume that this minimal set is basically the instructions that DirectX and OpenGL require (so that's strike one for writing your own library).

Of course you could use these instructions and use them as you want in your library. However you still need a way to talk to the GPU, now I don't think there is a way to do this (without severe reverse engineering and guaranteed differences between different models) without using the driver provided by the GPU vendor (AMD, nVidia or Intel usually) (strike two). Now of course you will have to talk to the driver in a way it understands... and well unfortunately for you the driver understands only DirectX and OpenGL (strike three, you're out!)

So theoretically there is a way to do what you want, but it would involve writing your own driver for a GPU which, without the help of nVidia or another GPU vendor is neigh impossible, and the end gain would be neligible since you would still have only the instructions nVidia and other GPU vendors found useful for implementing OpenGL and DirectX.

Since your question has a lot of overlap with this one on stackoverflow you might want to read the answers there as well.

Edit:

If you tell us why you are not content with DirectX and OpenGL we might be able to help you with that underlying problem.

share|improve this answer
    
I don't like using things others made for me when it's possible to make my own. –  Andy Harglesis Dec 31 '12 at 20:45
    
I want to make my own specification of graphics-control without DX or OpenGL, regardless if that's what the cards are built to work with, I want it my way. –  Andy Harglesis Dec 31 '12 at 20:47
1  
Well as you've read that is neigh impossible using existing hardware. Only option then would be a (slowwww) software renderer. –  Roy T. Jan 1 '13 at 15:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.