Preserve 16:9 tile aspect on resize
This commit is contained in:
+24
-4
@@ -9,18 +9,38 @@ struct Vertex
|
||||
float uv[2];
|
||||
};
|
||||
|
||||
struct TileRect
|
||||
{
|
||||
float x0;
|
||||
float y0;
|
||||
float x1;
|
||||
float y1;
|
||||
};
|
||||
|
||||
std::vector<TileRect> makeGridTileRects(
|
||||
uint32_t cols,
|
||||
uint32_t rows,
|
||||
float viewportWidth,
|
||||
float viewportHeight,
|
||||
float gapPixels,
|
||||
float targetAspect);
|
||||
|
||||
std::vector<Vertex> makeGridLayout(
|
||||
uint32_t cols,
|
||||
uint32_t rows,
|
||||
float gapX,
|
||||
float gapY);
|
||||
float viewportWidth,
|
||||
float viewportHeight,
|
||||
float gapPixels,
|
||||
float targetAspect);
|
||||
|
||||
void updateGridLayout(
|
||||
Vertex* vertices,
|
||||
uint32_t cols,
|
||||
uint32_t rows,
|
||||
float gapX,
|
||||
float gapY);
|
||||
float viewportWidth,
|
||||
float viewportHeight,
|
||||
float gapPixels,
|
||||
float targetAspect);
|
||||
|
||||
void updateUvForAspectRatio(
|
||||
Vertex* vertices,
|
||||
|
||||
Reference in New Issue
Block a user