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. Graphics
  4. DirectX: Resoution glitch after switching from fullscreen to windowed mode

DirectX: Resoution glitch after switching from fullscreen to windowed mode

Scheduled Pinned Locked Moved Graphics
csharpcomgraphicsgame-devhelp
4 Posts 2 Posters 4 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.
  • A Offline
    A Offline
    Aschratt
    wrote on last edited by
    #1

    Hey there :) I've got a strange problem... basicly I am writing an .NET (C#) application to render some stuff. By default the rendering works in an panel (Means the device uses the handle of the panel to render stuff there). So now I want to switch to fullscreen mode. Therefor I am creating a window with the size of my test resolution (800x600), release the pointers to the DirectX ressources and reinitialize the device with the window's handle and the fitting presentation parameters (.Windowed = FALSE, .BackBufferWidth/Height = ...). So far so good. It works fine! Now I want to leave fullscreen mode after the user presses the escape key. I am catching the user input and close the window. The OnFormClosing-Event is connected to an method which does the same procedure descriped above in the other direction. It releases the device ressources and the device, reinitializes it with the panel handle and the presentation parameters (.Windowed = TRUE, BackBufferWidth/Height = 0). And this is the problem! I can see the cursor and how it changes if I am moving it around (and about window borders) but the display stays cleared and the resolution does not change. I don't know whats going wrong there, because if I am using Alt+Tab to select my window containing the panel used for rendering and closing the fullscreen window then everything works fine! (And no the problem also isn't the escape-key or the way it gets checked... this part is working, because the FormClosing-event gets fired.) Any ideas what could go wrong? Thanks in advance! :)

    http://www.aschratt.com

    L 1 Reply Last reply
    0
    • A Aschratt

      Hey there :) I've got a strange problem... basicly I am writing an .NET (C#) application to render some stuff. By default the rendering works in an panel (Means the device uses the handle of the panel to render stuff there). So now I want to switch to fullscreen mode. Therefor I am creating a window with the size of my test resolution (800x600), release the pointers to the DirectX ressources and reinitialize the device with the window's handle and the fitting presentation parameters (.Windowed = FALSE, .BackBufferWidth/Height = ...). So far so good. It works fine! Now I want to leave fullscreen mode after the user presses the escape key. I am catching the user input and close the window. The OnFormClosing-Event is connected to an method which does the same procedure descriped above in the other direction. It releases the device ressources and the device, reinitializes it with the panel handle and the presentation parameters (.Windowed = TRUE, BackBufferWidth/Height = 0). And this is the problem! I can see the cursor and how it changes if I am moving it around (and about window borders) but the display stays cleared and the resolution does not change. I don't know whats going wrong there, because if I am using Alt+Tab to select my window containing the panel used for rendering and closing the fullscreen window then everything works fine! (And no the problem also isn't the escape-key or the way it gets checked... this part is working, because the FormClosing-event gets fired.) Any ideas what could go wrong? Thanks in advance! :)

      http://www.aschratt.com

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Aschratt wrote:

      Any ideas what could go wrong?

      No. It sounds too complex for me, why don't you use a Panel in full size too? Just make your window full size, and fill it with the Panel, possibly by setting panel.Dock=DockStyle.Fill? :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
      All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.


      A 1 Reply Last reply
      0
      • L Luc Pattyn

        Aschratt wrote:

        Any ideas what could go wrong?

        No. It sounds too complex for me, why don't you use a Panel in full size too? Just make your window full size, and fill it with the Panel, possibly by setting panel.Dock=DockStyle.Fill? :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
        All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.


        A Offline
        A Offline
        Aschratt
        wrote on last edited by
        #3

        Because there are other controls on this formular ;) The fullscreen mode should be simply used for "viewing" (and only for viewing). The windowed mode should be some kind of editor. Anyway I do have to reinitialize the device after switching back from fullscreen mode (since this is set using the presentation parameters). And so this should not solve my problem, I guess... :( Thanks anyway so far :)

        http://www.aschratt.com

        A 1 Reply Last reply
        0
        • A Aschratt

          Because there are other controls on this formular ;) The fullscreen mode should be simply used for "viewing" (and only for viewing). The windowed mode should be some kind of editor. Anyway I do have to reinitialize the device after switching back from fullscreen mode (since this is set using the presentation parameters). And so this should not solve my problem, I guess... :( Thanks anyway so far :)

          http://www.aschratt.com

          A Offline
          A Offline
          Aschratt
          wrote on last edited by
          #4

          Allright... problem solved. I simply forgot to release all references to the device :) Thanks anyway!

          http://www.aschratt.com

          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