set texture width and height in AddQueque
This commit is contained in:
1 parent
7dd37b1608
commit
a663718f81
2 files changed
+20
-3
No files matched your search
@@ -807,6 +807,8 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
queque.data = Data;
|
queque.data = Data;
|
||||||
queque.height = H;
|
queque.height = H;
|
||||||
queque.width = W;
|
queque.width = W;
|
||||||
|
texture.height = H;
|
||||||
|
texture.width = W;
|
||||||
|
|
||||||
lock (MutexTexture)
|
lock (MutexTexture)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
|
|
||||||
|
|
||||||
#region implementation
|
#region implementation
|
||||||
|
#region main stuff
|
||||||
public bool Init()
|
public bool Init()
|
||||||
{
|
{
|
||||||
this.Text = CSettings.GetFullVersionText();
|
this.Text = CSettings.GetFullVersionText();
|
||||||
@@ -514,7 +514,8 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
CFonts.Style = text.Style;
|
CFonts.Style = text.Style;
|
||||||
return new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text)));
|
return new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text)));
|
||||||
}
|
}
|
||||||
|
#endregion main stuff
|
||||||
|
|
||||||
#region Basic Draw Methods
|
#region Basic Draw Methods
|
||||||
public void ClearScreen()
|
public void ClearScreen()
|
||||||
{
|
{
|
||||||
@@ -638,6 +639,8 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
#endregion Basic Draw Methods
|
#endregion Basic Draw Methods
|
||||||
|
|
||||||
#region Textures
|
#region Textures
|
||||||
|
|
||||||
|
#region adding
|
||||||
public STexture AddTexture(string TexturePath)
|
public STexture AddTexture(string TexturePath)
|
||||||
{
|
{
|
||||||
if (System.IO.File.Exists(TexturePath))
|
if (System.IO.File.Exists(TexturePath))
|
||||||
@@ -902,6 +905,8 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
queque.data = Data;
|
queque.data = Data;
|
||||||
queque.height = H;
|
queque.height = H;
|
||||||
queque.width = W;
|
queque.width = W;
|
||||||
|
texture.height = H;
|
||||||
|
texture.width = W;
|
||||||
|
|
||||||
lock (MutexTexture)
|
lock (MutexTexture)
|
||||||
{
|
{
|
||||||
@@ -913,7 +918,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
#endregion adding
|
||||||
|
|
||||||
|
#region updating
|
||||||
public bool UpdateTexture(ref STexture Texture, IntPtr Data)
|
public bool UpdateTexture(ref STexture Texture, IntPtr Data)
|
||||||
{
|
{
|
||||||
if (_TextureExists(ref Texture))
|
if (_TextureExists(ref Texture))
|
||||||
@@ -1021,6 +1028,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endregion updating
|
||||||
|
|
||||||
public void RemoveTexture(ref STexture Texture)
|
public void RemoveTexture(ref STexture Texture)
|
||||||
{
|
{
|
||||||
@@ -1055,6 +1063,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region drawing
|
||||||
public void DrawTexture(STexture Texture)
|
public void DrawTexture(STexture Texture)
|
||||||
{
|
{
|
||||||
DrawTexture(Texture, Texture.rect, Texture.color);
|
DrawTexture(Texture, Texture.rect, Texture.color);
|
||||||
@@ -1312,6 +1321,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion drawing
|
||||||
|
|
||||||
public int TextureCount()
|
public int TextureCount()
|
||||||
{
|
{
|
||||||
@@ -1369,9 +1379,15 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, q.width, q.height,
|
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, q.width, q.height,
|
||||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, q.data);
|
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, q.data);
|
||||||
|
|
||||||
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||||
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||||
|
|
||||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||||
|
|
||||||
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
|
||||||
|
GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||||
|
|
||||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||||
|
|
||||||
// Add to Texture List
|
// Add to Texture List
|
||||||
@@ -1384,7 +1400,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
_Queque.RemoveAt(0);
|
_Queque.RemoveAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Textures
|
#endregion Textures
|
||||||
|
|
||||||
#endregion implementation
|
#endregion implementation
|
||||||
|
|||||||
Reference in new issue
Block a user