MCPcopy Create free account
hub / github.com/InkboxSoftware/all-screen-keyboard / createRectangle

Method createRectangle

keyboard/src/graphics.cpp:809–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807}
808
809window::rectangle window::createRectangle(int x, int y, int width, int height){
810 rectangle rect;
811 //turn coordinates and color into openGL format
812 float windowWidthHalf = (static_cast<float>(windowWidth)) / 2.0f;
813 float windowHeightHalf = (static_cast<float>(windowHeight)) / 2.0f;
814
815 rect.x = (static_cast<float>(x) - windowWidthHalf) / windowWidthHalf;
816 rect.y = -((static_cast<float>(y) - windowHeightHalf) / windowHeightHalf);
817 rect.x2 = (static_cast<float>(x + width) - windowWidthHalf) / windowWidthHalf;
818 rect.y2 = -((static_cast<float>(y + height) - windowHeightHalf) / windowHeightHalf);
819 return rect;
820}
821
822vector<GLfloat> window::generateCircleVerticies(int cx, int cy, int r, int numSegments){
823 vector<GLfloat> verticies;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected