src/render


Log

Author Commit Date CI Message
Ryan C. Gordon 93ba5bd8 2014-03-20T16:23:18 Static analysis fix: uninitialized value. (A false positive: clang doesn't know SDL_SetError() always returns -1.)
Ryan C. Gordon 415675be 2014-03-20T11:14:44 Static analysis fix: division by zero.
Ryan C. Gordon b659c700 2014-03-20T10:41:47 Static analysis fix: uninitialized variables. This is actually a false-positive, in this case, since Clang doesn't know that SDL_SetError() only ever returns -1. Feature request to improve that, with explanation about these specific SDL patches, is here: http://llvm.org/bugs/show_bug.cgi?id=19208
Ryan C. Gordon e84fc5a3 2014-03-19T18:25:21 Static analysis fix: division by zero.
David Ludwig f25ee50b 2014-03-15T14:54:23 Fixed broken rotation detection routines on WinRT Rotation detection and handling should now work across all, publicly-released, WinRT-based platforms (Windows 8.0, Windows 8.1, and Windows Phone 8.0).
David Ludwig 5281f9f1 2014-03-15T13:27:18 Fixed a crash on Windows Phone 8 that occurred after rotating a device This changeset prevents IDXGISwapChain::ResizeBuffers from being invoked on Windows Phone 8, a function that isn't available on the platform (but is available on other Windows platforms). The call would fail, which ultimately led to a crash. This changeset also attempts to make sure that the D3D11 swap chain is created at the correct size, when using Windows Phone 8. Still TODO: make sure rotation-querying works across relevant Windows platforms (that support Direct3D 11.x).
Sam Lantinga f9a58968 2014-03-13T21:21:26 Added missing copyright notices
Sam Lantinga ed02f61d 2014-03-13T00:40:08 Fixed the copyright date on files contributed by David Ludwig
David Ludwig 4cd5ed7b 2014-03-12T12:12:20 Merged various WinRT build fixes
David Ludwig b68b6e23 2014-03-12T11:57:15 Fixed various build and runtime errors when using WinRT with VS2012.
Sam Lantinga 641ba099 2014-03-12T07:26:07 Fixed compiling Windows RT code on Visual Studio 2013
David Ludwig 36e7c8d9 2014-03-11T12:40:31 Fixed compiler errors in the D3D11 renderer when building for WinRT Still TODO: fix other build errors, especially linker errors, when building SDL/WinRT, then fix any runtime errors that pop up.
David Ludwig ce3c5b84 2014-03-10T22:53:03 Made VS2012 build the D3D11 renderer This change is currently limited to Win32/Windows-Desktop builds. Build fixes for WinRT + VS2012 are still pending.
Sam Lantinga 2c558ca2 2014-03-10T17:19:19 Fixed D3D9 initialization on Windows 8, which doesn't have D3DX
Sam Lantinga 9c2fb684 2014-03-10T15:00:59 Implemented fullscreen <-> windowed transition on Windows 8
Sam Lantinga 7e8b2553 2014-03-10T14:35:37 Fixed line endings
Sam Lantinga 3df586ce 2014-03-10T12:49:15 Fixed creating the rendering context on a specific device
Sam Lantinga 9aa5b1d4 2014-03-10T05:44:34 Implemented YV12 and IYUV texture support for the D3D11 renderer
Sam Lantinga 965cdf10 2014-03-10T02:13:44 Minor style tweaks
Sam Lantinga 1a35f32b 2014-03-10T01:51:03 Converted David Ludwig's D3D11 renderer to C and optimized it. The D3D11 renderer is now slightly faster than D3D9 on my Windows 8 machine (testsprite2 runs at 3400 FPS vs 3100 FPS) This will need tweaking to fix the Windows RT build.
Sam Lantinga a8f540fe 2014-03-09T22:48:38 Fixed renderer flags to include support for target textures after the renderer is created.
Sam Lantinga 1367bf87 2014-03-09T11:36:47 Integrated David Ludwig's support for Windows RT
Sam Lantinga 05c23063 2014-03-09T11:06:11 Fixed line endings on WinRT source code
Gabriel Jacobo f61602b4 2014-02-27T20:21:46 Improve window recreation logic in OpenGL* renderers
Gabriel Jacobo 4c192bc8 2014-02-25T17:42:34 Fixes #2308, recreate window if GL requirements for the renderer are not met If the window has been created with values for SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION not matching those required by the renderer, attempt to recreate the window. This is needed on platforms where both GL and GLES 1/2 surfaces are supported by the video backend, requiring that the window be recreated when switching between context types.
Sam Lantinga 8db4c5a9 2014-02-25T10:04:49 Fixed crash if the input data pitch is larger than the locked texture pitch
Gabriel Jacobo 6ee12d6c 2014-02-24T18:57:22 Fixes #2296 - SDL_GL_UnbindTexture segfaults (thanks Daniel B?nzli)
Sam Lantinga 22e3217e 2014-02-20T21:07:56 Fixed infinite recursion in D3D_Reset()
Sam Lantinga 6b33f2e8 2014-02-17T22:20:33 Fixed resetting the current render target if the D3D device is reset while using a non-default render target.
Sam Lantinga 076a14b2 2014-02-10T13:40:02 Fixed crash if render target textures are used while the device is lost
Sam Lantinga ae05f178 2014-02-10T10:02:51 Recreate render target textures when the D3D device is being reset, and notify the application using the SDL_RENDER_TARGETS_RESET event when this happens.
Sam Lantinga 3ab3ea64 2014-02-09T01:56:41 Fixed bug 2385 - error: unknown type name 'IDirect3DDevice9' Sandu Liviu Catalin I'm unable to compile the latest SDL (directly from the repository) even though I disabled every DirectX option since I don't need DirectX. I allways het these errors: D:\DevLibs\SDL\src\render\direct3d\SDL_render_d3d.c:1897:1: error: unknown type name 'IDirect3DDevice9' D:\DevLibs\SDL\src\render\direct3d\SDL_render_d3d.c:1898:25: error: unknown type name 'SDL_Renderer'
Sam Lantinga b331ada8 2014-02-09T01:49:01 Fixed bug 2354 - [ES 2.0] SDL_RenderClear clears render target with wrong color ny00 SDL_RenderClear clears a render target with the wrong color, if the opengles2 renderer driver is used and the target texture's format is SDL_PIXELFORMAT_ARGB8888. The bug is *not* reproduced if SDL_PIXELFORMAT_ABGR8888 is used as the texture format (the first from the renderer's list). It is further not reproduced using any of the following renderer drivers: opengl, opengles (apparently powered by Gallium3D), software. Finally, the correct color can be drawn using SDL_RenderFillRect (instead of SDL_RenderClear). A few details about the current setup: - OS: Ubuntu 12.04 for x86_64 - GPU: GeForce GTX 460 - GPU driver version: 331.20-0ubuntu1~xedgers~precise1 (from the xorg-edgers PPA) --- Seth Williams Sam, It appears that the clear just needs to take the render target format into consideration. Seth.
Sam Lantinga 58edac3e 2014-02-02T00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
Ryan C. Gordon aff44ccd 2014-01-27T16:13:13 Patched to compile...uh, everywhere. :)
Ryan C. Gordon 87cfee27 2014-01-27T16:10:15 Patched to compile on Windows when not supporting Direct3D.
David Ludwig 44b0e901 2013-12-30T11:59:04 WinRT: d3d11 blend mode bug fixes The destination target's alpha wasn't getting set correctly in many cases. Among other problems, this prevented some alpha-blended textures from displaying correctly in Windows Phone 8's multitasking screen. The d3d11 renderer now uses the same blending settings found in the d3d9 renderer.
David Ludwig 0562e53f 2013-12-26T11:04:35 WinRT: minor header file usage cleanup in the d3d11 renderer
David Ludwig 94233675 2013-12-26T11:03:43 WinRT: simplified the d3d11 vertex shader a bit The projection and view matrices are now computed ahead of time, as they both get computed in the same spot, and typically not often. If this does, however, become a performance problem later on, this change can always be reverted.
David Ludwig 7ef05d26 2013-12-26T10:18:33 WinRT: implemented SDL_RenderSetClipRect for the d3d11 renderer
David Ludwig 700f82de 2013-12-25T23:46:19 WinRT: corrected a minor error in an end-of-file comment
David Ludwig 8b2694f9 2013-12-25T23:45:07 WinRT: minor rotation/orientation code cleanup in the d3d11 renderer
David Ludwig b93ab1e6 2013-12-25T23:25:25 WinRT: removed a bit of dead d3d11 code
David Ludwig f0e406e9 2013-12-25T22:27:58 WinRT: d3d11 compiled-shader code cleanup I'm surprised this code even compiled, before this change. It did, but regardless, here's a cleanup.
David Ludwig 4d16628f 2013-12-25T22:05:18 WinRT: made sure d3d11 debug mode doesn't get enabled by default D3D11 debug mode got inadvertently enabled, in all cases, via changeset c0e68f3. This change reverts that.
David Ludwig ce805722 2013-12-25T21:39:48 WinRT: compiled the d3d11 renderer's shaders into SDL itself Previously, the shaders would get compiled separately, the output of which would need to be packaged into the app. This change should make SDL's dll be the only binary needed to include SDL in a WinRT app.
David Ludwig 8db33416 2013-12-25T14:20:40 WinRT: added a TODO note regarding texture-[un]locking in the d3d11 renderer
David Ludwig 187f52e8 2013-12-25T14:17:49 WinRT: renamed d3d11-internal struct, SDL_VertexShaderConstants, to just VertexShaderConstants This is primarily to keep naming consistent with other shader-bound structs.
David Ludwig 22254931 2013-12-25T13:13:15 WinRT: moved contents of the d3d11 renderer's header file into its implementation file
David Ludwig d4ae3929 2013-12-25T13:00:41 WinRT: simplified a potentially-common error message from D3D11_SetRenderTarget
David Ludwig b0df9157 2013-12-25T12:58:37 WinRT: removed an unnecessary use of std::string in the d3d11 renderer
David Ludwig 10f2de1e 2013-12-25T12:52:16 WinRT: utilized SDL_SetError's return value in the d3d11 renderer
David Ludwig 43e27aa8 2013-12-25T12:48:47 WinRT: minor d3d11 code cleanups
David Ludwig 8c8feb83 2013-12-25T12:47:39 WinRT: made d3d11-spawned error messages trickle down Some error messages had the potential to be overwritten/obscured.
David Ludwig 5fba7db2 2013-12-25T12:43:26 WinRT: made d3d11-spawned error messages include the function name of failed calls
Sam Lantinga 7fe277cd 2013-12-23T17:15:32 Fixed float to int conversion warning, which was a legitimate bug.
David Ludwig 5e6aba06 2013-12-22T21:13:35 WinRT: better rendering performance via D3D11_USAGE_DYNAMIC
CarniBlood 472068dd 2013-12-19T06:01:18 fixed gles/gles2 renderer creation fail on Android when default major/minor version doesn't match
Gabriel Jacobo ec1cb49e 2013-12-14T20:18:43 Wayland support Based on the original port to Wayland by: Joel Teichroeb, Benjamin Franzke, Scott Moreau, et al. Additional changes in this commit, done by me: * Wayland uses the common EGL framework * EGL can now create a desktop OpenGL context * testgl2 loads GL functions dynamically, no need to link to libGL anymore * Assorted fixes to the Wayland backend Tested on the Weston Compositor (v1.0.5) that ships with Ubuntu 13.10, running Weston under X. Tests ran: testrendercopyex (all backends), testgl2, testgles2,testintersections
David Ludwig 446a2704 2013-12-10T22:34:08 WinRT: fixed bug: SDL_RenderReadPixels didn't work with certain orientations of the physical display
Gabriel Jacobo f848adff 2013-11-29T10:06:08 Improve Android pause/resume behavior.
David Ludwig b6f80d85 2013-11-29T00:19:46 WinRT: enable the OpenGL ES 2 SDL_Renderer backend, if and when OpenGL ES 2 support is compiled in
David Ludwig 46740a5a 2013-11-28T22:09:21 WinRT: merged with latest SDL 2.x/HG code SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library. The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
Ryan C. Gordon 7e1289af 2013-11-24T23:56:17 Make internal SDL sources include SDL_internal.h instead of SDL_config.h The new header will include SDL_config.h, but allows for other global stuff.
Gabriel Jacobo 61959aa6 2013-11-22T13:24:53 OpenGL ES support for Windows
Sam Lantinga 8093cfd8 2013-11-15T22:07:35 Better fix for bug 2207 - SDL_RenderSetViewport behavior is different/incorrect on OpenGL renderer vs DirectX renderer At least, it works better here on my Mac. :)
Ryan C. Gordon 4f39f011 2013-11-15T23:20:50 Fix viewport being upside down in OpenGL renderer. Fixes Bugzilla #2207.
Sam Lantinga ef97aab9 2013-11-14T21:39:54 Backed out changeset 6c59f7c8ec17 - it didn't actually do anything useful
Sam Lantinga b36d98bd 2013-11-13T21:50:59 Diagonal flipping with RenderCopyEx Ivan Rubinson As it turns out, it was impossible to render a texture flipped diagonally (both vertically and horizontally) with one RenderCopyEx call. With help from #SDL @ freenode, we came up with a fix.
Sam Lantinga 1c9cc8c9 2013-11-05T21:01:25 Fixed performance regression caused by the fix for bug 2158
Philipp Wiesemann 4e270de1 2013-11-02T11:46:43 Changed function to return -1 through SDL_Error() instead of plain -1.
David Ludwig 7cc09516 2013-11-01T22:54:39 WinRT: added support for SDL_HINT_RENDER_SCALE_QUALITY
David Ludwig 69c5d21d 2013-10-27T21:26:46 WinRT: merged with SDL 2.0.1 codebase
David Ludwig 62c781ea 2013-10-25T20:31:43 WinRT: made the Direct3D 11.x 'Debug Layer' be enable-able in any app via a hint To enable the Debug Layer, set the hint, SDL_HINT_RENDER_DIRECT3D11_DEBUG to '1'. The Debug Layer will be turned off by default, both in Release and Debug builds (of SDL).
Sam Lantinga 2348e426 2013-10-21T22:08:56 Fixed whitespace
Sam Lantinga 08fa8da7 2013-10-20T21:56:15 Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings Andreas Ertelt The problem in question is caused by changeset 7771 (http://hg.libsdl.org/SDL/rev/5486e579872e / https://bugzilla.libsdl.org/show_bug.cgi?id=2121) The redefinition of __inline__ (introduced by the addition of begin_code.h:128's "|| __STRICT_ANSI__") results in mingw's gcc throwing multiple warning: always_inline function might not be inlinable [-Wattributes] as well as a whole bunch of redefinitions of mingw internals which break linking of projects including the SDL2 headers.
Sam Lantinga 4ca34ad4 2013-10-20T21:34:38 Prevent conflicts when linking both SDL2 and SDL2_gfx
Sam Lantinga 20f5167d 2013-10-20T10:35:51 Use vertex arrays for drawing points in addition to lines
Sam Lantinga 82b8e6df 2013-10-20T10:10:14 Fixed bug 2158 - Pixel missing in SDL_RenderDrawLines Sean McKean I am running Ubuntu 12.04 (GL version 1.4 Mesa 8.0.4) , and on drawing a set of lines through the renderer through SDL_RenderDrawLines() (looped or not) or SDL_RenderDrawRect() I notice a pixel missing. For RenderDrawLines() it seems to be the second point in the sequence; for RenderDrawRect() it is the lower-right. This can be fixed by specifying SDL_RenderDrawPoint(s), but wouldn't it be easier to specify each pixel in a GL_POINTS glBegin/End loop in the OpenGL code, just to make sure? I also ran the same program on Android; the rendering seemed to be correct, which uses glDrawArrays.
Sam Lantinga e343273a 2013-10-19T01:29:23 Fixed bug 2162 - SDL_RenderClear not clearing entire render target Kevin Wells Overview: SDL_RenderClear is only clearing part of a texture when it is the render target and a different size than the screen. Steps to Reproduce: 1) This only occurs with the render driver set to direct3d, so: SDL_SetHint(SDL_HINT_RENDER_DRIVER,"direct3d") Also, my window was 1280x720. 2) Create a texture for a render target with a resolution of 1024x1024: texture=SDL_CreateTexture(main_window.renderer,SDL_PIXELFORMAT_RGBA8888,SDL_TEXTUREACCESS_TARGET,1024,1024); SDL_SetTextureBlendMode(texture,SDL_BLENDMODE_BLEND); 3) Target the texture for rendering: SDL_SetRenderTarget(main_window.renderer,texture); 4) Set the draw color to whatever you want (problem occurs with both 0,0,0,0 and 0,0,0,255 among others) and then clear the render target: SDL_SetRenderDrawColor(main_window.renderer,0,0,0,0); SDL_RenderClear(main_window.renderer); Actual Results: Only about the top 3/4s of the texture gets cleared on calling SDL_RenderClear. The bottom 1/4 or so does not clear. Expected Results: Entire render target should be cleared.
Sam Lantinga 12ca3ce3 2013-10-17T23:02:29 Fixed building using MinGW Our SDL_windows.h needed to be included before anything else so UNICODE is defined.
Sam Lantinga 06cab857 2013-10-14T08:56:37 Added support for SDL_PIXELFORMAT_UYVY surfaces on Mac OS X
Sam Lantinga 36b75917 2013-10-05T12:29:05 Do a 32-bit compare on RGBA values. Thsi should be inlined in optimized builds.
Ryan C. Gordon 5607cc45 2013-10-05T00:29:57 Avoid redundant state changes in the GLES2 renderer.
Ryan C. Gordon 500e4f6f 2013-10-04T11:25:14 Removed "u_colorTable" uniform from the GLES2 renderer. It's not used anywhere.
Sam Lantinga 50989846 2013-10-03T20:48:52 Added optional error checking for OpenGL ES 2.0 in the same style as the OpenGL renderer. You can enable it like this: SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
Sam Lantinga e5ef978e 2013-10-03T20:42:43 Fixed a potential double-free bug if glGenTextures() failed.
Sam Lantinga 1f21484b 2013-10-03T03:31:05 Fixed const/non-const warning
Ryan C. Gordon 958640e5 2013-10-02T22:16:11 Get rid of glGetError() calls in GLES2 renderer. It's not usually useful, and it causes pipeline stalls.
Sam Lantinga 22a972a4 2013-09-30T22:16:14 Fixed bug 2122 - SDL_CreateTexture allows illegal texture sizes Lloyd Bryant SDL_CreateTexture() is succeeding (i.e. returning a valid pointer) when the requested horizontal or vertical size of the texture exceeds the maximum allowed by the render. This results in hard-to-understand errors showing up when later attempting to use that texture (such as with SDL_SetRenderTarget()).
Sam Lantinga 202528a4 2013-09-28T14:07:17 Call AddRef() on the device so it doesn't accidentally get released from underneath the caller.
Sam Lantinga 25f607a3 2013-09-28T14:07:14 Make it clear we're just returning a D3D9 device, allowing for new functions to get other D3D versions
Sam Lantinga cf5e5a83 2013-09-28T14:07:08 Added a hint to create the D3D device in thread-safe mode: SDL_HINT_RENDER_DIRECT3D_THREADSAFE
Sam Lantinga 803965bc 2013-09-28T14:07:05 Added platform specific call: SDL_RenderGetD3DDevice()
Sam Lantinga 9f390e79 2013-09-28T14:06:59 Moved SDL_Direct3D9GetAdapterIndex() to SDL_windowsvideo.c since it doesn't belong in the window code.
Sam Lantinga 89c31bb4 2013-09-28T14:06:55 Implemented SDL_UpdateYUVTexture() for Direct3D
Sam Lantinga 17c9ff85 2013-09-28T14:06:51 Added missing SDL_assert.h
Sam Lantinga 57bd5147 2013-09-28T14:06:47 Added optimized YUV texture upload path with SDL_UpdateYUVTexture()
Sam Lantinga b6be1435 2013-09-28T14:06:20 Moved D3D_LoadDLL and SDL_Direct3D9GetAdapterIndex to SDL_windowswindow.c at Jorgen's insistence. That file is wrapped in a more appropriate define check so it will work if somebody builds a binary without D3D support. Added a reference to SDL_Direct3D9GetAdapterIndex to SDL_test_common.c so SDL will fail to compile if the new symbol isn't included properly. CR: Jorgen
Edward Rudd 869a7076 2013-09-20T13:43:00 add in High DPI support (aka Retina) - based on J?rgen's patch with a few bug fixes