797 Commits

Author SHA1 Message Date
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
Francisco Javier Trujillo Mata
a9f4cda3f9 Adding setcliprect command 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
fb1a205e70 Implement blend modes 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
075f9016fa Remove some unnecessary comments 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
ed301b123b Updating supported format 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
1d1965b6ee Removing the BGR_888 from texture supported 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
f75c35c071 Add invalidate texture when it changes 2022-08-02 11:40:31 -07:00
Daniel Santos
5bb965be3d Implement RenderLines 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
0f0e5b44dc Increase size of pool for gsKit events 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
f758cad81a Remove non needed FillRects function 2022-08-02 11:40:31 -07:00
Daniel Santos
3cb124b98e Implement RenderPoints 2022-08-02 11:40:31 -07:00
Daniel Santos
df6ebc2562 Implement FillRect 2022-08-02 11:40:31 -07:00
Daniel Santos
a152e467b1 Fix "implicit declaration" with memalign 2022-08-02 11:40:31 -07:00
Daniel Santos
33cbf9acbe Fix some mixed declaration warnings 2022-08-02 11:40:31 -07:00
Daniel Santos
acf48f14ac Vertex pointer revision
Now triangles are fully working
2022-08-02 11:40:31 -07:00
Daniel Santos
726180445e Add textured triangle prim 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
2a70d492f0 Destroy texture properly 2022-08-02 11:40:31 -07:00
Daniel Santos
7b0486d490 Try triangles 2022-08-02 11:40:31 -07:00
Daniel Santos
d5305ee098 Do properly color assign 2022-08-02 11:40:31 -07:00
Daniel Santos
b48c74a316 Add GeometryQueue 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
3bfc8f554e Removing some of the QueueCopy functions because they are legacy 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
be1219bd4e Implement setDrawColor 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
f1699ce735 Implementing Clear command and texture Update 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
c472b8dd45 Whole clean around render and video driver 2022-08-02 11:40:31 -07:00
Daniel Santos
cdf89fde91 Add triangle prim support
Improve line support
Add initial texture support
2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata
88e64f9ae1 Add natively supported colors 2022-08-02 11:40:31 -07:00
Daniel Santos
90e0e5c29d Add point, line and rect support 2022-08-02 11:40:31 -07:00
Daniel Santos
147a71b976 Finish dummy driver 2022-08-02 11:40:31 -07:00
Daniel Santos
2660449c6c Add dummy driver 2022-08-02 11:40:31 -07:00
slime
65647b3417 SDL_Render: use high precision texcoords in ES2 shaders, when possible
Fixes #5884
2022-07-22 19:03:53 -07:00
Sam Lantinga
b299cb3d3c Added a utility function to calculate the next power of 2 for a value 2022-07-17 08:31:16 -07:00
chalonverse
f317d619cc
Xbox GDKX support (#5869)
* Xbox GDK support (14 squashed commits)

* Added basic keyboard testing

* Update readme

* Code review fixes

* Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
2022-07-01 13:59:14 -07:00
chalonverse
4f73219794 Fixed D3D12 renderer not working with batching, and got rid of the vertex buffer size limit 2022-06-30 03:41:17 -07:00
Pierre Wendling
6c536afdb7 Fix C89 declaration for macOS modules.
Since Clang 14, `-Wdeclaration-after-statement` is enforced on every
standard.
2022-06-27 15:19:40 -07:00
chalonverse
3b191580c3
Windows GDK Support (#5830)
* Added GDK

* Simplfied checks in SDL_config_wingdk.h

* Added testgdk sample

* Added GDK readme

* Fixed error in merge of SDL_windows.h

* Additional GDK fixes

* OpenWatcom should not export _SDL_GDKGetTaskQueue

* Formatting fixes

* Moved initialization code into SDL_GDKRunApp
2022-06-27 10:19:39 -07:00
Sylvain
314bb5a1ed
Fixed bug #5850: Android EGL_BAD_ACCESS because of viewport command while turning the screen off/on. 2022-06-27 14:45:14 +02:00
Ivan Epifanov
b2f07d94d2 Vita: create rendertarget color surface with same format as texture. Fixes #5844 2022-06-26 15:41:14 -07:00
unknown
ebe4f47f2b Fixed __VA_ARGS__ in gcc when no args 2022-06-26 15:35:18 -07:00
unknown
51c6488f97 Add support for SDL_render_d3d12.c to compile in C++ mode 2022-06-26 15:35:18 -07:00
Sam Lantinga
adc6875870 Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!)
Closes https://github.com/libsdl-org/SDL/pull/5811
2022-06-17 10:22:28 -07:00
Sam Lantinga
1eb247fa2e Fixed building D3D12 renderer with latest mingw-64 2022-06-16 15:44:18 -07:00
Ozkan Sezer
960b86dcb5 update SDL_render_d3d12.c after DPI scaling/highdpi support patch.
See https://github.com/libsdl-org/SDL/pull/5778#issuecomment-1153006938
2022-06-14 21:03:31 -07:00
Ryan C. Gordon
ded6c22efb
render: Corrected wrong SDL_memcpy() sizes for viewport, cliprect.
Fixes #5786.
2022-06-14 14:10:14 -04:00
Eric Wasylishen
e09551bc80 Fix WinRT build 2022-06-11 14:19:01 -07:00
Eric Wasylishen
ab81a559f4 Windows DPI scaling/highdpi support
Adds hint "SDL_WINDOWS_DPI_SCALING" which can be set to "1" to
change the SDL coordinate system units to be DPI-scaled points, rather
than pixels everywhere.

This means windows will be appropriately sized, even when created on
high-DPI displays with scaling.

e.g. requesting a 640x480 window from SDL, on a display with 125%
scaling in Windows display settings, will create a window with an
800x600 client area (in pixels).

Setting this to "1" implicitly requests process DPI awareness
(setting SDL_WINDOWS_DPI_AWARENESS is unnecessary),
and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows.
2022-06-11 14:19:01 -07:00