675 Commits

Author SHA1 Message Date
Ryan C. Gordon
c275436f56
opengles2: Batching lines/points used wrong var for summing vertex counts.
Fixed this in the vitagxm backend too, but I don't know what the state of
that code is otherwise.

Reference Issue #5061.
2022-01-09 00:39:02 -05:00
Sam Lantinga
3b083b9911 Fixed compile warning 2022-01-08 14:07:42 -08:00
Sam Lantinga
b82af9dfbf Improved OpenGL point drawing performance (thanks @slime73!)
We'll do proper call batching for the SDL 2.0.22 release
2022-01-08 14:05:50 -08:00
Sam Lantinga
1a73c45a08 Fixed incorrect color in the OpenGL driver 2022-01-08 13:35:17 -08:00
Sylvain
3cdda8f8ab
PSP: use 'data' variable which is alread the driver data 2022-01-08 21:58:26 +01:00
Sam Lantinga
4ef2529bf9 More efficient calculation of render_count 2022-01-08 12:37:57 -08:00
Sam Lantinga
5346c93b62 Fixed assertion on number of points rendered 2022-01-08 12:28:43 -08:00
Sam Lantinga
4b71962031 Prevent overdraw with connected line segments 2022-01-08 12:02:30 -08:00
Sam Lantinga
09ece861d1 Added the hint SDL_HINT_RENDER_LINE_METHOD to select the line rendering method 2022-01-08 11:36:52 -08:00
Sam Lantinga
c1e6079836 As an optimization, draw horizontal and vertical lines using rectangles 2022-01-08 11:09:11 -08:00
Sam Lantinga
3da7c6305a Assert that we have drawn the expected number of points 2022-01-08 11:07:03 -08:00
Sam Lantinga
9f56faeedc Added line drawing using Bresenham's line algorithm (thanks @rtrussell!) 2022-01-08 10:59:31 -08:00
Sam Lantinga
fe3a33a092 Use RenderGeometry for drawing lines at all scales 2022-01-08 10:10:18 -08:00
Sam Lantinga
1694782b2a Remove redundant work when render scale is 1.0 2022-01-08 09:32:23 -08:00
Sam Lantinga
2026a78dc2 Don't flush in RenderDraw*WithRects()
This allows these functions to be reused in the future for other primitives
2022-01-08 09:23:58 -08:00
Sam Lantinga
18e4d9fed1 Re-enable line drawing path in render drivers
This is still used for scaled line drawing in RenderDrawLinesWithRects()
2022-01-08 09:02:25 -08:00
Ozkan Sezer
4472b83129 PSP_RunCommandQueue: fix argument to PSP_SetBlendState()
src/render/psp/SDL_render_psp.c: In function 'PSP_RunCommandQueue':
src/render/psp/SDL_render_psp.c:1200: warning: passing argument 1 of 'PSP_SetBlendState' from incompatible pointer type
2022-01-08 11:56:56 +03:00
Ryan C. Gordon
cc2013378d
render: Fixed some compiler warnings.
Fixes #5197.
2022-01-07 20:22:51 -05:00
Ryan C. Gordon
6d3b5d66cd
psp: draw lines with RenderGeometry, same as with the other renderers. 2022-01-07 18:18:53 -05:00
Sylvain
9cb2c549fa Remove QueueDrawLines from D3D, D3D11 2022-01-07 14:10:23 -08:00
Sylvain
b88b6b3c23 Remove QueueDrawLines from METAL 2022-01-07 14:10:23 -08:00
Sylvain
9aac55317d Remove QueueDrawLines from GL, GLES, GLES2 2022-01-07 14:10:23 -08:00
Sylvain
8ea8b2e697 Use QueueDrawLine if provided, otherwise use RenderGeometry 2022-01-07 14:10:23 -08:00
Sylvain Becker
c498727471
render: Use RenderGeometry to draw lines
This patch is from @1bsyl

Fixes #5061.
2022-01-07 16:14:28 -05:00
Sam Lantinga
4b38d4c96b Leave the Metal view active on the window when recreating the Metal renderer
Fixes https://github.com/libsdl-org/SDL/issues/5140

Also move the metal tag definition to SDL_syswm.h so it can be used by applications
2022-01-07 12:38:45 -08:00
Ryan C. Gordon
88ac517df0
opengles2: Fix point drawing. 2022-01-07 15:04:04 -05:00
Wouter Wijsman
515b5f2a39 Fix build errors in PSP port 2022-01-06 10:17:05 -08:00
Wouter Wijsman
34e34ad5a5 Remove debug code from PSP renderer 2022-01-06 10:17:05 -08:00
stdgregwar
520c89a00a cleaning 2022-01-06 10:17:05 -08:00
stdgregwar
09f4711f40 Fix LRU when destroying texture. 2022-01-06 10:17:05 -08:00
stdgregwar
c3ec62d6a6 PSP lazier blend states, display mode report with 16bit option 2022-01-06 10:17:05 -08:00
stdgregwar
0f5368fe11 PSP cached blending and texturing state, ABGR1555 stencil hack 2022-01-06 10:17:05 -08:00
stdgregwar
fe405eb27b fixed LRU cache code 2022-01-06 10:17:05 -08:00
stdgregwar
c1f152292b Spill render targets to ram on PSP 2022-01-06 10:17:05 -08:00
stdgregwar
77d874e3c0 Attempt to make render to texture work on PSP 2022-01-06 10:17:05 -08:00
Sam Lantinga
120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
Sylvain
8622eda9e9
SDL_RenderGeometry / software: TRIANGLE_GET_TEXTCOORD interpolates up to the max values included, so reduce by 1 2022-01-02 22:34:56 +01:00
Alex Szpakowski
724468ae2c GL renderer uses glDrawArrays instead of glBegin/glEnd.
Also change internal colors sent to GL to use unorm8 components instead of float, for improved performance.
2021-12-27 10:52:47 -05:00
Sylvain
44c84c0d8e
GLES2/Big-endian: don´t swap datas for yuv textures (Thanks 0x1F9F1 !) 2021-12-17 17:44:34 +01:00
Sylvain
3a69828e87
Fixed GLES2 back-end on Big Endian Platform (see #5093) 2021-12-17 13:15:39 +01:00
Sylvain
3d5fcb5da6 Fix warning 2021-12-16 09:19:53 -08:00
Sylvain
4342e6bd21 SDL_render.c: lighten the cast syntax 2021-12-16 09:19:53 -08:00
Sylvain
50d49c63ed GLES2 backend: cast with SDL_Vertex and SDL_VertexSolid 2021-12-16 09:19:53 -08:00
stdgregwar
0b7b0977fc fix PSP texure artifacts 2021-12-15 18:00:28 -08:00
Francisco Javier Trujillo Mata
0341ec93fe Improve performance when vsync is enabled and the game is not reaching the 60 FPS 2021-12-15 11:29:49 -08:00
Alex Szpakowski
3a5e148b13 Renderer backends use SDL_Color instead of int for geometry colors. 2021-12-14 12:19:16 -08:00
Sam Lantinga
b08e57e926 Don't try to create a vbo if we aren't using any vertices 2021-12-14 09:32:05 -08:00
Sylvain
b7885abc44
Fixed bug #5087: SDL_RenderGeometryRaw() passes colors as int* instead of SDL_Color* 2021-12-14 10:31:55 +01:00
Alex Szpakowski
323ba6c008 d3d11 renderer: reduce vertex bandwidth and calculations. 2021-12-13 15:14:33 -08:00
Sylvain
8927d73b1c
RenderGeometry: simplify casting (Thanks Daniel Gibson) 2021-12-12 09:55:23 +01:00