313 Commits

Author SHA1 Message Date
Eugene Sandulenko
940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1978a9dea10f5b1833fcc8f58a3468e.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat
eefa72afa1 COMMON: Change way the Singleton instances are instantiated
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-07-10 21:11:20 +02:00
Colin Snover
fa0bb7dd5a BACKENDS: Compress screenshots using PNG if available
Closes gh-948.
2017-05-21 15:55:39 -05:00
Bastien Bouclet
23abcffbc5 OPENGL: Don't update the cursor's texture when the cursor is invisible
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-05-08 06:50:30 +02:00
Thierry Crozat
a9ae691513 SDL: Improve debug and warning messages when saving screenshots
In particular this adds a warning when failing to save a screenshot
in OpenGL mode (there was already one in SurfaceSDL mode).
2017-04-24 01:07:16 +01:00
Thierry Crozat
cbfa598446 OPENGL: Remove hack to avoid issues with OSD messages from other threads 2016-10-29 15:13:32 +01:00
Thierry Crozat
c6ce1c8002 OPENGL: Add support for filtering feature
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-10-13 01:45:01 +01:00
Bastien Bouclet
5e133cdd34 OPENGL: Make sure the cloud icon is cleared immediatly after it is hidden 2016-09-18 17:55:09 +02:00
Bastien Bouclet
75599a4c25 OPENGL: Remove multithread support from displayActivityIconOnOSD
It is no longer being called by another thread.
2016-09-18 17:55:09 +02:00
Thierry Crozat
2d651fd0f4 OPENGL: Fix dereferencing null pointer in OpenGLGraphicsManager
This fixes a crash when calling displayActivityIconOnOSD with a
NULL icon, which is used to remove the current activity icon.
2016-09-13 22:58:13 +01:00
Bastien Bouclet
9cbaad6140 SDL: Switch the OpenGL renderer to use small textures to draw the OSD 2016-09-13 20:41:26 +02:00
Thierry Crozat
a8cb3c8404 OPENGL: Implement getOSDFormat and copyRectToOSD 2016-09-05 21:40:45 +01:00
Thierry Crozat
65d3c15b01 OPENGL: Add missing USE_OSD defined checks around OSD code 2016-09-05 21:21:32 +01:00
Alexander Tkachev
1b9987ddc9 GUI: Add getOSDFormat() and make OSD 32 bpp 2016-08-24 16:07:55 +06:00
Alexander Tkachev
2a15b8b280 GUI: Add clearOSD() method
So one can erase everything from OSD and then blit something on it.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
7ff1f91808 GUI: Add copyRectToOSD()
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-08-24 16:07:55 +06:00
Ori Avtalion
4d120800fa ALL: Don't use 'defined' in macro definitions
This is undefined behavior and clang warns about it.
See <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147239.html>.
2016-07-23 16:18:51 +03:00
Johannes Schickel
8ff5329b49 OPENGL: Assure color attributes for shader pipeline are always set. 2016-05-03 20:43:18 +02:00
Eugene Sandulenko
050a1cd605 OPENGL: Fix potential crash 2016-05-02 15:19:07 +02:00
Johannes Schickel
8161effc68 OPENGL: Add assertions to check for valid attribute state. 2016-03-23 22:37:16 +01:00
Johannes Schickel
2ebffd2da5 OPENGL: Fix black screen for some GL implementations with shaders.
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-23 22:30:25 +01:00
Johannes Schickel
6b2424b635 OPENGL: Log extensions available on debuglevel 5+. 2016-03-16 21:03:43 +01:00
Johannes Schickel
b7a269947f OPENGL: Flag texture dirty on allocation. 2016-03-16 20:29:31 +01:00
Johannes Schickel
17b1124a5a OPENGL: Do not keep uniform state for nonexistent uniforms. 2016-03-16 20:29:31 +01:00
Johannes Schickel
1e1272a8c4 OPENGL: Store logical texture dimensions in GLTexture. 2016-03-16 20:29:31 +01:00
Johannes Schickel
2b3340474e OPENGL: Introduce convenience wrappers for get*Location in Shader. 2016-03-16 20:29:31 +01:00
Johannes Schickel
39100b6132 OPENGL: Do not hardcode any uniform/attribute handling in Shader. 2016-03-16 20:29:31 +01:00
Johannes Schickel
baca885cfc OPENGL: Let Shader store the uniform state. 2016-03-16 20:29:31 +01:00
Johannes Schickel
6dacc96d1f OPENGL: Only set projection matrix once on pipeline activation. 2016-03-16 20:29:31 +01:00
Johannes Schickel
8b80e9d36c OPENGL: Properly deactivate old pipeline. 2016-03-16 20:29:31 +01:00
Johannes Schickel
3f9852eb20 OPENGL: Make shader pipelines use fixed shaders. 2016-03-16 20:29:31 +01:00
Johannes Schickel
26f106497a OPENGL: Implement CLUT8 look up as Pipeline. 2016-03-16 20:29:30 +01:00
Johannes Schickel
8a4938f82b OPENGL: Move pipeline code to pipelines/. 2016-03-16 20:29:30 +01:00
Johannes Schickel
bec2088d6c OPENGL: Only allow Pipeline to switch active Framebuffers. 2016-03-16 20:29:30 +01:00
Johannes Schickel
ed6689d4fc OPENGL: Do not allow direct access to Context::activePipeline. 2016-03-16 20:29:27 +01:00
Johannes Schickel
b17c035642 OPENGL: Implement texture drawing in Pipeline instead of Surface. 2016-03-16 20:29:27 +01:00
Johannes Schickel
0fe580d10c OPENGL: Make shader/framebuffer part of pipeline state. 2016-03-16 20:29:27 +01:00
Johannes Schickel
0b46af2f0e OPENGL: Don't prefix maxTextureSize variable for consistency. 2016-03-16 20:29:27 +01:00
Johannes Schickel
c4e65732be OPENGL: Introduce abstraction for framebuffer.
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-16 20:29:26 +01:00
Johannes Schickel
5498982a37 OPENGL: Introduce ShaderManager to handle builtin shaders. 2016-03-16 20:29:26 +01:00
Johannes Schickel
f5f1b6eba0 OPENGL: Introduce pipeline abstraction to cleanup code. 2016-03-16 20:29:26 +01:00
Johannes Schickel
08553a09cf OPENGL: Support GLSL based CLUT8 look up for GLES2+. 2016-03-16 20:29:26 +01:00
Johannes Schickel
bf2735cd53 OPENGL: Detect NPOT support for GLES.
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.
2016-03-16 20:29:26 +01:00
Johannes Schickel
18306ee206 OPENGL: Simplify shader support checks. 2016-03-16 20:29:26 +01:00
Johannes Schickel
397ce9b947 OPENGL: Keep feature state for all contexts and log them. 2016-03-16 20:29:26 +01:00
Johannes Schickel
2319fcd228 OPENGL: Handle GLES2 and GL shaders uniformly.
GLES2 requires precision qualifiers to be set and allows use of precision
qualifiers. For GLES2 we define a default precision now. Since precision
qualifiers are not supported in the GLSL version we use for GL, we
introduce compatibility #defines.
2016-03-16 20:29:26 +01:00
Johannes Schickel
e66e9e44d3 OPENGL: Accelerate palette lookups with shaders.
This currently is limited to GL contexts.
2016-03-16 20:29:26 +01:00
Johannes Schickel
de3846923c OPENGL: Introduce simple abstraction for surfaces.
This is basically an interface extracted from Texture without any knowledge
about any actual implementation, except for copyRectToTexture, fill, and
dirty rect handling. These are convenient helpers.
2016-03-16 20:29:26 +01:00
Johannes Schickel
8b0cf0c5f7 OPENGL: Cleanup. Remove Texture::getHardwareFormat. 2016-03-16 20:29:26 +01:00
Johannes Schickel
618adec7b0 OPENGL: Move color key handling for CLUT8 to TextureCLUT8. 2016-03-16 20:29:26 +01:00