Forum
Contact





DirectX using C#
DirectX using C++
DirectX using Visual Basic



Latest Forum posts

 No download link for 2d series: shooter
  Posted by: zaboleq
  When: 07/05/2013 at 15:46:28

 Collision Class?
  Posted by: Anonymous
  When: 05/05/2013 at 19:03:59

 stack overflow
  Posted by: cityguy
  When: 07/04/2013 at 01:58:38

 Meshes looks strange.
  Posted by: ab_saratov
  When: 01/04/2013 at 04:31:08

 Lamppost Not loaded
  Posted by: Anonymous
  When: 22/03/2013 at 06:43:52

 Collision Class?
  Posted by: Da_Boom
  When: 21/03/2013 at 01:23:09

 Math boggles me
  Posted by: cityguy
  When: 17/03/2013 at 03:44:48

 Collision Class?
  Posted by: Da_Boom
  When: 16/03/2013 at 03:44:42

 Tree update
  Posted by: Anonymous
  When: 15/03/2013 at 21:11:22

 XNA 4.0
  Posted by: Anonymous
  When: 15/03/2013 at 19:43:57

 Error when I try to run.
  Posted by: Anonymous
  When: 15/03/2013 at 19:21:06

 Error With the Effect File
  Posted by: Anonymous
  When: 15/03/2013 at 18:21:01

 Can only get shadowmap
  Posted by: Anonymous
  When: 15/03/2013 at 15:48:52

 Vertex and Pixel Shader Versions?
  Posted by: Anonymous
  When: 15/03/2013 at 15:07:16

 Unsupported properties
  Posted by: Anonymous
  When: 15/03/2013 at 14:23:00

 Problem Loading Skybox
  Posted by: Rana
  When: 15/03/2013 at 10:34:45

 Black Screen Of Death - Help!
  Posted by: Anonymous
  When: 15/03/2013 at 03:43:43

 2.0 anyone?
  Posted by: Anonymous
  When: 15/03/2013 at 02:19:48

 Defitinition of tha rotation axis
  Posted by: Anonymous
  When: 15/03/2013 at 00:55:14

 Typo / Inconsistancy for 360 deployment.
  Posted by: Anonymous
  When: 14/03/2013 at 19:48:23




Topic: Not 100% reliable when shrinking window



  
Goto parent category
  
Create a new user account


   Not 100% reliable when shrinking window
 Poster : Hoodlum
 Posts: 1
 Country : UK
 City: Bolton

  
Posted by Hoodlum on 22/10/2006 at 17:42:12
The code presented in this section works fine when increasing the size of the window, but when decreasing the window size beneath the original dimensions, the window contents disappear as before.

Having debugged, the DeviceReset event still gets fired, but the window contents do not get redrawn. Adding a manual call to OnPaint also does not fix this problem.

Has anyone else encountered this, or found a solution?

Cheers
 Poster : riemer
 Posts: 1392
 Country : Belgium
 City: Antwerp

  
Posted by riemer on 23/10/2006 at 02:42:58
Yes indeed, I have noticed the same, and to be honest, I have learned to live with it ;)

I have tried several methods I found on the net, but they all give the same result.
 Poster : Anonymous
 Posts:
 Country :
 City:

  
Posted by Anonymous on 14/11/2006 at 08:59:59
There's a problem with "this.Width / this.Height" - it's an integer division, and when Width<Height it gives you zero.
Writing "(float) this.Width / this.Height" instead should fix it.

Zbignief
 Poster : riemer
 Posts: 1392
 Country : Belgium
 City: Antwerp

  
Posted by riemer on 16/11/2006 at 02:53:55
Thanks a lot! I've replaced those lines in the ShortTut chapter.
 Poster : Anonymous
 Posts:
 Country :
 City:

  
Posted by Anonymous on 03/03/2008 at 15:13:32
It seems because the Paint event is not triggered when decreasing the size. You might want to respond Form.SizeChanged event.
 Poster : Anonymous
 Posts:
 Country :
 City:

  
Posted by Anonymous on 08/04/2008 at 12:22:40
In order to properly redraw, make sure that in the form's constructor you add this:

this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true);

Next, you also need to add this to the form's OnPaint event:

this.Invalidate();

He covered this in Series 1 Tutorial 3 (Drawing a Triangle). Also, make sure you clear the device, as otherwise the previous render will remain in the buffer.

  
Post a new reply
 





Google
 
Web www.riemers.net
If you appreciate the amount of time I spend creating and updating
these pages, feel free to donate -- any amount is welcome !
- Website design & DirectX code : Riemer Grootjans -
©2006 Riemer Grootjans


News
Home
Forum
XNA 2.0 Recipes Book (8)
XNA 3.0 Recipes Book (8)
Downloads
Extra Reading (3)
Matrices: geometrical
Matrix Mathematics
Homogenous matrices
Community Projects (1)
Tutorials (160)
XNA 4.0 using C# (89)
DirectX using C# (54)
Series 1:Terrain (14)
Opening a window
Linking to the Device
Drawing a triangle
Camera
Rotation - Translation
Indices
Terrain creation
Terrain from file
DirectInput
Importing bmp files
Colored vertices
DirectX Light basics
Mesh creation
Mesh lighting
Series 2: Flightsim (19)
Series 3: HLSL (19)
Short Tuts (2)
Resizing problem
Checking Device caps
DirectX using C++ (15)
DirectX using VB (2)