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 599973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:33:23+00:00 2026-05-13T16:33:23+00:00

Say I have a SlimDX based game editor. I have a DeviceContext instance which

  • 0

Say I have a SlimDX based game editor. I have a DeviceContext instance which basically controls all states of the device, handles lost device, creates it, etc. The editor does not always have a view-port open where rendering is taking place. Instead it contains various editors, a scene editor, texture viewer/editor, animation editor, material editor, etc, etc.

Now say a user opens up the SceneEditor (a dialog with four views rendered into panels). When the editor is instanced, it grabs a reference from the DeviceContext and if found ‘null’ it calls on context.CreateDevice(Control ctrl). This method ‘ensures’ the device is not lost, null or disposed. If so, it takes care of it based on what is going on. Now the editor sends the ‘CreateDevice’ method the control(Panel) to use when creating/resetting the device, this control is the panel that represents the TopLeft view. Next it grabs a ‘Device’ reference from the context and then creates it’s swap-chains views (being the other three view-port Panels).

Now let’s say a user opens up the ModelViewer dialog. This too makes sure the device instance is not ‘null’ , if so calls on DeviceContext.CreateDevice(ModelViewPanel) and grabs the Device reference from it. If Device is not null, it creates a swap-chain for it’s view (where the Model will be rendered).

Ok so we have a scene editor with four views (the TopLeft Panel being the control used to create the Device object) and three other Panel objects created as swap-chains. Next we have the ModelViewer that the user opened. This has a single panel created as a swap-chain.

My question is:
Since the scene-editor has the control that initially created the device instance, what do I do if the user closes the scene editor? Do I call on Devi)ce.Reset() or create a ‘new’ Device()’ using the presentation parameters of the ModelViewer?

Please ask to re-factor the question if something is not understood, thanks.

  • 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-05-13T16:33:24+00:00Added an answer on May 13, 2026 at 4:33 pm

    My question is: Since the scene-editor has the control that initially created the device instance, what do I do if the user closes the scene editor? Do I call on Devi)ce.Reset() or create a ‘new’ Device()’ using the presentation parameters of the ModelViewer?

    Basically, if the user destroys the control that created the device, you’ll need to make a new device, based off a new control (and window handle).

    Since you’re already using swap chains, a different, very good option, is to make an (invisible) 1 pixel control, and use this to create your device. Then use swap chains to create all of your individual surfaces.

    The advantage here, of course, is that you can keep that HWND (the 1 pixel control’s handle) alive for the lifetime of your application – no more worry about the user destroying your device.

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

Sidebar

Related Questions

I want to set states in SlimDX Direct3d9 device. I have that code at
Say I have two columns of names. All names in the first column are
Let's say have a string... String myString = my*big*string*needs*parsing; All I want is to
Say I have a file called hello.txt which contains Hello World!. If I wanted
Say I have a class called Money which has parameters Dollars and Cents I
Say I have the following code <style type=text/css media=all> span, ul, ul li {
Lets say have this immutable record type: public class Record { public Record(int x,
Say I have a select box eg <div data-bind='visible: someProp'> <select class=selectSubWidgets data-bind='options: subWidgets,optionsText:
Say I have a Telerik MVC Grid, AJAX bound and I want to put
Say we have deep hashes like: b = {1 => {2 => {} },

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.