public GeometryPath(renderX GLSource, int rW, int rH) { SourceGL = GLSource; coX = 1f; coY = 1f; coZ = 1f; sX = 0; sY = 0; sZ = 0; cX = 0; cY = 0; cZ = 0; nearZ = 0.1f; farZ = 100000; renderWidth = rW; renderHeight = rH; float vMod = ((float)renderWidth - 1f) / renderWidth; float hMod = ((float)renderHeight - 1f) / renderHeight; rw = (renderWidth / 2f) * vMod;//todo swap with (renderWidth - 1f) / 2f rh = (renderHeight / 2f) * hMod; UpdateRM(90, 10, 0); sD = 4; wsD = 4 * renderWidth; }
public void BlitInto(renderX Target, int TargetX, int TargetY, Color TransparencyKey) { lock (ThreadLock) lock (Target.ThreadLock) { int oX = 0; int oY = 0; int sW = RenderWidth; int sH = RenderHeight; if (sW + TargetX > Target.RenderWidth) { sW -= ((sW + TargetX) - Target.RenderWidth); } if (sH + TargetY > Target.RenderHeight) { sH -= ((sH + TargetY) - Target.RenderHeight); } if (TargetX < 0) { oX = -TargetX; } if (TargetY < 0) { oY = -TargetY; } Target.zibltfunc(DrawingBuffer, RenderWidth * 4, sW, sH, oX, oY, TargetX, TargetY, TransparencyKey.R, TransparencyKey.G, TransparencyKey.B); } }
public GLFrameBuffer(renderX SourceGL, int ByteStrideSize, float RenderScale = 1) { if (SourceGL == null) { throw new Exception("null error"); } if (RenderScale == 0) { throw new Exception("Invalid Renderscale"); } if (renderScale != 1) { throw new Exception("Renderscale currentely disabled!"); } BufferLock = SourceGL.ThreadLock; lock (SourceGL.ThreadLock) { Width = (int)(SourceGL.RenderWidth * RenderScale); Height = (int)(SourceGL.RenderHeight * RenderScale); renderScale = RenderScale; size = Width * Height * ByteStrideSize; stride = ByteStrideSize; WidthStride = stride * Width; HEAP_ptr = Marshal.AllocHGlobal(size); SourceGL.BindFrameBuffer(this); } }
public GLCachedBuffer(renderX SourceGL) { if (SourceGL == null) { throw new Exception("null error"); } BufferLock = SourceGL.ThreadLock; lock (SourceGL.ThreadLock) { RGB_ptr = Marshal.AllocHGlobal(SourceGL.RenderWidth * SourceGL.RenderHeight * 4); Z_ptr = Marshal.AllocHGlobal(SourceGL.RenderWidth * SourceGL.RenderHeight * 4); SourceGL.BindCachedBuffer(this); } }