MCPcopy Create free account
hub / github.com/DISTRHO/DPF / onDisplay

Method onDisplay

examples/SendNote/SendNoteExampleUI.cpp:65–81  ·  view source on GitHub ↗

The OpenGL drawing function. This UI will draw a row of 12 keys, with on/off states according to pressed status. */

Source from the content-addressed store, hash-verified

63 This UI will draw a row of 12 keys, with on/off states according to pressed status.
64 */
65 void onDisplay() override
66 {
67 const GraphicsContext& context(getGraphicsContext());
68
69 for (int key = 0; key < 12; ++key)
70 {
71 bool pressed = fKeyState[key];
72 Rectangle<int> bounds = getKeyBounds(key);
73
74 if (pressed)
75 Color(0.8f, 0.5f, 0.3f).setFor(context);
76 else
77 Color(0.3f, 0.5f, 0.8f).setFor(context);
78
79 bounds.draw(context);
80 }
81 }
82
83 /**
84 Mouse press event.

Callers

nothing calls this directly

Calls 2

setForMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected