aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl
AgeCommit message (Collapse)Author
2018-08-26OPENGL: Use premultiplied alpha for color-keyed cursorsBastien Bouclet
This fixes colour fringing on keyed cursors when using filtering. Fixes Trac#10594.
2017-12-01BACKENDS: Fix shake position getting stuckColin Snover
If a game is doing a screen shake (for example, DOTT when the stereo is on), and the user does an RTL, the screen shake offset may get stuck if the engine does not reset it on shutdown. To avoid this in all cases, just always reset the screen shake whenever the graphics manager is told to switch to a new graphics mode.
2017-10-15BACKENDS: Fix GraphicsManager handling of empty cursorsColin Snover
The SDL graphics manager was just ignoring calls from CursorMan to set the cursor to a blank cursor, which meant engines that did not immediately send a cursor to CursorMan at startup would still show the launcher's cursor (usually with a broken palette). The OpenGL graphics manager would try to generate and draw an invalid cursor surface when receiving an empty cursor.
2017-10-15BACKENDS: Also hide mouse cursor outside game area when an engine has hidden ↵Colin Snover
the cursor The only reason we show the system cursor outside the game area is to show users where their mouse is when the window is resized and the mouse is outside the game area. If the game cannot be interacted with, then the mouse also does not need to be shown in the black areas.
2017-10-15BACKENDS: Refactor OpenGL & SDL graphics backendsColin Snover
This patch refactors the OpenGL and SDL graphics backends, primarily to unify window scaling and mouse handling, and to fix coordinate mapping between the ScummVM window and the virtual game screen when they have different aspect ratios. Unified code for these two backends has been moved to a new header-only WindowedGraphicsManager class, so named because it contains code for managing graphics managers that interact with a windowing system and render virtual screens within a larger physical content window. The biggest behavioral change here is with the coordinate system mapping: Previously, mouse offsets were converted by mapping the whole space within the window as input to the virtual game screen without maintaining aspect ratio. This was done to prevent 'stickiness' when the mouse cursor was within the window but outside of the virtual game screen, but it caused noticeable distortion of mouse movement speed on the axis with blank space. Instead of introducing mouse speed distortion to prevent stickiness, this patch changes coordinate transformation to show the system cursor when the mouse moves outside of the virtual game screen when mouse grab is off, or by holding the mouse inside the virtual game screen (instead of the entire window) when mouse grab is on. This patch also improves some other properties of the GraphicsManager/PaletteManager interfaces: * Nullipotent operations (getWidth, getHeight, etc.) of the PaletteManager/GraphicsManager interfaces are now const * Methods marked `virtual` but not inherited by any subclass have been de-virtualized * Extra unnecessary calculations of hardware height in SurfaceSdlGraphicsManager have been removed * Methods have been renamed where appropriate for clarity (setWindowSize -> handleResize, etc.) * C++11 support improved with `override` specifier added on overridden virtual methods in subclasses (primarily to avoid myself accidentally creating new methods in the subclasses by changing types/names during refactoring) Additional refactoring can and should be done at some point to continue to deduplicate code between the OpenGL and SDL backends. Since the primary goal here was to improve the coordinate mapping, full refactoring of these backends was not completed here.
2017-10-15BACKENDS: Fix some comment typosColin Snover
2017-08-05OPENGL: Always clear the whole backbufferBastien Bouclet
Previously we were clearing the whole backbuffer for 3 frames after a window size change, and then only clearing the game area. This assumes the OpenGL driver uses at most 3 render buffer and uses them in sequential order. This does not seem to be the case on Linux when using an Intel integrated GPU. Instead we now clear the whole backbuffer on each frame to make sure there are no leftovers remaining on the screen. All semi-recent GPUs should have hardware clear anyway so this should not impact negatively performance. Possibly fixes #10025.
2017-07-10Revert "COMMON: Change way the Singleton instances are instantiated"Eugene Sandulenko
This reverts commit eefa72afa1978a9dea10f5b1833fcc8f58a3468e. With this patch ConfigManager is broken.
2017-07-10COMMON: Change way the Singleton instances are instantiatedThierry Crozat
This fixes tons of warnings with clang from a recent xcode version on macOS (and possibly other systems) complaining that an instantiation of _singleton is required but no definition is available.
2017-05-21BACKENDS: Compress screenshots using PNG if availableColin Snover
Closes gh-948.
2017-05-08OPENGL: Don't update the cursor's texture when the cursor is invisibleBastien Bouclet
Updating the cursor's texture is not necessary if it is not going to be drawn. Fixes glDrawArrays sometimes failing due to using a framebuffer with an incomplete color attachment. In SCI32 games, the framebuffer is incomplete because the engine does not define pixel data for the cursor.
2017-04-24SDL: Improve debug and warning messages when saving screenshotsThierry Crozat
In particular this adds a warning when failing to save a screenshot in OpenGL mode (there was already one in SurfaceSDL mode).
2016-10-29OPENGL: Remove hack to avoid issues with OSD messages from other threadsThierry Crozat
2016-10-13OPENGL: Add support for filtering featureThierry Crozat
This replaces the two graphics modes "OpenGL (No filtering)" and "OpenGL". Now there is a single "OpenGL" mode and filtering is controlled by the kFeatureFilteringMode.
2016-09-18OPENGL: Make sure the cloud icon is cleared immediatly after it is hiddenBastien Bouclet
2016-09-18OPENGL: Remove multithread support from displayActivityIconOnOSDBastien Bouclet
It is no longer being called by another thread.
2016-09-13OPENGL: Fix dereferencing null pointer in OpenGLGraphicsManagerThierry Crozat
This fixes a crash when calling displayActivityIconOnOSD with a NULL icon, which is used to remove the current activity icon.
2016-09-13SDL: Switch the OpenGL renderer to use small textures to draw the OSDBastien Bouclet
2016-09-05OPENGL: Implement getOSDFormat and copyRectToOSDThierry Crozat
2016-09-05OPENGL: Add missing USE_OSD defined checks around OSD codeThierry Crozat
2016-08-24GUI: Add getOSDFormat() and make OSD 32 bppAlexander Tkachev
2016-08-24GUI: Add clearOSD() methodAlexander Tkachev
So one can erase everything from OSD and then blit something on it.
2016-08-24GUI: Add copyRectToOSD()Alexander Tkachev
I was lazy to implement that in OpenGLGraphicsManager and I'm not sure it's implemented correctly in SurfaceSdlGraphicsManager, but it works for me.
2016-07-23ALL: Don't use 'defined' in macro definitionsOri Avtalion
This is undefined behavior and clang warns about it. See <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147239.html>.
2016-05-03OPENGL: Assure color attributes for shader pipeline are always set.Johannes Schickel
2016-05-02OPENGL: Fix potential crashEugene Sandulenko
2016-03-23OPENGL: Add assertions to check for valid attribute state.Johannes Schickel
2016-03-23OPENGL: Fix black screen for some GL implementations with shaders.Johannes Schickel
For compatibility location 0 is used to decide whether fixed function style vertex information is used in old GL contexts. In some cases drivers might assign the color information to be passed through attribute 0. This caused the array attribute status for location 0 to be disabled and resulted in wrong vertex data to be used.
2016-03-16OPENGL: Log extensions available on debuglevel 5+.Johannes Schickel
2016-03-16OPENGL: Flag texture dirty on allocation.Johannes Schickel
2016-03-16OPENGL: Do not keep uniform state for nonexistent uniforms.Johannes Schickel
2016-03-16OPENGL: Store logical texture dimensions in GLTexture.Johannes Schickel
2016-03-16OPENGL: Introduce convenience wrappers for get*Location in Shader.Johannes Schickel
2016-03-16OPENGL: Do not hardcode any uniform/attribute handling in Shader.Johannes Schickel
2016-03-16OPENGL: Let Shader store the uniform state.Johannes Schickel
2016-03-16OPENGL: Only set projection matrix once on pipeline activation.Johannes Schickel
2016-03-16OPENGL: Properly deactivate old pipeline.Johannes Schickel
2016-03-16OPENGL: Make shader pipelines use fixed shaders.Johannes Schickel
2016-03-16OPENGL: Implement CLUT8 look up as Pipeline.Johannes Schickel
2016-03-16OPENGL: Move pipeline code to pipelines/.Johannes Schickel
2016-03-16OPENGL: Only allow Pipeline to switch active Framebuffers.Johannes Schickel
2016-03-16OPENGL: Do not allow direct access to Context::activePipeline.Johannes Schickel
2016-03-16OPENGL: Implement texture drawing in Pipeline instead of Surface.Johannes Schickel
2016-03-16OPENGL: Make shader/framebuffer part of pipeline state.Johannes Schickel
2016-03-16OPENGL: Don't prefix maxTextureSize variable for consistency.Johannes Schickel
2016-03-16OPENGL: Introduce abstraction for framebuffer.Johannes Schickel
This allows us to use various framebuffer settings easily. Now the GPU accelerated CLUT8 surface implementation does not need to query former framebuffer state anymore.
2016-03-16OPENGL: Introduce ShaderManager to handle builtin shaders.Johannes Schickel
2016-03-16OPENGL: Introduce pipeline abstraction to cleanup code.Johannes Schickel
2016-03-16OPENGL: Support GLSL based CLUT8 look up for GLES2+.Johannes Schickel
2016-03-16OPENGL: Detect NPOT support for GLES.Johannes Schickel
For GLES1+ there exists GL_OES_texture_npot, which indicates that there is NPOT support. GLES2 always had (limited) NPOT support, which is all we require, thus we always enable it.