Commit graph

42 commits

Author SHA1 Message Date
Ryan C. Gordon
a052fa0ae8 Removed anisotropic option from SDL_HINT_RENDER_SCALE_QUALITY.
Anisotropic filtering is meant to be used for textures at a stark
 angle, not perpendicular to the camera.

--HG--
extra : rebase_source : e01c4da3bae7f1628de7c049f31f1208dbbbb24c
2013-08-06 00:23:04 -04:00
Sam Lantinga
3334092bdc Fixed compiler warning with gcc 2013-07-30 00:02:45 -07:00
Sam Lantinga
08e8f26d62 Added Direct3D shader to hardware accelerate YV12 and IYUV textures. 2013-07-23 12:55:19 -07:00
Sam Lantinga
32188834b5 Updated blend semantics so blending uses the following formula:
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
    dstA = srcA + (dstA * (1-srcA))
This allows proper compositing semantics without requiring premultiplied alpha.

Needs full unit test coverage and bug fixes!
2013-07-23 08:06:49 -07:00
Sam Lantinga
a663b9c637 Fixed bug 1977 - D3D_UpdateClipRect() sets the wrong width for the clip rect
Bithika Mookherjee

SDL_RenderSetClipRect() calls into renderer->UpdateClipRect(renderer).

I am not sure if UpdateClipRect() can point to a number of clip rect update functions, but on my platform it calls D3D_UpdateClipRect().

In that function, the rect to pass to IDirect3DDevice9_SetScissorRect() has it's right field set as:

    r.right = rect->w + rect->w;

But actually, this should be:

    r.right = rect->x + rect->w;
2013-07-19 22:43:14 -07:00
Philipp Wiesemann
c8c3817b12 Changed include directive to standard header. 2013-07-07 16:13:17 +02:00
Yuri K. Schlesner
5480cdd85c Re-apply texture filter when resetting direct3d renderer. 2013-05-29 06:31:48 -05:00
Sam Lantinga
c55f53aa40 Fixed bug 1622 - SDL_RenderSetViewport with empty SDL_Rect raises wrong error for OpenGL rendering backend
It's now legal to set an empty viewport rect - it will prevent any rendering.

Also added an API to query the output size: SDL_GetRendererOutputSize()
2013-05-29 03:07:55 -07:00
Sam Lantinga
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
cbe94acd8e Fixed bug 1838 - [Patch] Direct3D resource leak on SDL_DestroyRenderer() 2013-05-16 00:56:19 -07:00
Sam Lantinga
866f2e5f9e First pass on SDL render clip rect functionality 2013-05-04 04:46:00 -07:00
Ryan C. Gordon
4f438b70a2 Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Sam Lantinga
541a638836 Fixed compile errors on Windows 2013-03-06 09:45:53 -08:00
Sam Lantinga
4e631c1583 Fixed warning messages when loading Direct3D DLL
kmx

I have investigated the warning "Failed loading D3DX9_*.dll" and come up with the enclosed patch (please forward it to relevant SDL2 mailing list/bugtracker).
2013-03-05 18:52:25 -08:00
Sam Lantinga
1a4596d798 Fixed bug 1722 - An attempt to release NULL Direct3d surface
Evgeny

static void
D3D_DestroyRenderer(SDL_Renderer * renderer)

has a critical problem. It may try to release IDirect3DSurface9 surface pointed
by NULL pointer. That leads to really wierd consequences on my system.

It happens when the previous call to IDirect3D9_CreateDevice() fails leaving
D3D_RenderData::defaultRenderTarget uninitialized.
2013-02-17 23:30:47 -08:00
Sam Lantinga
95dcfa4c28 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
5f3f837a42 Fixed bug 1491 - Directx3d Crash on resize
Spinduluz

RenderTarget has to be released before a device reset is done. It's a
D3DPOOL_DEFAULT surface (resides in video memory and have to be recreated).
2013-02-11 21:12:14 -08:00
Sam Lantinga
f4294fd806 Improvements from Alfred:
- Added new SDL_HINT_ALLOW_TOPMOST hint, when set to "0" then never set the topmost bit on a window. Useful when debugging fullscreen issues.
- fixed crash in windows joystick scanning if we failed to load the xinput dll
- added support for SDL_WINDOW_FULLSCREEN_DESKTOP under windows
- synthesize relative mouse movements if directinput fails to send relative moves, happens under virtual box.
2012-12-31 09:30:15 -08:00
Sam Lantinga
f366b098d4 Added SDL_RenderSetScale() and SDL_RenderGetScale() 2012-10-01 20:59:33 -07:00
Sam Lantinga
f380ecb137 Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Ryan C. Gordon
386b1d15cf Whoops, removed wrong variable. 2012-08-24 19:39:51 -04:00
Ryan C. Gordon
816523a285 Fixed a bunch of compiler warnings with Cygwin/MingW. 2012-08-24 19:34:28 -04:00
Sam Lantinga
beb1db9b5b Fixed compiling with Visual Studio 2012-06-19 13:50:14 -04:00
Gabriel Jacobo
17bdcc6e8e RenderCopyEx,rotation and flipping for all hardware/software backends (#1308) 2012-06-01 19:51:08 -03:00
Sam Lantinga
0458fa488a Renamed SetTargetTexture() to SetRenderTarget() 2012-01-22 01:26:28 -05:00
Sam Lantinga
da686e5bd4 Reorganized the render target code, moving the viewport handling to the general code and adding software implementation. 2012-01-21 22:22:30 -05:00
Sam Lantinga
301928014c We've already crashed by this point if we don't have a renderer. The calling code should check this. 2012-01-21 18:30:50 -05:00
Sam Lantinga
23b96d3406 Added a renderer flag to expose whether a renderer supports render to texture. 2012-01-19 21:06:47 -05:00
Sam Lantinga
320c59b387 Fix for building with Visual Studio 2012-01-19 20:25:09 -05:00
Sam Lantinga
a49a88676f Implementation of render targets, by Mason Wheeler and Gabriel Jacobo
Thanks guys!
2012-01-18 22:45:49 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
ad85c9da0e Fixed bug 1338 - Direct3D renderer should set D3DCREATE_FPU_PRESERVE for not behaving vastly different on doubles (causes 3rd party lib crashes!)
Jonas Thiem 2011-11-29 12:28:02 PST
Direct3D renderer should set D3DCREATE_FPU_PRESERVE for not behaving vastly
different to OpenGL/software rendering on doubles and break some libraries
really badly.

Most notable affected example: Lua, which does the most unpredictable things
which are really almost impossible to debug/find out for beginners who never
heard this culprit exists.

Since I believe all renderers should behave the same on that doubles simply
work as expected in a program, this should really be changed! (also this wasted
a few days of my life wondering why everything in my program was so broken)
2011-12-29 05:18:16 -05:00
Sam Lantinga
97ae2354eb Fixed issues closing lines with the OpenGL ES renderer. 2011-11-10 00:22:44 -05:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
a19e258730 Added the SDL_HINT_RENDER_SCALE_QUALITY hint, which defaults to nearest pixel sampling. 2011-03-13 11:18:35 -07:00
Sam Lantinga
a6be4e7267 Don't reset the viewport unless you have to. 2011-02-15 14:17:42 -08:00
Sam Lantinga
c804b92b9e Changed the concept of a render clip rect to a render viewport.
The render viewport is automatically re-centered when the window changes size, so applications that don't care will not have to handle recalculating their rendering coordinates.

Fixed API for drawing and filling multiple rectangles - the parameter should be an array of rects, not an array of pointers to rects.

Fixed API for updating window rects for consistency with other APIs - the order is pointer to array followed by count in array.
2011-02-15 13:59:59 -08:00
Sam Lantinga
e5803d148c Happy 2011! :) 2011-02-11 22:37:15 -08:00
Sam Lantinga
7133afac5f Made it possible to disable the rendering subsystem with configure --disable-render 2011-02-08 10:04:09 -08:00
Sam Lantinga
8253658837 Added function SDL_RenderSetClipRect() 2011-02-07 20:06:26 -08:00
Sam Lantinga
cc1f36b7dc Minor consistency cleanup and documentation link update. 2011-02-06 00:48:41 -08:00
Sam Lantinga
f002356b91 Renamed files for consistency
--HG--
rename : src/render/direct3d/SDL_d3drender.c => src/render/direct3d/SDL_render_d3d.c
rename : src/render/opengl/SDL_renderer_gl.c => src/render/opengl/SDL_render_gl.c
rename : src/render/opengles/SDL_renderer_gles.c => src/render/opengles/SDL_render_gles.c
rename : src/render/software/SDL_renderer_sw.c => src/render/software/SDL_render_sw.c
rename : src/render/software/SDL_renderer_sw_c.h => src/render/software/SDL_render_sw_c.h
2011-02-05 12:01:11 -08:00
Renamed from src/render/direct3d/SDL_d3drender.c (Browse further)