Skip to content

Commit

Permalink
Add executable for rendering axis deadzones/curves
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Jan 30, 2021
1 parent 453413a commit 4164926
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions render.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2020-present, Fred Emmott <[email protected]>
* All rights reserved.
*
* This source code is licensed under the ISC license found in the LICENSE file
* in the root directory of this source tree.
*/

// This file is an executable, intended to generate illustrative diagrams
// of some basic axis mapping operations

#include "lib/easymode.h"
#include "lib/render_axis.h"

using fredemmott::inputmapping::render_axis;
using fredemmott::inputmapping::AxisEventHandler;

int main() {
render_axis("linear.bmp", [](auto next) { return next; });
render_axis("curve_0.bmp", [](auto next) { return AxixCurve { 0, next }; });
render_axis("curve_0.5.bmp", [](auto next) { return AxixCurve { 0.5, next }; });
render_axis("curve_neg0.5.bmp", [](auto next) { return AxixCurve { -0.5, next }; });
render_axis("curve_0.99.bmp", [](auto next) { return AxixCurve { 0.99, next }; });
render_axis("dead_10.bmp", [](auto next) { return SquareDeadzone { 10, next }; });
render_axis("dead_curve.bmp", [](auto next) { return SquareDeadzone { 50, AxisCurve { 0.5, next } }; });
render_axis("curve_dead.bmp", [](auto next) { return AxisCurve { 0.5, SquareDeadzone { 50, next } }; });
return 0;
}

0 comments on commit 4164926

Please sign in to comment.