# Is there any way to communicate with the graphics card?

**URL:** <https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791>\
**Category:** Processing\
**Created:** [June 8, 2018, 1:58am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791 "2018-06-08T01:58:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [June 8, 2018, 1:58am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/1 "2018-06-08T01:58:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 8, 2018, 3:35am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/2 "2018-06-08T03:35:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [June 8, 2018, 3:44am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/3 "2018-06-08T03:44:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 8, 2018, 3:58am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/4 "2018-06-08T03:58:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 8, 2018, 4:08am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/5 "2018-06-08T04:08:34Z")

</div>

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:

> **[Rasterisation](https://en.wikipedia.org/wiki/Rasterisation)**
>
> Rasterisation (or rasterization) is the task of taking an image described in a vector graphics format (shapes) and converting it into a raster image ( A series of pixels, dots or lines that when they come together on a display, they recreate the image). The rasterised image may then be displayed on a computer display, video display or printer, or stored in a bitmap file format. Rasterisation may refer to either the conversion of models into raster files, or the conversion of 2D rendering p Compa...

---

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [June 8, 2018, 4:17am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/6 "2018-06-08T04:17:58Z")

</div>

I already have the 3D renderer working, and I will rasterize the crap out of it. Thanks!

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 8, 2018, 4:40am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/7 "2018-06-08T04:40:17Z")

</div>

Out of curiosity, how did you implement your 3D renderer?

---

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [June 8, 2018, 4:44am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/8 "2018-06-08T04:44:48Z")

</div>

What do you mean exactly?

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 8, 2018, 4:46am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/9 "2018-06-08T04:46:21Z")

</div>

What language did you use? What libraries?

---

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [June 8, 2018, 4:47am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/10 "2018-06-08T04:47:27Z")

</div>

Just processing. It’s a software renderer.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [June 9, 2018, 3:00pm UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/11 "2018-06-09T15:00:10Z")

</div>

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)`

> **[processing/processing](https://github.com/processing/processing/tree/master/core/src/processing/opengl)**
>
> Source code for the Processing Core and Development Environment (PDE) - processing/processing

---

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [June 14, 2018, 7:49am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/12 "2018-06-14T07:49:00Z")

</div>

It doesn’t use p3d. At all.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [June 14, 2018, 11:29am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/13 "2018-06-14T11:29:00Z")

</div>

Great! If it is JAVA2D, then no OpenGL dependency.

---

<div class="post-metadata">

**Author:** ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)\
**Post date:** [June 16, 2018, 4:24am UTC](https://discourse.processing.org/t/is-there-any-way-to-communicate-with-the-graphics-card/791/14 "2018-06-16T04:24:57Z")

</div>

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.
