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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:09:51+00:00 2026-06-13T01:09:51+00:00

Is it possible to create and use a subclass of IDirect3DDevice9 ? It would

  • 0

Is it possible to create and use a subclass of IDirect3DDevice9? It would be very convenient for my code to do so, but I see that a device pointer is given as an out parameter from IDirect3D9::CreateDevice(), and I can’t just tell it to make an instance of my subclass instead.

I’d like to be able to do this so that other code that uses an IDirect3DDevice9 won’t have to change when I want it use a subclass of the device with expanded functionality. Specifically, the subclass needs to read the device’s render state settings and update shader variables to match whenever any variant of IDirect3DDevice9::Draw() is called, before the actual drawing is done. Again, I don’t want other code using a d3d device to change, because I want it to be able to use either a regular device or my augmented one.

Is it possible to create an instance of the subclass using an instance of the base class? If so, will that cause any problems such as Direct3D not set up to use the subclass instance, or multiple device instances in memory and thus having to share gfx card resources, etc.? Or should I just think of another way around this without using a subclass?

  • 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-13T01:09:52+00:00Added an answer on June 13, 2026 at 1:09 am

    I ended up doing as ErikEsTT suggested above and creating a separate class that contains the IDirect3DDevice9 pointer and provides the excess functionality. It’s not the solution I wanted because it’s not a seamless interface – client code still has to explicitly call a separate method. But it works.

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

Sidebar

Related Questions

So I know that it's possible to create scripts for use on spreadsheets using
Is it possible to create pointer of DBClientConnection and use it in multiply threads?
Is it at all possible to use Type Erasure to create objects that encapsulate
Is is possible to create/use a regular expression pattern in ruby that is based
Is It possible to create HTML5 Web Socket by use of ASP.NET/Web Form?
Is it possible to use javascript to populate multidimensional arrays. I want to create
Possible Duplicate: Create event handler for OnScroll for web browser control I would like
is it possible to create a custom file system or use an existing file
I need to use a SoapExtension subclass (which I have created), but it seems
Is it possible to create and use a user defined function in a report

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.