daily update on 20240226 by nitload youmu
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
@@ -9,12 +10,10 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
|
||||
internal unsafe partial class GLonRender : IglFunc
|
||||
{
|
||||
internal GLcontext* api;
|
||||
FrameTimeoutException refreshSIgnal = new FrameTimeoutException();
|
||||
|
||||
private FrameTimeoutException refreshSIgnal = new FrameTimeoutException();
|
||||
|
||||
internal GLonRender(GLcontext* context)
|
||||
{
|
||||
@@ -28,7 +27,6 @@ namespace StgSharp.Graphics
|
||||
|
||||
void IglFunc.SwitchContext()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -142,7 +140,6 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
|
||||
InternalIO.InternalWriteLog(log, LogType.Error);
|
||||
|
||||
}
|
||||
handleSet.SetValue(i, shaderID);
|
||||
}
|
||||
@@ -203,6 +200,7 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
api->glDeleteBuffers(1, (uint*)handle.Handle);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.DeleteBuffers(glHandleSet handle)
|
||||
{
|
||||
@@ -226,12 +224,15 @@ namespace StgSharp.Graphics
|
||||
case TypeCode.UInt32:
|
||||
a = GLconst.UNSIGNED_INT;
|
||||
break;
|
||||
|
||||
case TypeCode.UInt16:
|
||||
a = GLconst.UNSIGNED_SHORT;
|
||||
break;
|
||||
|
||||
case TypeCode.Byte:
|
||||
a = GLconst.UNSIGNED_BYTE;
|
||||
break;
|
||||
|
||||
default:
|
||||
InternalIO.InternalWriteLog(
|
||||
$"Parameter error in parameter {nameof(type)} method DrawElements. " +
|
||||
@@ -257,6 +258,7 @@ namespace StgSharp.Graphics
|
||||
api->glGenTextures((uint)count, h.handle);
|
||||
return h;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe glHandleSet IglFunc.GenVertexArrays(int count)
|
||||
{
|
||||
@@ -327,16 +329,12 @@ namespace StgSharp.Graphics
|
||||
api->glEnableVertexAttribArray(index);
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, T[] pixels)
|
||||
void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels)
|
||||
{
|
||||
Console.WriteLine(pixels);
|
||||
IntPtr source = GCHandle.Alloc(pixels, GCHandleType.Pinned).AddrOfPinnedObject();
|
||||
api->glTexImage2D(
|
||||
(uint)target, level, internalformat, width, height, 0, format, type, (void*)source
|
||||
(uint)target, level, internalformat, width, height, 0, format, type, pixels.valuePtr
|
||||
);
|
||||
GCHandle.FromIntPtr(source).Free();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -356,8 +354,5 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
api->glViewport(x, y, width, height);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user