Commit Graph

791 Commits

Author SHA1 Message Date
Sam Lantinga
dd72f3f03d Added comment for #endif 2022-10-24 10:37:43 -07:00
Steven Noonan
3d35c08585 fix a few 'unused but set variable' and 'unused function' warnings 2022-10-24 10:36:56 -07:00
Sam Lantinga
aefc6b5bb5 Renamed variables, index is the singular of indices 2022-10-18 08:40:03 -07:00
Sylvain
dfbb93dd0c
SDL_Renderer / GLES2: add specific list of indice to render rect (see #6401) 2022-10-18 11:31:30 +02:00
Sylvain
e8a4c23ce5
Revert commit 790fa3156c.
SDL_BLENDMODE_INVALID case is probably used for custom blendmode
2022-10-18 10:45:01 +02:00
Sylvain
790fa3156c
Fix warning: enumeration value 'SDL_BLENDMODE_INVALID' not explicitly handled in switch 2022-10-18 10:41:10 +02:00
Sylvain
3d99d31026
Fixed bug #6401 - back-end can choose the order the triangles when rendering rects, attempt to fix small glitch rendering. 2022-10-18 10:34:56 +02:00
Sylvain
285cbf6fdd
Revert commit 485bb3565b.
"Fixed bug #6401 - change the order of triangles when using RenderCopy, RenderCopyEx and RenderFillRect"
because the glitch reappears on other backend
2022-10-18 10:04:06 +02:00
Wouter Wijsman
3903f4c88a PSP: Use vramalloc instead of conflicting valloc function
The libpspvram library was offering a function with conflicted with valloc. This has been renamed now, so SDL2 had to be updated for it.
2022-10-17 21:59:38 +02:00
Sylvain
485bb3565b
Fixed bug #6401 - change the order of triangles when using RenderCopy, RenderCopyEx and RenderFillRect 2022-10-17 13:30:30 +02:00
Pierre Wendling
5b9608e08c Remove D3D9 workarounds for Watcom.
The linked PRs have been merged since May.
2022-10-12 17:55:37 +03:00
Sam Lantinga
df1bd07dee d3d12: actually execute the pending commands before processing resize
This makes sure all the resources are in the expected state

Fix the D3D12 case in https://github.com/libsdl-org/SDL/issues/6376
2022-10-11 07:25:27 -07:00
zhailiangliang
41c718edca Fix memory leak in PSP_CreateTexture 2022-10-10 22:36:55 -07:00
Pierre Wendling
8117bfe5d1 PS2: Ignore warnings from toolchain headers.
The `gsInline.h` header creates `Wdeclaration-after-statement` warnings.
2022-10-10 22:31:16 -07:00
Sam Lantinga
f99fc3268e d3d12: fixed window resize handling
Fixes https://github.com/libsdl-org/SDL/issues/6355
2022-10-09 11:42:39 -07:00
Sam Lantinga
490c20f93f d3d12: reset the vertex buffer size when it is released 2022-10-09 09:57:55 -07:00
Anonymous Maarten
01498d3acf SDL_render_psp.c: fix -Wshadow
Emitted by PSP's gcc
2022-10-08 23:41:07 +02:00
Anonymous Maarten
85fd40fafd Fix -Wunused-const-variable warning when using clang-cl 2022-10-08 23:41:07 +02:00
Ryan C. Gordon
321ca1091d
opengles2: Texture names are GLuint, not GLenum. 2022-10-03 12:00:38 -04:00
Ryan C. Gordon
01c5554f0e
opengles2: SDL_GL_BindTexture() should bind all YUV textures.
This matches what the non-GLES OpenGL renderer does.

Fixes #6070.
2022-10-03 11:57:10 -04:00
zll
69bbe4ce7d Fix memory leak in VITA_GXM_CreateRenderer 2022-09-29 14:32:56 +03:00
zhailiangliang
00b67f5572 Fix potential memory leak in GLES_CreateTexture 2022-09-20 20:14:01 -07:00
Sam Lantinga
82b40f097b Fixed runaway CPU usage in the metal renderer when the window is minimized 2022-09-16 09:55:20 -07:00
Sam Lantinga
e2753e19e8 Calculate simulated vsync interval based on display refresh rate 2022-09-16 07:44:40 -07:00
Sam Lantinga
208964f038 Reset the simulated vsync presentation timeline if it's been too long since the last present 2022-09-16 07:44:40 -07:00
Sam Lantinga
1663cb4196 Reset simulated presentation timeline when vsync status changes 2022-09-16 07:44:40 -07:00
Sam Lantinga
d744aafb05 Added support for simulated vsync in the renderer
This kicks in if the platform doesn't support vsync directly, or if the present fails for some reason (e.g. minimized on some platforms)

Fixes https://github.com/libsdl-org/SDL/issues/5134
2022-09-16 07:44:40 -07:00
Ozkan Sezer
c23fb235c8 SDL_render_d3d12.c: Fix uninitialized warning for CreateEventExFunc 2022-09-16 17:20:56 +03:00
Sam Lantinga
5bc85d6788 Only advertise the SDL_PIXELFORMAT_EXTERNAL_OES format if we can build the shader for it 2022-09-16 06:15:45 -07:00
Sam Lantinga
2970710b5d Pretty print shaders for debugging purposes 2022-09-15 07:41:29 -07:00
Sam Lantinga
bc57d3e35c Fixed OpenGL ES shader compilation on Linux 2022-09-15 06:57:41 -07:00
Sam Lantinga
8a15a738f3 Fixed uninitialized variable warning 2022-09-15 06:21:19 -07:00
Sam Lantinga
b5102a551b Fixed OpenGLES shaders failing after renderer has been created
Cache all the shaders up front, so we can verify that they won't silently fail at runtime.

If compiling the fragment shaders with the precision hint fails, try again without specifying precision.

Fixes https://github.com/libsdl-org/SDL/issues/6166
Fixes https://github.com/libsdl-org/SDL/issues/6174
2022-09-14 08:03:46 -07:00
Amir
7f415ce587 android: fix some compiler warnings 2022-09-12 10:06:08 -07:00
Sylvain
90a480a100
Fixed bug #6199 - Broken clip behaviour on a render target (metal) 2022-09-08 05:44:39 +02:00
Sam Lantinga
29f4a5ba0e Add GLES2 shader prologue infrastructure. (by @eloj)
There is supposedly an OpenGL ES2 target that does not support precision specifiers. However, the existing logic to detect this is currently broken in two ways:

1) There's a typo of the `#ifdef` as `#if`.
2) Checking for `GL_FRAGMENT_PRECISION_HIGH` can not be the correct way to detect this platform. Other targets, including some desktops, will also not have this defined (for various reasons).

Because some of the shader code is missing precision specifiers, and because a default is ONLY provided if `GL_FRAGMENT_PRECISION_HIGH` is set, these other targets break.

Instead of 'hard-coding' the prologue string into shaders in the C source, use our ability to provide a list of strings to `glShaderSource` instead, leaving the determination to run-time.

This commit closes https://github.com/libsdl-org/SDL/pull/6182
2022-09-06 15:55:27 -07:00
Sam Lantinga
4fd6bba257 Refactored for similarity to surrounding code 2022-09-06 12:29:42 -07:00
Cameron Cawley
10e1ef00e2 Fix compatibility with Windows XP 2022-09-06 08:55:35 -04:00
Francisco Javier Trujillo Mata
f1e4685806 Adding specific SDL_Hint for the dynamic VSYNC 2022-08-30 07:20:36 -04:00
Noel Berry
00452e47fa
Adding SDL_GetWindowSizeInPixels for window size in pixels (#6112) 2022-08-24 11:25:13 -07:00
Sam Lantinga
50c5d23f7d Round coordinates so very small floating point values don't turn into 0x80000000
e.g. SDL_RenderDrawLineF(renderer, -1e20, -1e20, 10, 10);

Fixes https://github.com/libsdl-org/SDL/issues/6116
2022-08-23 07:42:48 -07:00
Cameron Cawley
09b6956dcc opengl: Support NV12 textures on GPUs with only 2 texture units 2022-08-16 07:30:13 -07:00
Francisco Javier Trujillo Mata
7d5ccae22d Fix memory leak when destroying texture 2022-08-14 08:13:37 -04:00
Sam Lantinga
cb46e1b3f0 Removed unused variable 2022-08-12 20:51:44 -07:00
Ethan Lee
a28f426acb render: Only update size/scale/viewport when moving to a new display, rather than all window movement.
We really only care about DPI changes here, so this both reduces work and also avoids weird cases where viewport state can be corrupted by trivial window events. This doesn't _completely_ get rid of the issue but this is somewhat intentional, since apps will definitely want to do a full reset when changing displays anyhow (otherwise DPI/adapter changes will screw things up, and that's out of our control as long as both window size and drawable size are exposed at the same time.

Note that OpenGL still captures window events because of weird platform-specific issues like macOS and viewport stretching!

Fixes #5949
2022-08-12 16:13:24 -04:00
Francisco Javier Trujillo Mata
20f9a1b8a4 Implement SetTextureScaleMode 2022-08-08 09:34:08 -07:00
Francisco Javier Trujillo Mata
fbb440d167 Invalidate texture in the UnlockTextureMethod 2022-08-06 12:11:34 -07:00
Sam Lantinga
5858c7dfce Fixed OpenGL ES Shaders for systems that don't understand precision keywords 2022-08-05 16:17:10 -07:00
Francisco Javier Trujillo Mata
944111dbcf Cleaning up video driver 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
83c1179744 Adding SetViewPortCommand 2022-08-02 11:40:31 -07:00