aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2019-04-25 11:02:13 +0200
committerRay <raysan5@gmail.com>2019-04-25 11:02:13 +0200
commit04ed4dd40cd287435a466b73ec52a73f1321bce1 (patch)
treef17d43b6c7f5d2cfb549b12d91fe65aa7152cc0e /src
parente1cd4674e76f2784948c14e2ed49a50e4bd1d71e (diff)
downloadraylib-04ed4dd40cd287435a466b73ec52a73f1321bce1.tar.gz
raylib-04ed4dd40cd287435a466b73ec52a73f1321bce1.zip
Renamed internal variable
Probably required for HiDPI support
Diffstat (limited to 'src')
-rw-r--r--src/core.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core.c b/src/core.c
index 5ec3b76a..4069f782 100644
--- a/src/core.c
+++ b/src/core.c
@@ -284,7 +284,7 @@ static int currentWidth, currentHeight; // Current render width and heig
static int renderOffsetX = 0; // Offset X from render area (must be divided by 2)
static int renderOffsetY = 0; // Offset Y from render area (must be divided by 2)
static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP)
-static Matrix downscaleView; // Matrix to downscale view (in case screen size bigger than display size)
+static Matrix screenScaling; // Matrix to scale screen
#if defined(PLATFORM_RPI)
static EGL_DISPMANX_WINDOW_T nativeWindow; // Native window (graphic device)
@@ -1086,7 +1086,7 @@ void BeginDrawing(void)
previousTime = currentTime;
rlLoadIdentity(); // Reset current matrix (MODELVIEW)
- rlMultMatrixf(MatrixToFloat(downscaleView)); // If downscale required, apply it here
+ rlMultMatrixf(MatrixToFloat(screenScaling)); // If downscale required, apply it here
//rlTranslatef(0.375, 0.375, 0); // HACK to have 2D pixel-perfect drawing on OpenGL 1.1
// NOTE: Not required with OpenGL 3.3+
@@ -2307,8 +2307,8 @@ static bool InitGraphicsDevice(int width, int height)
// NOTE: Framebuffer (render area - renderWidth, renderHeight) could include black bars...
// ...in top-down or left-right to match display aspect ratio (no weird scalings)
- // Downscale matrix is required in case desired screen area is bigger than display area
- downscaleView = MatrixIdentity();
+ // Screen scaling matrix is required in case desired screen area is different than display area
+ screenScaling = MatrixIdentity();
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
glfwSetErrorCallback(ErrorCallback);
@@ -2438,7 +2438,7 @@ static bool InitGraphicsDevice(int width, int height)
// At this point we need to manage render size vs screen size
// NOTE: This function uses and modifies global module variables:
- // screenWidth/screenHeight - renderWidth/renderHeight - downscaleView
+ // screenWidth/screenHeight - renderWidth/renderHeight - screenScaling
SetupFramebuffer(displayWidth, displayHeight);
window = glfwCreateWindow(displayWidth, displayHeight, windowTitle, glfwGetPrimaryMonitor(), NULL);
@@ -2779,7 +2779,7 @@ static bool InitGraphicsDevice(int width, int height)
eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &displayFormat);
// At this point we need to manage render size vs screen size
- // NOTE: This function use and modify global module variables: screenWidth/screenHeight and renderWidth/renderHeight and downscaleView
+ // NOTE: This function use and modify global module variables: screenWidth/screenHeight and renderWidth/renderHeight and screenScaling
SetupFramebuffer(displayWidth, displayHeight);
ANativeWindow_setBuffersGeometry(androidApp->window, renderWidth, renderHeight, displayFormat);
@@ -2792,7 +2792,7 @@ static bool InitGraphicsDevice(int width, int height)
graphics_get_display_size(0, &displayWidth, &displayHeight);
// At this point we need to manage render size vs screen size
- // NOTE: This function use and modify global module variables: screenWidth/screenHeight and renderWidth/renderHeight and downscaleView
+ // NOTE: This function use and modify global module variables: screenWidth/screenHeight and renderWidth/renderHeight and screenScaling
SetupFramebuffer(displayWidth, displayHeight);
dstRect.x = 0;
@@ -2921,10 +2921,9 @@ static void SetupFramebuffer(int width, int height)
renderOffsetY = 0;
}
- // NOTE: downscale matrix required!
+ // Screen scaling required
float scaleRatio = (float)renderWidth/(float)screenWidth;
-
- downscaleView = MatrixScale(scaleRatio, scaleRatio, scaleRatio);
+ screenScaling = MatrixScale(scaleRatio, scaleRatio, scaleRatio);
// NOTE: We render to full display resolution!
// We just need to calculate above parameters for downscale matrix and offsets