Commit Graph

21 Commits (53e22e4be8c462f15f31c9c906a412fcefd731cf)

Author SHA1 Message Date
Sam Lantinga a42c396a57 Fixed bug 3361 - Texture color modulation doesn't work with active NONE blend mode (opengl and opengles)
Simon Hug

The GL_SetBlendMode and GLES_SetBlendMode functions of the opengl and opengles renderers call the glTexEnvf to set the texture env mode to either GL_MODULATE (the default) or GL_REPLACE for the NONE blend mode. Using GL_REPLACE disables color and alpha modulation for textures.

These glTexEnv calls were put in the SetBlendMode function back in 2006 [1], but there the NONE code still used the GL_DECAL mode. The GL_REPLACE mode came in 2008 [2]. I'm a bit confused why that wasn't always GL_MODULATE and a bit surprised nobody reported that yet (unless I missed it). I guess only a few use the gles renderer and the newish shaders mask the issue.
2016-10-01 11:04:45 -07:00
Sam Lantinga 3f1b1629c4 Fixed bug 3362 - OpenGL renderer doesn't check if framebuffers are supported when creating target textures
Simon Hug

The GL_CreateTexture function doesn't have any checks for the case where the driver doesn't support the framebuffer object extension. It will call into GL_GetFBO which will call the non-existent glGenFramebuffersEXT.

Also, for some reason GL_CreateContext always sets the SDL_RENDERER_TARGETTEXTURE info flag, even if it is not supported. Changeset cc226dce7536 [1] makes this change, but doesn't explain why. It seems to me like the code would already have taken care of this [2].

The attached patch adds some checks and stops SDL from reporting render target support if there is none. The application can then properly inform the user instead of just crashing.
2016-10-01 10:52:24 -07:00
Sam Lantinga 2ccb46cebc Fixed bug 3373 - OpenGL implementation differences of glDrawTexfOES
Simon Hug

It seems not everyone implemented glDrawTexfOES the same. Intel and Mesa ignore the viewport entirely, whereas the Raspberry Pi implementation offsets the coordinates and does viewport clipping.

The glDrawTexfOES extension text [1] for the function says "Xs and Ys are given directly in window (viewport) coordinates." I guess this wasn't clear enough.

Alex Szpakowski

Honestly I'd probably remove that codepath from SDL_Render entirely. It's an OpenGL ES 1-specific extension that isn't likely to give huge performance gains and adds additional maintenance overhead to SDL_Render while also having bugs in some drivers (as seen here).
2016-10-01 10:43:01 -07:00
Sam Lantinga b7e45f8a1a Fixed bug 3336 - Failure to build with MinGW-w64
Kai Sterker
There are already patches available from mingw64 that fix the issue

https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-SDL2

With those applied, I could compile SDL2 without problems. But of course, it would be preferable if SDL built cleanly from source.
2016-10-01 10:28:00 -07:00
Sam Lantinga 86d4b09914 Fixed spacing 2016-09-13 18:44:28 -07:00
Alex Szpakowski f050576665 Initial Apple TV / tvOS support.
The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used.

A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
2016-09-13 22:18:06 -03:00
David Ludwig 23af328bb0 Fixed Bug 3147 - Windows: Crash when resizing Window since hg 1f9d57965528
Thanks for the fix, Gab!
2016-06-24 22:17:56 -04:00
Philipp Wiesemann 831597f714 PSP: Fixed returning success from unsupported SDL_RenderReadPixels().
This also fixed the missing error message.
2016-04-01 21:13:58 +02:00
Philipp Wiesemann d1e4814120 PSP: Fixed returning success for unsupported SDL_SetTextureColorMod().
Partially fixes Bugzilla #3298.
2016-04-01 21:12:37 +02:00
Philipp Wiesemann 0a1999dfd2 Fixed compile warnings about type conversion.
Found by buildbot.
2016-01-16 21:25:10 +01:00
Ethan Lee 167cf14c1f SDL_RenderSetIntegerScale 2016-01-05 16:39:18 -05:00
Sam Lantinga 42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Ryan C. Gordon f893ce3d3e OpenGL+GLES renderers: Fixed incorrect clip rectangle coords (thanks, Marcel!).
Fixes Bugzilla #2700.
2015-12-28 15:15:58 -05:00
David Ludwig 9e9ef5ad31 Fixed bug 3202 - Fix renderer visibility on a window maximized directly from the minimized state
Many thanks to id.zeta for details on the bug, and for the fix!
2015-12-27 17:55:45 -05:00
Alex Szpakowski 0c463d770b SDL_GL_GetAttribute: If a GL context isn't active, only return failure when the specified attribute needs an active GL context to be queried. 2015-12-10 20:25:34 -04:00
David Ludwig 25abce513d WinRT: added Win10/UWP (Universal Windows Platform) support
"UWP" appears to be Microsoft's new name for WinRT/Windows-Store APIs.

This set of changes updates SDL's WinRT backends to support the Win10 flavor
of WinRT.  It has been tested on Win10 on a desktop.  In theory, it should
also support Win10 on other devices (phone, Xbox One, etc.), however further
patches may be necessary.

This adds:
- a set of MSVC 2015 project files, for use in creating UWP apps
- modifications to various pieces of SDL, in order to compile via MSVC 2015 +
  the Win10 API set
- enables SDL_Window resizing and programmatic-fullscreen toggling, when using
  the WinRT backend
- WinRT README updates
2015-11-29 19:33:11 -05:00
David Ludwig 623898f70b WinRT: lots of display and windowing related fixes
This change-set fixes a lot of windowing related bugs, especially with
regards to Windows 8.x apps running on Windows 10 (which was the driver for
this work).  The primary fixes include:
* listed display modes were wrong, especially when launching apps into a
  non-fullscreen space
* reported window flags were often wrong, especially on Windows 10
* fullscreen/windowed mode switches weren't failing (they are not
  programmatically possible in Win 8.x apps).
2015-11-26 00:41:39 -05:00
Philipp Wiesemann 4c72d39ce7 D3D11: Fixed SDL_RenderDrawPoints() ignoring input after the first 128 points.
If a limit would be needed then count should be adapted before stack allocation.
2015-10-15 22:26:21 +02:00
Philipp Wiesemann 0856a7ef34 Changed an error return value from 0 to NULL for consistency. 2015-08-21 23:50:37 +02:00
Ryan C. Gordon ded3a16e72 Fixed compiler warning about shadowed local variables. 2015-06-23 01:44:44 -04:00
Philipp Wiesemann 0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00