mirror of https://github.com/bjornbytes/lovr.git
Merge pull request #281 from alloverse/fix-pixeldensity
fix crash in lovrGraphicsGetPixelDensity
This commit is contained in:
commit
eb97230c0d
|
@ -279,9 +279,9 @@ int lovrGraphicsGetHeight() {
|
||||||
}
|
}
|
||||||
|
|
||||||
float lovrGraphicsGetPixelDensity() {
|
float lovrGraphicsGetPixelDensity() {
|
||||||
int width, framebufferWidth;
|
int width, height, framebufferWidth, framebufferHeight;
|
||||||
lovrPlatformGetWindowSize(&width, NULL);
|
lovrPlatformGetWindowSize(&width, &height);
|
||||||
lovrPlatformGetFramebufferSize(&framebufferWidth, NULL);
|
lovrPlatformGetFramebufferSize(&framebufferWidth, &framebufferHeight);
|
||||||
if (width == 0 || framebufferWidth == 0) {
|
if (width == 0 || framebufferWidth == 0) {
|
||||||
return 0.f;
|
return 0.f;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue