87 Commits

Author SHA1 Message Date
Johannes Schickel
fe88375ff3 OPENGL: Support GLES2 contexts. 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
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
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
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
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
f879f8af04 OPENGL: Limit mouse cursor drawing to inside game screen when no overlay is visible. 2015-01-07 20:38:17 +01: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
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
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
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
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
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
Johannes Schickel
aec9b9e22a ALL: Let overlay related methods in OSystem take a void * and use a proper pitch values.
This is a first step to get rid of OverlayColor, which is a requirement for
proper 4Bpp overlay support.
2012-06-16 04:17:14 +02:00
Johannes Schickel
d27d951d0b BACKENDS: Make OSystem::setMouseCursor take a "const void *" buffer.
This is mainly for consistency with OSystem::copyRectToScreen.
2012-06-16 03:28:42 +02:00
Johannes Schickel
31880186e1 BACKENDS: Let copyRectToScreen take a "const void *" instead of "const byte *" as buffer.
This removes the need to convert the parameter to copyRectToScreen to
"const byte *", which is commonly used in games, which use Graphics::Surface
to store their graphics data.
2012-06-16 02:18:01 +02:00
Johannes Schickel
a401f0a19e ALL: Replace cursorTargetScale in OSystem API with a simple "do not scale" logic.
All uses of the old target scale API actually wanted to disallow scaling of
the mouse cursor. This commit adapts our API to this and thus simplifies
backend implementations.

Some backends, most notable the Wii and Android, did some implementation of
the cursor target scale, which I didn't adapt yet. I added a TODO for the
porters there.
2012-06-03 02:02:57 +02:00
Johannes Schickel
5b3ebdf43d OPENGL: Prevent access to a few more members in the SDL OpenGL code. 2012-02-15 02:23:37 +01:00
Johannes Schickel
05af37c08e OPENGL: Use tabs instead of spaces for indentation. 2012-02-15 02:23:22 +01:00
Chris Warren-Smith
812e4498ec BADA: Fix formatting and non bada host compile error 2011-08-21 16:38:53 +10:00
Chris Warren-Smith
59739a7a0e BADA: Initial BADA port implementation 2011-08-21 16:37:06 +10:00
Johannes Schickel
b8dcd9a25e OPENGL: Fix aspect ratio correction behavior.
Now only 320x200 and 640x400 will result in aspect ratio correction to be used
if the user requested it. This should fix some strechting in Myst/Riven.
2011-08-12 04:06:54 +02:00
Johannes Schickel
04ab0e58b4 SDL: Take advantage of SdlGraphicsManager.
This gets rid of the hacks, where SdlEventSource added events with custom type
numbers to pass SDL_VIDEOEXPOSE and SDL_VIDEORESIZE to the graphics manager.

Furthermore it get rids of the uninituitive and hard to trace way of assigning
the proper mouse coordinates to mouse related events. Formerly it passed the
real screen coordinates through the even dispatching api to the graphics
manager (at least hopefully ;-) and let that handle creating a new event with
the proper coordinates. Now instead SdlEventSource handles the proper
coordinate setup itself.

Since this is a behavior change and I can not test all the SDL based small
devices ports this commit might break compilation for them and more serve it
might also break mouse position behavior. If any of that occurs I am sorry
about it.
2011-08-09 00:03:11 +02:00
Max Horn
88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
Max Horn
ce32745d9c BACKENDS: Replace OSystem::disableCursorPalette by setFeatureState calls 2011-06-04 11:55:56 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Johannes Schickel
33cf1f8f59 OPENGL: Get rid of unused switchDisplayMode. 2011-03-20 17:30:23 +01:00
Johannes Schickel
6502e191b9 OPENGL: Handle aspect ratio correction as flag instead of having a special mode for it.
This partly fixes the OpenGL mode mess, but now OpenGL Normal and OpenGL
Conserve will feature the same semantics when aspect ratio correction is
enabled... That is still something to solve.
2011-03-20 17:29:08 +01:00
Johannes Schickel
8d35d91bdf OPENGL: Cleanup switchDisplayMode. 2011-03-17 21:20:20 +01:00
Johannes Schickel
f490e6f361 OPENGLSDL: More refactoring to avoid direct access of OpenGlGraphicsManager's members. 2011-03-17 21:20:20 +01:00
Johannes Schickel
83b199e921 OPENGL: Move setFullscreenMode to OpenGLGraphicsManager. 2011-03-17 21:20:20 +01:00
Johannes Schickel
8d87a460b0 OPENGLSDL: Handle active fullscreen mode OPENGLSDL internal. 2011-03-17 21:20:20 +01:00
Johannes Schickel
daf6050d7c OPENGL: Make setScale non-virtual. 2011-03-17 21:20:20 +01:00
Johannes Schickel
758aa78acc OPENGL: Get rid of _aspectRatioCorrection. 2011-03-17 19:55:06 +01:00
Johannes Schickel
96979f73fc OPENGL: Slight refactoring.
First step into making all state variables of the OpenGL backend private, to
help making the backend more maintainable, by disallowing subclasses to just
mess with everything...
2011-03-17 19:55:06 +01:00
Johannes Schickel
372af10a7b OPENGL: Update the OSD texture when visible while the output mode changes.
This fixes annoying graphics glitches, which occured sometimes when resizing
the Window.
2011-03-17 18:35:32 +01:00
Johannes Schickel
e08683d939 OPENGL: Refactor warpMouse.
Now subclasses will not need to worry about the scaling logic themselves, but
just need to implement setInternalMousePosition, which should handles setting
the system's mouse coordinates.
2011-03-17 17:37:42 +01:00