Writing a Graphics Library
Writing a Graphics Library
I was just wondering what it involved. Does it mostly use assembly? Does it require an immensely good concept of mathematics? Does anyone know how to change a single pixel in assembly? ^_^
If you use assembly it is quite difficult to get cross platform compatability, so I don't think that Irrlicht has assembly in (though I didn't check the code
). Imho you don't really need to code such stuff in assembly nowadays, modern compilers do a pretty good job in optimization. Just my 2 cents.
hessiess wrote:Irrlicht is open source, why not look at the source code? thay are normally coded in C/C++ using OpenGL or DX
I don't think you understand what I mean, Irrlicht is a 3D graphics engine isn't it? And it uses DX and OpenGL which are Graphics Libraries.
What I mean is how would I write something like DX or OpenGL? What code was used in their making?
-
lostclimategames
- Posts: 331
- Joined: Sat Sep 02, 2006 4:11 am
- Location: Michigan
- Contact:
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Don't feel too bad about it; effective communication takes practice.Aspiring wrote:I don't think you understand what I meanhessiess wrote:Irrlicht is open source, why not look at the source code? thay are normally coded in C/C++ using OpenGL or DX
...or a software renderer? Like the Irrlicht software renderers?Aspiring wrote:What I mean is how would I write something like DX or OpenGL? What code was used in their making?
I have no idea how much of DX or OGL is ASM. I'd imagine very little. The smart strategy is to write everything in C or C++, identify your inner loops, then look at the ASM for that code. If and only if you think you can do better do you begin to ASMify those loops.
Of course, many devs just dive in and start writing ASM without bothering to see if a modern optimising compiler can do as well or better, but you can't really blame them for that: their mothers probably drank a lot during pregnancy.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
The Onslaught
- Posts: 41
- Joined: Mon Jan 29, 2007 3:33 pm
"Does anyone know how to change a single pixel in assembly?"
A pixel used to be physically mapped, meaning you simply write a value to a memory location and the pixel will automatically show-up on your monitor. Try Googling CGA and VGA memory map and you'll get a feel of what it looks like.
Nowadays, if you're dealing with a GL or a graphics engine, the pixel is now abstracted to a programmer. You will never touch the actual physical location of the screen simply because some hardware chip is already doing that kind of work. You will not anymore deal with cpu registers and video memory. That's all gone, that's the 80's and early 90's way of doing video.
Maybe your computer has a video card installed, maybe not. But the thing is, if there is a video card installed on your computer, chances are high the applications running on your machine is talking to that video card.
A pixel used to be physically mapped, meaning you simply write a value to a memory location and the pixel will automatically show-up on your monitor. Try Googling CGA and VGA memory map and you'll get a feel of what it looks like.
Nowadays, if you're dealing with a GL or a graphics engine, the pixel is now abstracted to a programmer. You will never touch the actual physical location of the screen simply because some hardware chip is already doing that kind of work. You will not anymore deal with cpu registers and video memory. That's all gone, that's the 80's and early 90's way of doing video.
Maybe your computer has a video card installed, maybe not. But the thing is, if there is a video card installed on your computer, chances are high the applications running on your machine is talking to that video card.

Video cards are more than an array of output pixels, they provide a huge bag of tricks that make fast and impressive graphics possible. The video driver provides a way for the operating system and graphics libraries to access these hardware accelerated features, and the graphics libraries bundle the them together in a way that makes them relatively easy to use. If you wanted to write something like Direct3D or OpenGL then it would be mostly about knowing and using the features, rather than mathematics.
Writing a software rasterizer is a completely different thing, this book ($20) is a complete guide to making one. If you wanted to read a software rasterizer Irrlicht has two to choose from, you can step through the code and see what it takes to draw a textured triangle
Writing a software rasterizer is a completely different thing, this book ($20) is a complete guide to making one. If you wanted to read a software rasterizer Irrlicht has two to choose from, you can step through the code and see what it takes to draw a textured triangle
DX and OpenGL are quite low-level( like asm)I don't think you understand what I mean, Irrlicht is a 3D graphics engine isn't it? And it uses DX and OpenGL which are Graphics Libraries.
What I mean is how would I write something like DX or OpenGL? What code was used in their making?
Irrlicht are high level( like C/C++ ) . Irrlicht helps you to use DX, OpenGL and in a simpler way.
I think OpenGL is written in C.
DX is closed source so most of us don't know how they wrote it. It's very likely to be developed with C++, Visual Studio IDE and compiler since it's a M$ product. (and I write M$ just because I like to do so, not because I hate them or anything)
Depends on how you define "immensely".Does it require an immensely good concept of mathematics?
My name is bull, for we are many ...
-
FlyingIsFun1217
- Posts: 219
- Joined: Fri Apr 13, 2007 8:29 pm
- Location: Illinois
- Contact:

