Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DirectX with MDI

DirectX with MDI

Scheduled Pinned Locked Moved C#
graphicsgame-devagentic-aihardwarehelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rob Tomson
    wrote on last edited by
    #1

    i'm trying to get a directx form to display as a child form in an mdi. i can't get it to run however. my reasoning behind this is so that i can have a configuration form and a directx windows up at the same time. then when i adjust the vales in the config window it updates the cooresponding values for the directx scene. i just can't get the directx form to keep rendering itself. here's some snippets, i hope you can help me. when the MDI form loads... RJSS.frmMain frm1 = new RJSS.frmMain(); frm1.MdiParent = this; frm1.Show(); RJSS.frmDD frm2 = new RJSS.frmDD(); frm2.MdiParent = this; frm2.Show(); declarations in the directx form... private DD.Device ddDevice; private O2.SpriteManager sm; private Open.HighResolutionTimer hrt; when the directx form loads... DD.PresentParameters pres = new DD.PresentParameters(); pres.Windowed = true; pres.SwapEffect = DD.SwapEffect.Discard; this.ddDevice = new DD.Device(0, DD.DeviceType.Hardware, this, DD.CreateFlags.SoftwareVertexProcessing, pres); this.hrt = new Open.HighResolutionTimer(); this.sm = new O2.SpriteManager(); this is what won't process. if i try to call this function the program just crashes out stating An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll protected void Render() { this.sm.Update(this.hrt.ElapsedTime); this.ddDevice.Clear(DD.ClearFlags.Target, Color.Black, 1.0f, 0); this.ddDevice.BeginScene(); this.sm.Draw(this.ddDevice); this.ddDevice.EndScene(); this.ddDevice.Present(); } any help is greatly appreciated. thanks, Rob Tomson -- There are 10 kinds of people. Those who understand binary and those who don't.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups