4

when I comes to rendering things on screen using video card, only three options are available, if I understand correctly. These are

  1. DirectX (or XNA)
  2. OpenGL
  3. Windows Driver Kit and creating minimal implementation of graphics driver

I have very little experience with DirectX or OpenGL, but from what I know you have to write a pixel shader program that tells rendering pipeline what to do with each pixel. These shaders are programmed in HLSL. But as far as I know, neither DirectX, nor OpenGL is able to return a pointer to a memory that I could write some byte[] buffer to from my C# program and get it rendered. Or am I mistaken here?

WDK might be a better choice, because it would be possible to implement absolutely minimal implementation of graphics driver that does nothing but returns pointer to a memory where I could write RGB data. So at one hand I could get rid of all the abstraction DirectX or OpenGL provides (and which I don't need), but at the other complexity of driver development is not exactly a time-saver.

Also, from what I have found while searching more information on this, in the old days of DOS there was an address 0B00 or similar that allowed developers to draw directly onto screen buffer. It's gone of course and no longer usable I guess, but I have read for compatibility reasons this memory spaces are still reserved. Is it possible to utilize this somehow?

What is the easiest way to get access to video memory from C# so I can write directly onto screen? Does DirectX or OpenGL provide such functionality, that would enable me to directly copy and array of bytes somewhere and get it rendered?

4
  • Are you trying to draw to the screen or capture from the screen? Commented Aug 6, 2012 at 12:40
  • I am trying to draw on the screen, write-only access, I don't need to read actual data in screen memory at all. Commented Aug 6, 2012 at 13:19
  • 1
    You might be better asking this on gamedev.stackexchange.com as there will probably be a higher concentration of people there who know about this kind of thing. Commented Aug 9, 2012 at 11:34
  • @JohnB Thank you, I will try to ask there then. Commented Aug 9, 2012 at 15:03

1 Answer 1

0

By using OpenGL's or Direct3D's built-in texture rendering capabilities, you can copy the pixel data from client side memory to server side memory and then have it render the texture on screen.

Note: With client side memory I mean the memory accessible from the program (on the CPU and in the RAM) and with server side memory I mean the memory on the graphics card. This has nothing to do with networking

Sign up to request clarification or add additional context in comments.

4 Comments

I don't see anything in the question about client/server networking?
With client side memory I meant the memory accessible from the program (on the CPU and in the RAM) and with server side memory I meant the memory on the graphics card. This has nothing to do with networking.
Ok well the graphics card isn't serving anything so it's a little misleading.
It's a term. I'll edit the answer to prevent any future confusion. Thanks for the comment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.