Browse Source

Merge branch 'master' of github.com:Spectere/DotSDL

Removed Sample.Doodle for now.
improved_timing
Ian Burgmyer 6 years ago
parent
commit
474870aae5
  1. 38
      DotSDL.sln
  2. 38
      DotSDL/Graphics/SdlWindow.cs

38
DotSDL.sln

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.6
VisualStudioVersion = 15.0.26430.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{53C506CE-9D99-4306-A304-D4B09924A883}"
ProjectSection(SolutionItems) = preProject
@ -43,29 +43,29 @@ Global
{51055215-1F3D-436F-B88C-02A5C58C6989}.Release|x64.Build.0 = Release|x64
{51055215-1F3D-436F-B88C-02A5C58C6989}.Release|x86.ActiveCfg = Release|x86
{51055215-1F3D-436F-B88C-02A5C58C6989}.Release|x86.Build.0 = Release|x86
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5}.Debug|x64.ActiveCfg = Debug|Any CPU
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5}.Debug|x64.Build.0 = Debug|Any CPU
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5}.Debug|x86.ActiveCfg = Debug|Any CPU
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5}.Debug|x86.Build.0 = Debug|Any CPU
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5}.Release|x64.ActiveCfg = Release|Any CPU
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5}.Release|x64.Build.0 = Release|Any CPU
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5}.Release|x86.ActiveCfg = Release|Any CPU
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5}.Release|x86.Build.0 = Release|Any CPU
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40}.Debug|x64.ActiveCfg = Debug|Any CPU
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40}.Debug|x64.Build.0 = Debug|Any CPU
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40}.Debug|x86.ActiveCfg = Debug|Any CPU
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40}.Debug|x86.Build.0 = Debug|Any CPU
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40}.Release|x64.ActiveCfg = Release|Any CPU
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40}.Release|x64.Build.0 = Release|Any CPU
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40}.Release|x86.ActiveCfg = Release|Any CPU
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40}.Release|x86.Build.0 = Release|Any CPU
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730}.Debug|x64.ActiveCfg = Debug|x64
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730}.Debug|x64.Build.0 = Debug|x64
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730}.Debug|x86.ActiveCfg = Debug|x86
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730}.Debug|x86.Build.0 = Debug|x86
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730}.Release|x64.ActiveCfg = Release|x64
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730}.Release|x64.Build.0 = Release|x64
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730}.Release|x86.ActiveCfg = Release|x86
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730}.Release|x86.Build.0 = Release|x86
{05C4735D-89CD-4501-88EC-B332A15D425E}.Debug|x64.ActiveCfg = Debug|x64
{05C4735D-89CD-4501-88EC-B332A15D425E}.Debug|x64.Build.0 = Debug|x64
{05C4735D-89CD-4501-88EC-B332A15D425E}.Debug|x86.ActiveCfg = Debug|x86
{05C4735D-89CD-4501-88EC-B332A15D425E}.Debug|x86.Build.0 = Debug|x86
{05C4735D-89CD-4501-88EC-B332A15D425E}.Release|x64.ActiveCfg = Release|x64
{05C4735D-89CD-4501-88EC-B332A15D425E}.Release|x64.Build.0 = Release|x64
{05C4735D-89CD-4501-88EC-B332A15D425E}.Release|x86.ActiveCfg = Release|x86
{05C4735D-89CD-4501-88EC-B332A15D425E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{51055215-1F3D-436F-B88C-02A5C58C6989} = {70DA3135-B76E-421D-B9CF-E49CD6440B0A}
{B71D69F1-3BB1-4CC8-AB6A-2A0F2DAE9FE5} = {70DA3135-B76E-421D-B9CF-E49CD6440B0A}
{45E8AA1C-97DC-4889-B64E-2874BCAC6D40} = {70DA3135-B76E-421D-B9CF-E49CD6440B0A}
{FFE65F50-D4CB-4246-9FCB-E7E3E0FA2730} = {70DA3135-B76E-421D-B9CF-E49CD6440B0A}
{05C4735D-89CD-4501-88EC-B332A15D425E} = {70DA3135-B76E-421D-B9CF-E49CD6440B0A}
EndGlobalSection
EndGlobal

38
DotSDL/Graphics/SdlWindow.cs

@ -46,21 +46,24 @@ namespace DotSDL.Graphics {
/// <summary>Gets or sets the amount of time, in milliseconds, between game (logic) updates.</summary>
public uint GameUpdateTicks { get; set; }
/// <summary>
/// Indicates that the window manager should position the window. To place the window on a specific display, use the <see cref="WindowPosCenteredDisplay"/> function.
/// </summary>
/// <summary>Indicates that the window manager should position the window. To place the window on a specific display, use the <see cref="WindowPosCenteredDisplay"/> function.</summary>
public const int WindowPosUndefined = 0x1FFF0000;
/// <summary>
/// Fired when a key is pressed.
/// </summary>
/// <summary>Fired when the window's close button is clicked.</summary>
public event EventHandler<WindowEvent> Closed;
/// <summary>Fired when a key is pressed.</summary>
public event EventHandler<KeyboardEvent> KeyPressed;
/// <summary>
/// Fired when a key is released.
/// </summary>
/// <summary>Fired when a key is released.</summary>
public event EventHandler<KeyboardEvent> KeyReleased;
/// <summary>Fired when the window's minimize button is clicked.</summary>
public event EventHandler<WindowEvent> Minimized;
/// <summary>Fired when the window is restored.</summary>
public event EventHandler<WindowEvent> Restored;
/// <summary>
/// Calculates a value that allows the window to be placed on a specific display, with its exact position determined by the window manager.
/// </summary>
@ -200,13 +203,13 @@ namespace DotSDL.Graphics {
internal void HandleEvent(WindowEvent ev) {
switch(ev.Event) {
case WindowEventType.Close:
OnClose();
OnClose(ev);
break;
case WindowEventType.Minimized:
OnMinimize();
OnMinimize(ev);
break;
case WindowEventType.Restored:
OnRestore();
OnRestore(ev);
break;
}
}
@ -241,8 +244,9 @@ namespace DotSDL.Graphics {
/// <summary>
/// Called when the window's close button is clicked.
/// </summary>
protected virtual void OnClose() {
Stop();
private void OnClose(WindowEvent ev) {
if(Closed is null) Stop();
else Closed(this, ev);
}
/// <summary>
@ -259,15 +263,17 @@ namespace DotSDL.Graphics {
/// <summary>
/// Called when the window is minimized.
/// </summary>
protected virtual void OnMinimize() {
private void OnMinimize(WindowEvent ev) {
IsMinimized = true;
Minimized?.Invoke(this, ev);
}
/// <summary>
/// Called when the window is restored.
/// </summary>
protected virtual void OnRestore() {
private void OnRestore(WindowEvent ev) {
IsMinimized = false;
Restored?.Invoke(this, ev);
}
/// <summary>

Loading…
Cancel
Save