fna-workbench

fna-workbench Commit Details


Date:2016-01-14 10:10:51 (9 years 7 months ago)
Author:Ethan Lee
Branch:master
Commit:867215992eea0b40d0b58f986988e5f1145bb129
Parents: 497681b71200378a3e96d7c4a91fbb80ea63672a
Message:Mouse no longer depends on Game

Changes:

File differences

src/Graphics/GraphicsDevice.cs
386386
387387
388388
389
390
391
392
389393
390394
391395
......
634638
635639
636640
641
642
643
644
637645
638646
639647
// Set up the OpenGL Device. Loads entry points.
GLDevice = new OpenGLDevice(PresentationParameters);
// The mouse needs to know this for faux-backbuffer mouse scaling.
Input.Mouse.INTERNAL_BackBufferWidth = PresentationParameters.BackBufferWidth;
Input.Mouse.INTERNAL_BackBufferHeight = PresentationParameters.BackBufferHeight;
// Force set the default render states.
BlendState = BlendState.Opaque;
DepthStencilState = DepthStencilState.Default;
RenderTargetCount > 0
);
// The mouse needs to know this for faux-backbuffer mouse scaling.
Input.Mouse.INTERNAL_BackBufferWidth = PresentationParameters.BackBufferWidth;
Input.Mouse.INTERNAL_BackBufferHeight = PresentationParameters.BackBufferHeight;
#if WIIU_GAMEPAD
wiiuPixelData = new byte[
PresentationParameters.BackBufferWidth *
src/Input/Mouse.cs
3030
3131
3232
33
34
33
34
35
36
3537
3638
3739
......
7375
7476
7577
76
77
78
79
7880
7981
8082
......
101103
102104
103105
104
105
106
107
106108
107109
108110
#region Internal Variables
internal static int INTERNAL_WindowWidth = 800;
internal static int INTERNAL_WindowHeight = 600;
internal static int INTERNAL_WindowWidth = GraphicsDeviceManager.DefaultBackBufferWidth;
internal static int INTERNAL_WindowHeight = GraphicsDeviceManager.DefaultBackBufferHeight;
internal static int INTERNAL_BackBufferWidth = GraphicsDeviceManager.DefaultBackBufferWidth;
internal static int INTERNAL_BackBufferHeight = GraphicsDeviceManager.DefaultBackBufferHeight;
internal static int INTERNAL_MouseWheel = 0;
else
{
// Scale the mouse coordinates for the faux-backbuffer
x = (int) ((double) x * Game.Instance.GraphicsDevice.GLDevice.Backbuffer.Width / INTERNAL_WindowWidth);
y = (int) ((double) y * Game.Instance.GraphicsDevice.GLDevice.Backbuffer.Height / INTERNAL_WindowHeight);
x = (int) ((double) x * INTERNAL_BackBufferWidth / INTERNAL_WindowWidth);
y = (int) ((double) y * INTERNAL_BackBufferHeight / INTERNAL_WindowHeight);
}
return new MouseState(
INTERNAL_warpY = y;
// Scale the mouse coordinates for the faux-backbuffer
x = (int) ((double) x * INTERNAL_WindowWidth / Game.Instance.GraphicsDevice.GLDevice.Backbuffer.Width);
y = (int) ((double) y * INTERNAL_WindowHeight / Game.Instance.GraphicsDevice.GLDevice.Backbuffer.Height);
x = (int) ((double) x * INTERNAL_WindowWidth / INTERNAL_BackBufferWidth);
y = (int) ((double) y * INTERNAL_WindowHeight / INTERNAL_BackBufferHeight);
FNAPlatform.SetMousePosition(WindowHandle, x, y);
INTERNAL_IsWarped = true;

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.48262s using 13 queries.