Commit graph

45 commits

Author SHA1 Message Date
Gabriel Jacobo
6ef1aefc05 Fixes #1523 by removing inconsistent use of texture->access 2012-06-21 11:16:14 -03:00
Gabriel Jacobo
17bdcc6e8e RenderCopyEx,rotation and flipping for all hardware/software backends (#1308) 2012-06-01 19:51:08 -03:00
Sam Lantinga
aaf23fe8af Fixed loading textures when the window starts hidden.
The viewport automatically resets to the window size when you programmatically resize the window.
2012-01-22 21:46:06 -05:00
Sam Lantinga
39b2ae4a20 Added a convenience function SDL_CreateWindowAndRenderer() 2012-01-22 19:22:53 -05: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
23b96d3406 Added a renderer flag to expose whether a renderer supports render to texture. 2012-01-19 21:06:47 -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
d0375e624c Better error messaging when SDL can't create a window surface. 2012-01-07 14:21:22 -05:00
Sam Lantinga
3b5d79f407 Fixed bug 1344 - No OpenGL headers when compiling -> no working Software renderer at runtime neither
Make sure we have at least one render driver.
2012-01-07 01:13:15 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
c5b4e5f63e Fixed SDL applications being killed immediately after being backgrounded, because they were trying to draw while minimized. 2011-11-07 23:07:00 -05:00
Sam Lantinga
ad2a21d404 Lots of fixes importing SDL source wholesale into a new iOS project
--HG--
rename : src/libm/math.h => src/libm/math_libm.h
2011-10-31 05:56:58 -04:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
126bbbaa50 Added SDL_GetRenderer() 2011-04-04 09:29:13 -07:00
Sam Lantinga
45d991f20d Fixed permissions for C source files 2011-03-11 11:52:41 -08:00
Sam Lantinga
903efd986f SDL_RenderReadPixels() is restricted to the viewport area. 2011-03-10 01:00:43 -08:00
Sam Lantinga
6e05dee645 a Nintendo ds update
Frank Zago to SDL

For those interested, here's a snapshot of the current port. I did away with
most of the previous attempt which was based of the sprite engine, because the
support is limited to 128 64x64 sprites. Instead I'm using the gl engine.
The drawback is that either the frame buffer or the gl engine can be used
because there's not that much video memory on a DS.

With minimal changes to their code, it can now run the following tests: ,
testspriteminimal, testscale and testsprite2. The last 2 only run under the
emulator for some reason. The tests are not included in this patch for size
reason.

In 16 bits mode, the 16th bit indicated transparency/opacity. If 0, the color
is not displayed. So I had to patch a few core file to set that bit to 1. See
patch for src/video/SDL_RLEaccel.c and src/video/SDL_blit.h. Is that ok, or is
there a better way ?

The nds also doesn't support windowed mode, so I force the fullscreen in
src/video/SDL_video.c.  Is that ok, or is there a better way ?

To get a smaller library, I also tried to not compile the software renderer
when the hardware renderer is compiled in, and define SDL_NO_COMPAT; however
the compilation eventually fails in SDL_surface.c because SDL_SRCCOLORKEY is
defined in SDL_compat.h. Is SDL_NO_COMPAT only for application and not SDL
itself ?
2011-03-06 21:12:19 -08:00
Sam Lantinga
9b04915913 If you pass in texture format 0, it'll use the first supported texture format. 2011-02-28 14:47:39 -08:00
Sam Lantinga
84c86a8df1 Reverted the experiment, it didn't work. 2011-02-20 23:51:31 -08:00
Sam Lantinga
e4acc9ef07 Experiment to try to account for source clipping 2011-02-20 23:16:58 -08:00
Sam Lantinga
92f76388ca Zero streaming textures to reduce confusion.
(See mailing list message with subject "Streaming textures not properly initialized?")
2011-02-17 18:58:43 -08:00
Sam Lantinga
ea8037a625 Implemented OpenGL ES RenderClear() 2011-02-17 02:23:48 -08:00
Sam Lantinga
30d36c1c80 Fixed SDL_RenderClear() if the render driver doesn't implement it. 2011-02-17 02:17:38 -08:00
Sam Lantinga
c1b336b8ee Don't accidentally pick a YV12 format as the closest format. 2011-02-15 15:50:21 -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
f9a5f416fb Frank Zago to SDL
On 02/12/2011 01:44 PM, Sam Lantinga wrote:
> BTW, you probably want to nuke the NDS renderer and just implement these three
> functions instead:
>     int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 *
> format, void ** pixels, int *pitch);
>     int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, int numrects,
> SDL_Rect * rects);
>     void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);

Patch attached. The renderer for the DS is not used anymore, but I left the
file in place if someone wants to finish it.

I've also added a README.ds and fixed the spinlocks.
2011-02-13 14:01:02 -08:00
Sam Lantinga
5095592ce5 A few fixes:
Fixed creating render texture framebuffer.
Removed the need for palette watch, added surface format caching.
Added an SDL_DONTFREE flag so you can't free the window and 1.2 shadow surfaces.
2011-02-13 13:46:10 -08:00
Sam Lantinga
96656bb924 Frank Zago to sdl
The following patch fixes some of the bitrot for the Nintendo DS port.
The support is still basic at the moment, but it allows to run the "general"
test under the current head of tree (parent: 5269:11bd1585efb5 tip).
Most of the patch is mine, but I integrated a couple changes that John
Magnotti posted on Feb 1st.
2011-02-12 11:36:56 -08:00
Sam Lantinga
ba0ff6d7c8 Fixed a crash caused by the 1.2 code path getting a YV12 texture. :) 2011-02-12 08:17:58 -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
f582f9e58e Added a simple log message API 2011-02-07 16:45:40 -08:00
Sam Lantinga
b1c0c48f03 Prefer the OpenGL ES 2.0 context when it's available, make it possible to create an OpenGL 2.0 context on iPhoneOS 2011-02-06 10:22:25 -08:00
Sam Lantinga
f2c40726b6 Added an OpenGL ES 2.0 renderer, contributed by itsnotabigtruck
This compiles, but it untested.
2011-02-06 00:00:13 -08:00
Sam Lantinga
8b3eb38df2 Updated the DirectFB support, from Couriersud
attached is a working directfb driver diff which works with the current
changes. There are a number of changes around it as well, e.g.
configure.in.

The directfb renderdriver right now still depends on a some "includes"
from src/video/directfb. That's why it is not yet moved to the new
render folder.
2011-02-05 16:07:10 -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
Sam Lantinga
f8247546d6 Added the SDL_HINT_RENDER_DRIVER and SDL_HINT_RENDER_VSYNC hints. 2011-02-05 10:35:36 -08:00
Sam Lantinga
065cf0f75a SDL_SetTextureBlendMode broken, caught by Kai Sterker - Thanks! 2011-02-05 00:32:04 -08:00
Sam Lantinga
052351dbe2 Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
The software renderer has been re-routed to use the framebuffer interface, which makes it possible to have software rendering available even on simple ports.
2011-02-03 15:49:37 -08:00
Sam Lantinga
fe2b0d9703 Simplified and improved the process of creating a texture from a surface. 2011-02-03 00:54:29 -08:00
Sam Lantinga
31b3ad2414 Making the API simpler, removed the writepixels interface 2011-02-03 00:22:18 -08:00
Sam Lantinga
d2b54f7d24 Made it possible to create a texture of any format, even if not supported by the renderer.
This allows me to reduce the set of formats supported by the renderers to the most optimal set, for a nice speed boost.

--HG--
rename : src/video/SDL_yuv_mmx.c => src/render/SDL_yuv_mmx.c
rename : src/video/SDL_yuv_sw.c => src/render/SDL_yuv_sw.c
rename : src/video/SDL_yuv_sw_c.h => src/render/SDL_yuv_sw_c.h
rename : src/video/mmx.h => src/render/mmx.h
2011-02-03 00:19:40 -08:00
Sam Lantinga
5897ef7d95 Moved the rendering code out to a separate directory in the hope that it can someday be completely decoupled from the rest of the library and be expanded to an awesome 2D on 3D library.
--HG--
rename : src/video/windows/SDL_d3drender.c => src/render/direct3d/SDL_d3drender.c
rename : src/video/SDL_renderer_gl.c => src/render/opengl/SDL_renderer_gl.c
rename : src/video/SDL_renderer_gles.c => src/render/opengles/SDL_renderer_gles.c
rename : src/video/SDL_renderer_sw.c => src/render/software/SDL_renderer_sw.c
2011-02-02 14:34:54 -08:00