- float x = 0.0f, y = 0.0f;
-
- if (direction == HORIZONTAL) {
- x = (base_pos + offset) / (float)width;
- } else if (direction == VERTICAL) {
- y = (base_pos + offset) / (float)height;
- } else {
- assert(false);
- }
-
- samples[4 * i + 0] = x;
- samples[4 * i + 1] = y;
- samples[4 * i + 2] = total_weight;
- samples[4 * i + 3] = 0.0f;