static void RB_SetBuffer(SetBufferCommand cmd) { // see which draw buffer we want to render the frame to backEnd.frameCount = cmd.frameCount; // Disabled for OES2 //qglDrawBuffer(cmd.buffer); GLimp_SetupFrame(cmd.buffer); // clear screen for debugging automatically enable this with several other debug tools that might leave unrendered portions of the screen if (R.r_clear.Float != 0f || R.r_clear.String.Length != 1 || r_lockSurfaces.Bool || r_singleArea.Bool) { if (TextScanFormatted.Scan(R.r_clear.String, "%f %f %f", out float c0, out float c1, out float c2) == 3) { qglClearColor(c0, c1, c2, 1f); } else if (R.r_clear.Integer == 2) { qglClearColor(0f, 0f, 0f, 1f); } else { qglClearColor(0.4f, 0f, 0.25f, 1f); } qglClear((uint)AttribMask.ColorBufferBit); }
public static bool TryGetMatrix(this Dictionary <string, string> source, string key, string defaultValue, out Matrix3x3 o) { var r = source.TryGetValue(key, out var z); o = Matrix3x3.identity; TextScanFormatted.Scan(r ? z : defaultValue ?? "1 0 0 0 1 0 0 0 1", "%f %f %f %f %f %f %f %f %f", out o[0].x, out o[0].y, out o[0].z, out o[1].x, out o[1].y, out o[1].z, out o[2].x, out o[2].y, out o[2].z); return(r); }
public static bool TryGetAngles(this Dictionary <string, string> source, string key, string defaultValue, out Angles o) { var r = source.TryGetValue(key, out var z); o = new(); TextScanFormatted.Scan(r ? z : defaultValue ?? "0 0 0", "%f %f %f", out o.pitch, out o.yaw, out o.roll); return(r); }
public static bool TryGetVec4(this Dictionary <string, string> source, string key, string defaultValue, out Vector4 o) { var r = source.TryGetValue(key, out var z); o = new(); TextScanFormatted.Scan(r ? z : defaultValue ?? "0 0 0 0", "%f %f %f %f", out o.x, out o.y, out o.z, out o.w); return(r); }