parent
241af47ec9
commit
f299b433ec
@ -149,15 +149,15 @@ namespace SampleFramework
|
||||
|
||||
public unsafe void GetScreenPixelsASync(Action<SKBitmap> action)
|
||||
{
|
||||
uint[] pixels = new uint[(uint)ViewportWidth * (uint)ViewportHeight];
|
||||
byte[] pixels = new byte[(uint)ViewportWidth * (uint)ViewportHeight * 4];
|
||||
Gl.ReadBuffer(GLEnum.Front);
|
||||
fixed(uint* pix = pixels)
|
||||
fixed(byte* pix = pixels)
|
||||
{
|
||||
Gl.ReadPixels(0, 0, (uint)ViewportWidth, (uint)ViewportHeight, GLEnum.Bgra, GLEnum.UnsignedByte, pix);
|
||||
}
|
||||
|
||||
Task.Run(() =>{
|
||||
fixed(uint* pixels2 = new uint[(uint)ViewportWidth * (uint)ViewportHeight])
|
||||
fixed(byte* pixels2 = new byte[(uint)ViewportWidth * (uint)ViewportHeight * 4])
|
||||
{
|
||||
for(int x = 0; x < ViewportWidth; x++)
|
||||
{
|
||||
@ -165,8 +165,10 @@ namespace SampleFramework
|
||||
{
|
||||
int pos = x + ((y - 1) * ViewportWidth);
|
||||
int pos2 = x + ((ViewportHeight - y) * ViewportWidth);
|
||||
var p = pixels[pos2];
|
||||
pixels2[pos] = p;
|
||||
pixels2[(pos * 4) + 0] = pixels[(pos2 * 4) + 0];
|
||||
pixels2[(pos * 4) + 1] = pixels[(pos2 * 4) + 1];
|
||||
pixels2[(pos * 4) + 2] = pixels[(pos2 * 4) + 2];
|
||||
pixels2[(pos * 4) + 3] = 255;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,14 @@ namespace TJAPlayer3
|
||||
Task.Run(() =>
|
||||
{
|
||||
this.list進行文字列.Add("LOADING TEXTURES...");
|
||||
TJAPlayer3.Tx.LoadTexture();
|
||||
try
|
||||
{
|
||||
TJAPlayer3.Tx.LoadTexture();
|
||||
}
|
||||
catch(Exception exception)
|
||||
{
|
||||
Trace.TraceError( exception.ToString() );
|
||||
}
|
||||
this.list進行文字列.Add("LOADING TEXTURES...OK");
|
||||
this.str現在進行中 = "Setup done.";
|
||||
this.eフェーズID = Eフェーズ.起動7_完了;
|
||||
|
@ -45,6 +45,8 @@ namespace TJAPlayer3
|
||||
|
||||
public override void DeActivate()
|
||||
{
|
||||
TJAPlayer3.tテクスチャの解放(ref Mob);
|
||||
|
||||
base.DeActivate();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user