200 Commits

Author SHA1 Message Date
Johannes Schickel
fe88375ff3 OPENGL: Support GLES2 contexts. 2016-03-16 20:29:25 +01:00
Johannes Schickel
e931018673 OPENGL: Typo. 2016-03-16 20:29:25 +01:00
Johannes Schickel
c5ce812711 OPENGL: Simplify orthogonal projection setup. 2016-03-16 20:29:25 +01:00
Johannes Schickel
af727afe0c OPENGL: Simplify context type setting. 2016-03-16 20:29:25 +01:00
Johannes Schickel
2277144623 OPENGL: Support RGB555 for OpenGL ES output.
This mode should *not* be used by any new engines/code. If someone is going
to use it and says it works with the OpenGL output, please make them wear a
red uniform and beam them onto a remote planet.
2016-03-16 20:29:25 +01:00
Johannes Schickel
d6d3e17d53 OPENGL: Allow runtime specification of OpenGL mode.
Formerly, we required that the OpenGL mode was fixed at compile time. Now we
allow the code to work with whatever it is given at runtime.

It is still possible to force a context type on compile time.
2016-03-16 20:29:25 +01:00
Johannes Schickel
9816e4f350 OPENGL: Remove support for ARGB8888.
This used to be used by Sword25. Since it is not supported by GLES and no
engine code uses it we drop support. Hopefully, this helps people to realize
they should not use that format in their engine.
2016-03-16 20:29:24 +01:00
Johannes Schickel
e11f4df111 OPENGL: Rename GLCALL to GL_CALL. 2016-03-16 20:29:24 +01:00
Johannes Schickel
4a781737c1 OPENGL: Resolve OpenGL functions on run-time.
Formerly we relied on static linkage. However, in the presense of modern
OpenGL (ES) implementations it is not easily identifable which library to link
against. For example, on Linux amd64 with nVidia drivers and SDL2 setup to
create a GLES 1.1 context one would need to link against libGL.so. However,
traditionally GLES 1.1 required to link against libGLESv1_CM.so. To prevent a
huge mess we simply resolve the OpenGL functions on run-time now and stop
linking against a static library (in most cases).

GLES support needs to be enabled manually on configure time for now.

Tizen changes have NOT been tested.
2016-03-16 20:29:24 +01:00
Johannes Schickel
b3b3d37e3b OPENGL: Define GLCALL in opengl-sys.h.
debug.h is now always included and all calls should be made through GLCALL.
2016-03-16 20:29:24 +01:00
Johannes Schickel
8f3783da09 OPENGL: Add functionality to query OpenGL functions on runtime.
This can and will be used for future extension usage support.

Tizen changes have been untested.
2016-03-16 20:29:24 +01:00
Johannes Schickel
e5e234b864 OPENGL: Refactor GL extension handling slightly. 2016-03-16 20:29:24 +01:00
Johannes Schickel
64f9c902dd OPENGL: Smooth mouse experience when black bars are visible.
This gets rid of the feeling of the mouse sticking to black borders by using
the full output resolution as area for tracking game mouse movement. The same
behavior is present in plain SDL output with SDL2.
2015-12-14 20:26:05 +01:00
Johannes Schickel
942d0fdad4 OPENGL: Limit scissor override to invisible overlay.
This fixes some corner cases which caused black bars to appear for a few screen
updates when the overlay is visible.
2015-12-13 21:30:25 +01:00
Johannes Schickel
693834e8c6 OPENGL: Implement black borders using scissor test. 2015-12-12 22:40:20 +01:00
Johannes Schickel
f65a8b2689 OPENGL: Only redraw screen when actual changes happened. 2015-12-12 22:31:35 +01:00
Johannes Schickel
fe2ee9ecf5 OPENGL: Refactor screen refresh handling.
Subclasses of OpenGLGraphicsManager are now supposed to supply a refreshScreen
function which handles actual screen updating (for example, buffer swapping).
2015-12-12 22:31:35 +01:00
Johannes Schickel
3232050dfc OPENGL: Fix include guard name. 2015-12-12 22:31:35 +01:00
Johannes Schickel
1124d1db31 OPENGL: Fix truncation issue resulting in wrong mouse coordinates. 2015-01-07 20:38:20 +01:00
Johannes Schickel
f879f8af04 OPENGL: Limit mouse cursor drawing to inside game screen when no overlay is visible. 2015-01-07 20:38:17 +01:00
Filippos Karapetis
d2c69a79fe BACKENDS: Remove trailing whitespace 2014-10-28 15:38:51 +02:00
Einar Johan Trøan Sømåen
1506f6049e BACKENDS: Fix some Doxygen comments that seem wrong. 2014-08-29 03:28:26 +02:00
Torbjörn Andersson
da57eeeeb2 OPENGL: Fix building with --disable-16bit 2014-02-25 00:09:16 +01:00
Johannes Schickel
5d78542ab8 OPENGL: Always support RGBA8888 (memory layout). 2014-02-12 18:06:29 +01:00
Johannes Schickel
2cab30ee80 OPENGL: Move RGBA8888 (logical layout) to OpenGL specific formats.
The reason here is that GL_UNSIGNED_INT_8_8_8_8 is not supported by the GLES
standard. Thus we cannot use it outside OpenGL specific code paths.
2014-02-12 18:06:29 +01:00
Johannes Schickel
ac5907a804 OPENGL: Use frac_t for cursor scaling. 2014-02-12 17:15:07 +01:00
Johannes Schickel
6576dd758b OPENGL: Simplify shake offset application. 2014-02-12 17:15:07 +01:00
Johannes Schickel
1709486859 OPENGL: Use GLfloat for draw cooridnates in Texture. 2014-02-12 17:15:07 +01:00
Johannes Schickel
49dcd36e72 OPENGL: Use signed types for mouse coordinates.
This adjusts for the fact that our event handling also uses signed coordinates.
2014-02-12 17:15:07 +01:00
Johannes Schickel
ddc70ed9ee OPENGL: Properly use signed types for cursor hotspot. 2014-02-12 17:15:07 +01:00
Johannes Schickel
abcadb5d87 OPENGL: Fix cursor regression when defaultFormat doesn't have an alpha channel. 2014-02-11 12:19:30 +01:00
Johannes Schickel
16898486fa OPENGL: Properly setup full game palette on video mode change if required. 2014-02-11 11:10:49 +01:00
Johannes Schickel
1f4638fe82 OPENGL: Refactor texture instantiation. 2014-02-11 11:10:49 +01:00
Johannes Schickel
0063568484 OPENGL: Rename notifyContextChange to notifyContextCreate. 2014-02-11 11:10:49 +01:00
Johannes Schickel
8be41e4f2c OPENGL: Add notification function about context destruction. 2014-02-11 11:10:48 +01:00
Johannes Schickel
602d3034a9 OPENGL: Release old texture name before creating a new one.
This prevents any texture name leaks (and thus memory leaks) on
recreateInternalTexture calls.
2014-02-11 11:10:48 +01:00
Johannes Schickel
2fe303ce3f Merge pull request #409 from lordhoto/rtti
Enable RTTI and clean up the code by exploiting the availability of dynamic_cast.
2014-01-23 15:23:12 -08:00
Johannes Schickel
0f36a56b81 OPENGL: Properly query for OpenGL errors.
There might be various error flags and we need to clear all of them to get
precise error results. Thus, we need to call glGetError in a loop to achieve
that.
2014-01-21 23:52:20 +01:00
Willem Jan Palenstijn
fb05395ded OPENGL: Fix texture re-allocation check
This fixes a crash when opening the menu in the SCI Laura Bow 2 intro.
2013-11-20 21:49:07 +01:00
Johannes Schickel
2094bd31ec OPENGL: Fix >1Bpp mouse cursors which do not require format conversion. 2013-11-17 20:28:16 +01:00
Johannes Schickel
281672e171 SDL: Let SdlGraphicsManager inherit from GraphicsManager. 2013-10-24 00:03:09 +02:00
Johannes Schickel
d34c9d5bcb SDL: Do not require a static graphics mode list in OpenGL and SurfaceSDL. 2013-10-23 22:59:06 +02:00
Johannes Schickel
05c347fc8a OPENGL/SDL: Add screenshot support. 2013-10-19 22:18:22 +02:00
Johannes Schickel
bb1d49ba9c OPENGL: Limit maximum Surface size to maximum texture size.
This is mostly aimed at old graphics chips. For example, wjp's old laptop
only supports 1024x1024 textures but has a 1280x800 screen. Switching to
fullscreen would create a bigger overlay than supported. Now it will get
limited to an smaller resolution and then scaled too.

Alternatively we could think of tiling surfaces into textures. But then
handling scaling would be more complicated since it might result in
artifacts on texture tile borders.
2013-10-19 22:18:15 +02:00
Johannes Schickel
20e4a7f0ce TIZEN: Adapt to new OpenGL code.
Thanks to Chris Warren-Smith for testing this a bit.
2013-10-19 22:17:42 +02:00
Johannes Schickel
decc013e53 OPENGL: Implement dirty rect handling. 2013-10-19 22:17:42 +02:00
Johannes Schickel
cc9c991d77 OPENGL: Add OSD support. 2013-10-19 22:17:39 +02:00
Johannes Schickel
5ce830b976 SDL: Add a OpenGL SDL backend and hook it into the SDL backend.
The hooking code is nearly exactly the old hooking code. Only the OpenGL SDL
creation has been adapted since it uses a different constructor now.
2013-10-19 22:14:24 +02:00
Johannes Schickel
46323074e7 OPENGL: Add new generic OpenGL (ES) backend.
This backend is based on ideas of the old OpenGL backend, of the Android GL
backend and of the iPhone GL backend.
2013-10-19 22:12:01 +02:00
Johannes Schickel
8a6e57cba1 BACKENDS: Remove OpenGL and OpenGL SDL backend.
This breaks our Tizen port.
2013-10-05 00:20:02 +02:00