aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-05-02 07:13:49 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-05-02 07:13:49 +0000
commit0d66d9b6b30777f3e2e99e5d7dbddb6a0c904c35 (patch)
tree7449a02a8cb55306b761c9eb3dd9f85d0f6f68d3
parent818ab818dcc87bacb1acc8448f49c5c5ff99d37f (diff)
downloadusdx-0d66d9b6b30777f3e2e99e5d7dbddb6a0c904c35.tar.gz
usdx-0d66d9b6b30777f3e2e99e5d7dbddb6a0c904c35.tar.xz
usdx-0d66d9b6b30777f3e2e99e5d7dbddb6a0c904c35.zip
- Fix for "Wrong mouse position after screen-resize" bug reported here (http://forum.ultra-star.de/viewtopic.php?f=65&t=7768&p=57151#p57151)
- Note: Screen.w and Screen.h are not updated after a resize as SDL_SetVideoMode is not called on windows on a resize event. Previously SDL_SetVideoMode invalidated all OpenGL textures resulting in most textures white. Using SDL_SetVideoMode at a resize seems to work now at least with SDL 1.2.14 and Win7. Maybe we should switch it on again. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2328 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--src/base/UMain.pas10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/base/UMain.pas b/src/base/UMain.pas
index ca14525f..53518d1e 100644
--- a/src/base/UMain.pas
+++ b/src/base/UMain.pas
@@ -426,8 +426,8 @@ begin
end;
end;
- Display.MoveCursor(Event.button.X * 800 * Screens / Screen.w,
- Event.button.Y * 600 / Screen.h);
+ Display.MoveCursor(Event.button.X * 800 * Screens / ScreenW,
+ Event.button.Y * 600 / ScreenH);
if not Assigned(Display.NextScreen) then
begin //drop input when changing screens
@@ -456,6 +456,12 @@ begin
// This would create a new OpenGL render-context and all texture data
// would be invalidated.
// On Linux the mode MUST be reset, otherwise graphics will be corrupted.
+ // Update: It seems to work now without creating a new OpenGL context. At least
+ // with Win7 and SDL 1.2.14. Maybe it generally works now with SDL 1.2.14 and we
+ // can switch it on for windows.
+ // Important: Unless SDL_SetVideoMode() is called (it is not on Windows), Screen.w
+ // and Screen.h are not valid after a resize and still contain the old size. Use
+ // ScreenW and ScreenH instead.
{$IF Defined(Linux) or Defined(FreeBSD)}
if boolean( Ini.FullScreen ) then
SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN)