Rename Unload to Close to match Init-Close pattern
This commit is contained in:
1 parent
31863a7788
commit
1c884f3acb
8 files changed
+16
-13
No files matched your search
@@ -91,11 +91,11 @@ namespace Vocaluxe.Base
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unloads the current driver, e.g. to switch to another one
|
/// Unloads the current driver, e.g. to switch to another one
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void Unload()
|
public static void Close()
|
||||||
{
|
{
|
||||||
if (_Draw != null)
|
if (_Draw != null)
|
||||||
{
|
{
|
||||||
_Draw.Unload();
|
_Draw.Close();
|
||||||
_Draw = null;
|
_Draw = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,9 +390,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// Unloads all Textures and other objects used by Direct3D for rendering
|
/// Unloads all Textures and other objects used by Direct3D for rendering
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override void Unload()
|
public override void Close()
|
||||||
{
|
{
|
||||||
base.Unload();
|
base.Close();
|
||||||
STexturedColoredVertex.DisposeDeclaration();
|
STexturedColoredVertex.DisposeDeclaration();
|
||||||
_VertexBuffer.Dispose();
|
_VertexBuffer.Dispose();
|
||||||
_IndexBuffer.Dispose();
|
_IndexBuffer.Dispose();
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
private SClientRect _Restore;
|
private SClientRect _Restore;
|
||||||
protected Size _SizeBeforeMinimize;
|
protected Size _SizeBeforeMinimize;
|
||||||
|
|
||||||
public override void Unload()
|
public override void Close()
|
||||||
{
|
{
|
||||||
base.Unload();
|
base.Close();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_Form.Close();
|
_Form.Close();
|
||||||
|
|||||||
@@ -253,11 +253,11 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unload()
|
public new void Close()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Close();
|
base.Close();
|
||||||
}
|
}
|
||||||
catch {}
|
catch {}
|
||||||
Dispose();
|
Dispose();
|
||||||
|
|||||||
@@ -240,9 +240,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Unload()
|
public override void Close()
|
||||||
{
|
{
|
||||||
base.Unload();
|
base.Close();
|
||||||
GL.DeleteFramebuffers(1, ref _FBO);
|
GL.DeleteFramebuffers(1, ref _FBO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@@ -116,7 +117,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Unload()
|
public virtual void Close()
|
||||||
{
|
{
|
||||||
_EnsureMainThread();
|
_EnsureMainThread();
|
||||||
lock (_Textures)
|
lock (_Textures)
|
||||||
@@ -731,6 +732,8 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
// 3) a) AddTexture(fileA) || b) EnqueueTexture(fileA) with a)getFromCache + b)getFromCache + a)addToCache + b)addToCache --> Only keep one copy
|
// 3) a) AddTexture(fileA) || b) EnqueueTexture(fileA) with a)getFromCache + b)getFromCache + a)addToCache + b)addToCache --> Only keep one copy
|
||||||
// All solved with atomic get/add cache and _WaitForTextureLoaded
|
// All solved with atomic get/add cache and _WaitForTextureLoaded
|
||||||
|
|
||||||
|
if (!File.Exists(filePath))
|
||||||
|
return null;
|
||||||
CTextureRef textureRef;
|
CTextureRef textureRef;
|
||||||
TTextureType texture = null;
|
TTextureType texture = null;
|
||||||
Task<Size> loader;
|
Task<Size> loader;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
{
|
{
|
||||||
bool Init();
|
bool Init();
|
||||||
void MainLoop();
|
void MainLoop();
|
||||||
void Unload();
|
void Close();
|
||||||
|
|
||||||
int GetScreenWidth();
|
int GetScreenWidth();
|
||||||
int GetScreenHeight();
|
int GetScreenHeight();
|
||||||
|
|||||||
+1
-1
@@ -270,7 +270,7 @@ namespace Vocaluxe
|
|||||||
CVideo.Close();
|
CVideo.Close();
|
||||||
CRecord.Close();
|
CRecord.Close();
|
||||||
CSound.Close();
|
CSound.Close();
|
||||||
CDraw.Unload();
|
CDraw.Close();
|
||||||
GC.Collect(); // Do a GC run here before we close logs to have finalizers run
|
GC.Collect(); // Do a GC run here before we close logs to have finalizers run
|
||||||
CLog.CloseAll(); // Do this last, so we get all log entries!
|
CLog.CloseAll(); // Do this last, so we get all log entries!
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user