MCPcopy Create free account
hub / github.com/HackerPoet/FractalSoundExplorer / ScreenToPt

Function ScreenToPt

Main.cpp:52–55  ·  view source on GitHub ↗

Screen utilities

Source from the content-addressed store, hash-verified

50
51//Screen utilities
52void ScreenToPt(int x, int y, double& px, double& py) {
53 px = double(x - window_w / 2) / cam_zoom - cam_x;
54 py = double(y - window_h / 2) / cam_zoom - cam_y;
55}
56void PtToScreen(double px, double py, int& x, int& y) {
57 x = int(cam_zoom * (px + cam_x)) + window_w / 2;
58 y = int(cam_zoom * (py + cam_y)) + window_h / 2;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected