Commit graph

41 commits

Author SHA1 Message Date
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
Gabriel Jacobo
bd7b381374 Implements SDL_GL_BindTexture and SDL_GL_UnbindTexture (#1576) 2012-09-03 11:16:12 -03:00
Sam Lantinga
4d8e7cdf64 Switch the OpenGL ES renderers to request EGL OpenGL contexts 2012-07-18 15:20:32 -07:00
Gabriel Jacobo
17bdcc6e8e RenderCopyEx,rotation and flipping for all hardware/software backends (#1308) 2012-06-01 19:51:08 -03:00
Sam Lantinga
affa363396 Fixed OpenGL ES 1.1 on Android
From Gabriel Jacobo:
What I did notice is that calling
data->glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &value); doesn't produce any
result in Android GLES1.1 if the active framebuffer is the default one, ie,
whatever is in value stays unmodified.
2012-01-31 21:03:35 -05:00
Sam Lantinga
f917e29ad7 Fixed magenta texture on iOS with OpenGL ES 2.0 2012-01-30 20:56:25 -05:00
Sam Lantinga
d74752d82f Added glGenFramebuffers() to the function pointer list 2012-01-28 14:53:23 -05: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
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
f7ad18f9fc X11 OpenGL ES minor corrections
Scott Percival 2012-01-08 04:21:22 PST

I tested the new build on my two ARM machines, and fixed a few bugs:
- if SDL_VIDEO_DRIVER_UIKIT, SDL_VIDEO_DRIVER_ANDROID or
SDL_VIDEO_DRIVER_PANDORA are specified, function pointers are grabbed from the
compile-linked library instead of through SDL_GL_GetProcAddress. (not sure if
this is the best way to go about it)
- removing "/usr/lib/" from all the library names (hey, with multiarch you
can't be too sure anymore)
- added glFinish to glesfuncs.h
- changed the eglGetProcAddress arg type to "const char *" as per the EGL spec
- filled in the stubs for X11_GLES_SetSwapInterval and X11_GLES_GetSwapInterval
2012-01-08 13:31:22 -05:00
Sam Lantinga
296e78b65f Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT

This submission is aimed at making life easier for OpenGL ES capable devices
running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
running Android). SDL's Pandora support already has the neccesary GLES-to-X11
glue code, however it's all ghetto'd off in Makefile.pandora and not very
flexible.

The patch:
- adds an awesome --enable-video-opengles option to configure
- re-modifies the opengles and opengles2 SDL_renderers to use function pointers
- no idea why this was removed?
- for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
libGLESv2 at runtime
- links in libEGL.so at runtime - the old code made an assumption that
eglFunctions could be pulled from the active GLES library, PowerVR for one
doesn't let you do that with their libGLESv2
- allows you to pick which of GLES v1 or v2 to load via
SDL_GL_CONTEXT_MAJOR_VERSION

So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
everything that isn't those two, such as a Pandora, iOS or Android device. The
Pandora specific code should be kept intact (fingers crossed), and nothing
painfully drastic has been added to the SDL_renderers. The library loading
sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
propensity to let developers get away with murder and PowerVR's alternative of
punishing every missed step.

The test apps work okay with GLES or GLES2 as the renderer. For some reason
alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
those. Also, this patch adds things to configure.in, include/SDL_config.h.in
and test/configure.in. I didn't know what the policy was re. committing
generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.

I think that's about everything, let me know if there's anything I've
overlooked.
2012-01-08 02:23:37 -05:00
Sam Lantinga
8bf062f32b Fixed bug 1256 - Invalid window warning in GL_CreateRenderer
Martin Gerhardy 2011-07-27 02:26:06 PDT
the window reference is lost in the GL_CreateRenderer function. The attached
patch should fix this error.

#0  SDLSystem_LogOutputFunction (userdata=0x63b010, category=1,
priority=SDL_LOG_PRIORITY_ERROR, message=0x7fffffffcd00 "Invalid window") at
src/system/sdl/SDLSystem.cpp:8
#1  0x00007ffff7b1ddb3 in SDL_LogMessageV (category=1,
priority=SDL_LOG_PRIORITY_ERROR, fmt=<value optimized out>, ap=<value optimized
out>) at src/SDL_log.c:275
#2  0x00007ffff7b1df7c in SDL_LogError (category=<value optimized out>,
fmt=<value optimized out>) at src/SDL_log.c:212
#3  0x00007ffff7b1d582 in SDL_SetError (fmt=0x7ffff7baaff0 "") at
src/SDL_error.c:111
#4  0x00007ffff7b96f9e in SDL_GL_MakeCurrent (window=0x0, ctx=0xa62ce0) at
src/video/SDL_video.c:2484
#5  0x00007ffff7b4ba0c in GL_ActivateRenderer (renderer=0xa8f680) at
src/render/opengl/SDL_render_gl.c:195
#6  0x00007ffff7b4c59a in GL_ResetState (window=0x918010, flags=<value
optimized out>) at src/render/opengl/SDL_render_gl.c:214
#7  GL_CreateRenderer (window=0x918010, flags=<value optimized out>) at
src/render/opengl/SDL_render_gl.c:343
#8  0x00007ffff7b48053 in SDL_CreateRenderer (window=0x918010, index=<value
optimized out>, flags=2) at src/render/SDL_render.c:166
2012-01-07 02:32:08 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
97ae2354eb Fixed issues closing lines with the OpenGL ES renderer. 2011-11-10 00:22:44 -05:00
Sam Lantinga
a6adb03997 Fixed an offset issue with glDrawTexiOES() when the viewport is set. 2011-11-10 00:22:01 -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
e112859e94 This code works for OpenGL ES 1.1 as well! :) 2011-10-31 03:06:32 -04:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
b547542f70 The scale mode is per texture, not per texture unit. 2011-03-21 17:15:49 -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
ce2aa2ee1d Zero streaming textures at the driver level 2011-02-26 21:39:34 -08:00
Sam Lantinga
ee61cc3170 Added OpenGL state caching for decent speed improvement. 2011-02-19 21:51:21 -08:00
Sam Lantinga
ea8037a625 Implemented OpenGL ES RenderClear() 2011-02-17 02:23:48 -08:00
Sam Lantinga
b411d9fc24 Fixed crash when drawing non-textured primitives 2011-02-17 02:16:30 -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
93ab733085 Fixed bug #1117
There's a new event that's always sent when the window changes size, and that event is what the renderers listen for to determine if they need to rebind their context.
2011-02-12 19:02:14 -08:00
Sam Lantinga
e5803d148c Happy 2011! :) 2011-02-11 22:37:15 -08:00
Sam Lantinga
9560b718a2 Mostly fixed fullscreen mode on Mac OS X, and you can toggle it on and off.
There are still some problems with the ConvertNSRect() calculations when switching video modes, which causes wierd window positioning issues, and the fullscreen window is still minimized on exit.
2011-02-11 00:25:44 -08:00
Sam Lantinga
e455951633 Reduce duplicated code in the texture update code paths 2011-02-08 10:38:12 -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
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
58e9ea986f Fixed building on Android, added SDL_opengles2.h, removed unnecessary SDL_glesfuncs.h
--HG--
rename : src/video/SDL_glfuncs.h => src/render/opengl/SDL_glfuncs.h
2011-02-06 02:35:14 -08:00
Sam Lantinga
cc1f36b7dc Minor consistency cleanup and documentation link update. 2011-02-06 00:48:41 -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
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/opengles/SDL_renderer_gles.c (Browse further)