[Scummvm-git-logs] scummvm master -> 67726a7e6d9cda515a1af2a5592b05412a6633ac

grisenti noreply at scummvm.org
Sat Nov 25 13:57:46 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
67726a7e6d HPL1: Initialize glViewport with screen size


Commit: 67726a7e6d9cda515a1af2a5592b05412a6633ac
    https://github.com/scummvm/scummvm/commit/67726a7e6d9cda515a1af2a5592b05412a6633ac
Author: grisenti (emanuele at grisenti.net)
Date: 2023-11-25T14:57:32+01:00

Commit Message:
HPL1: Initialize glViewport with screen size

Changed paths:
    engines/hpl1/engine/impl/LowLevelGraphicsSDL.cpp


diff --git a/engines/hpl1/engine/impl/LowLevelGraphicsSDL.cpp b/engines/hpl1/engine/impl/LowLevelGraphicsSDL.cpp
index 0ce048733b1..11e5cb0605b 100644
--- a/engines/hpl1/engine/impl/LowLevelGraphicsSDL.cpp
+++ b/engines/hpl1/engine/impl/LowLevelGraphicsSDL.cpp
@@ -133,11 +133,18 @@ cLowLevelGraphicsSDL::~cLowLevelGraphicsSDL() {
 
 bool cLowLevelGraphicsSDL::Init(int alWidth, int alHeight, int alBpp, int abFullscreen,
 								int alMultisampling, const tString &asWindowCaption) {
-	mvScreenSize.x = alWidth;
-	mvScreenSize.y = alHeight;
+	if (abFullscreen) {
+		int viewportSize[4];
+		GL_CHECK(glGetIntegerv(GL_VIEWPORT, viewportSize));
+		mvScreenSize.x = viewportSize[2];
+		mvScreenSize.y = viewportSize[3];
+	} else {
+		mvScreenSize.x = alWidth;
+		mvScreenSize.y = alHeight;
+	}
 	mlBpp = alBpp;
 	mlMultisampling = alMultisampling;
-	initGraphics3d(alWidth, alHeight);
+	initGraphics3d(mvScreenSize.x, mvScreenSize.y);
 	SetupGL();
 	ShowCursor(false);
 	// CheckMultisampleCaps();
@@ -177,6 +184,7 @@ static void logOGLInfo(const cLowLevelGraphicsSDL &graphics) {
 }
 
 void cLowLevelGraphicsSDL::SetupGL() {
+	GL_CHECK(glViewport(0, 0, mvScreenSize.x, mvScreenSize.y));
 	// Inits GL stuff
 	// Set Shade model and clear color.
 	GL_CHECK(glShadeModel(GL_SMOOTH));




More information about the Scummvm-git-logs mailing list