I want to be able to draw pixels to the screen, or use the shape function, on the graphics card without using OpenGL or DirectX, do I have to write my own library?
Out of curiosity, why do you want to do this? This is a very tedious non-trivial task.
OpenGL is an interface, in other words a list of functions that you can call. Each graphics card has its own implementation of that interface, in other words it does different hardware-specific things for each function call.
I suppose you could write device-specific code for your graphics card, but again this is going to be a very tedious process. You can also find open source implementations of OpenGL on the internet.
I’m trying to make my own 3d engine, because I can. Yeah, worst reason ever. I wanted to write it from scratch without all the OpenGL premade stuff. All I really want to do is write pixels to the screen.
It’s not a bad reason, but I think you’ll find that it’s a lot more complex than you thought. You could maybe try to track down the source code of an open source OpenGL implementation (I believe Mesa is an example), but you’re going to be digging through native C files.
To answer your question, basically yes you’d have to write your own library.
I don’t want to discourage you- if it sounds interesting to you, I say go for it! Just don’t expect something simple like a
graphicsCard.drawPoint() function. There’s a lot of complicated stuff going on behind something as simple as the
point() function. That’s one of the things that make Processing so great!
If this is interesting to you, you might start looking into rasterization:
I already have the 3D renderer working, and I will rasterize the crap out of it. Thanks!
Out of curiosity, how did you implement your 3D renderer?
What do you mean exactly?
What language did you use? What libraries?
Just processing. It’s a software renderer.
I’m not sure if your goal is to be 100% OpenGL-independant, or performance, or just a learning project, but just to note if you aren’t aware that your 3D software renderer in Processing uses P3D – and P3D is OpenGL. So if your goal is a raster operation, that’s fine, but if you are hoping to run your software renderer in P3D without OpenGL present on the system at all, that is a much heavier lift – you are writing a new rendering mode:
size(400, 400, MYRENDERER)
It doesn’t use p3d. At all.
Great! If it is JAVA2D, then no OpenGL dependency.
Yeah but, I want to talk to the graphics card, I know it doesn’t use OpenGL, I want to talk to the graphics card without using OpenGL.