Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8503365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:44:20+00:00 2026-06-11T01:44:20+00:00

Problem: Need to share a SlimDx.Direct3D9.Surface with another process so it can show the

  • 0

Problem:
Need to share a SlimDx.Direct3D9.Surface with another process so it can show the render output. I can create the Surface, but I have not found a way to share it between processes.

Available Code
I have access to both sides of the application, but the application providing the render output is limited. I have no access to the creation of the devices. I can reference the Direct3D9 device, create a render target, and successfully capture the output.

More details

I have a feeling I will be accused of not looking first, but I can assure you I have to the best of my ability.

But, I’m trying to share a DirectX 9 Surface to another process so I can capture the render output within an external form.

I have found several things on Shared Surfaces, but haven’t seemed to figure out how to do it with a DirectX 9 device sharing surfaces between 2 process.

My access to the DirectX device itself is limited. I am accessing it through a built in scripting module embeded in the application. I do not have the option of knowing creation properties or parameters that aren’t public variables but I do have complete access to the Device itself.

So with the code below (to demonstrate exactly what I have to work with for the most part) I’m trying to figure out how I could share that Surface with another process so I can get the renderer’s output on that Form.

Basically, I have code that looks like this:
(simplified)

byte[] ARGB;
//Getting internal access to renderer's Direct3D9.Device (Already created)
SlimDx.Direct3D9.Device dev = renderer.Device.Device;
//Surface I create to capture the devices output
SlimDx.Direct3D9.Surface destination; 
//Create render target to device
destination = Surface.CreateRenderTarget(this.dev, this.w, this.h, Format.A8R8G8B8, MultisampleType.None, 0, true);

// 1. Render, 
// 2. then grab snapshot (internal call), 
// 3. convert to byte array (not relevant to what I'm currently doing)
if (this.renderer.Render())
{
    board.Snapshot(this.destination); //some internal logic to get surface
    try
    {
        using (DataStream data = destination.LockRectangle(LockFlags.ReadOnly).Data)
        {
            data.Read(ARGB, 0, (int) data.Length);
        }
    }
    finally
    {
        this.destination.UnlockRectangle();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:44:21+00:00Added an answer on June 11, 2026 at 1:44 am

    To share textures with directx9, your device needs to be of type:

    SlimDX.Direct3D9.DeviceEx mydeviceex;
    

    Default directx9 device does not support shared resources.

    Then you can get a shared handle using:

     IntPtr sharedhandle;
     Texture texture = new Texture(mydeviceex, width, height, 1, Usage.RenderTarget,    
     format, Pool.Default, out sharedhandle);
    

    1 is for mipmaps (shared resources must have only one level).
    Format has some limitations too, A8R8G8B8 is quite common in that case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem I just can't fix. I need to find if a
I'm new in using boost and have a problem. I need shared_mutex function in
My problem : I need to create draggable widgets (here it's a jslider for
I have problem i need to convert from my Array structure to std::vector<int> ...
I have the following problem: I need to use XSLFO to generate a 2-column
I need to share sessions between subdomain but my sessions are stored in weird
I need to share variables between different Children processes and my Parent process in
We have a common functionality we need to share among several applications. We already
I have a problem where I need to keep and increment an object number
We have a number of remote workers around the world that need to share

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.