Commit Graph

1925 Commits

Author SHA1 Message Date
Sam Lantinga
a2258f8fb8 Added clipping for render copy 2008-12-23 01:28:06 +00:00
Sam Lantinga
7ba47374bc /* FIXME FIXME FIXME
* Window creation fails in the colormap code on DirectColor visuals:
 *      XA_RGB_BEST_MAP not found and could not be created
 * I'm disabling this for now until Bob can look at it.  We don't need
 * it until we implement the gamma fading using DirectColor RGB ramps
 */
2008-12-22 04:58:35 +00:00
Sam Lantinga
6000a35a70 Fixed crash when resizing the window with the software renderer.
This is similar to the crash fix in the OpenGL renderer in revision 4187
2008-12-22 04:52:43 +00:00
Sam Lantinga
8adb14536f Fixed clip_rect when drawing points and lines with software renderer.
Lock the minimal rect to minimize texture uploads
2008-12-21 20:17:41 +00:00
Sam Lantinga
77fa0d11ee Working Bresenham line drawing algorithm. We can optimize later, if needed. 2008-12-21 20:16:21 +00:00
Sam Lantinga
8318ef98b6 Added RenderPiont() API
Merged the drawing tests into a single test program
2008-12-21 17:39:41 +00:00
Sam Lantinga
4890f640e1 Make it possible to switch algorithms in the future 2008-12-21 08:59:56 +00:00
Sam Lantinga
5f5a1e9537 Added ARGB optimized case for Mac OS X 2008-12-21 08:55:06 +00:00
Sam Lantinga
32cdac94f1 Share code between fill and line drawing
Added general RGB surface format fallbacks to drawing code
Fixed issues with destination surface alpha channel
2008-12-21 08:28:25 +00:00
Sam Lantinga
a4fed15d99 Date: Sat, 20 Dec 2008 23:25:19 +0100
From: Couriersud
Subject: 32 & 16 bit versions of blendrect and blendline

attached are 32, 16 and 15 bit versions of the blendrect and blendline
functionality. There was an issue with the bresenham alg. in drawline
which I also fixed.
2008-12-20 23:19:20 +00:00
Sam Lantinga
b5201d604f Added missing return 2008-12-20 18:56:35 +00:00
Sam Lantinga
be0e05d990 Turn on line antialiasing (requires blending to be enabled) 2008-12-20 18:40:30 +00:00
Sam Lantinga
40274d476d indent 2008-12-20 13:55:45 +00:00
Sam Lantinga
04239d1026 Placeholder for line drawing algorithm (current code doesn't work) 2008-12-20 13:54:19 +00:00
Sam Lantinga
b9692e08c9 Fixed crash in software line drawing 2008-12-20 13:53:54 +00:00
Sam Lantinga
f2c09059c1 Added stubs for software implementations of blending fills and line drawing 2008-12-20 13:14:28 +00:00
Sam Lantinga
ad3074b376 indent 2008-12-20 12:32:25 +00:00
Sam Lantinga
94e70de686 Date: Fri, 19 Dec 2008 20:17:35 +0100
From: Couriersud
Subject: Re: Aw: Experience using SDL1.3 in sdlmame/Proposal for api additions

> For consistency you'd probably want:
> SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
> SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode);
> SDL_RenderLine(int x1, int y1, int x2, int y2);
> SDL_RenderFill(SDL_Rect *rect);
>
> You probably also want to add API functions query the current state.
>

I have implemented the above api for the opengl, x11, directfb and
software renderers. I have also renamed *TEXTUREBLENDMODE* constants to
BLENDMODE*. The unix build compiles. The windows renderer still needs to
be updated, but I have no windows development machine at hand. Have a
look at the x11 renderer for a sample.

Vector games now run at 90% both on opengl and directfb in comparison to
sdlmame's own opengl renderer. The same applies to raster games.

The diff also includes

a) Changed XDrawRect to XFillRect in x11 renderer
b) A number of changes to fix blending and modulation issues in the
directfb renderer.
2008-12-20 12:00:00 +00:00
Sam Lantinga
daf038ecc4 indent 2008-12-20 08:41:05 +00:00
Sam Lantinga
a74cf87942 Fixed crash when resizing YUV textures 2008-12-20 06:46:37 +00:00
Ryan C. Gordon
e0728d1927 More resampling fixes. 2008-12-19 09:15:59 +00:00
Ryan C. Gordon
29777ee64b Allocate SDL_AudioCVT::coeff before using it.
FIXME: this is a memory leak. We don't have an SDL_FreeAudioCVT() yet.
2008-12-19 08:30:26 +00:00
Ryan C. Gordon
809690101a Use SDL_zerop instead of SDL_memset. 2008-12-19 06:43:41 +00:00
Ryan C. Gordon
59c33d9a0b Zero out SDL_AudioCVT struct before using it, to ensure it's all initialized. 2008-12-19 06:01:03 +00:00
Sam Lantinga
2dd3c64cfe indent 2008-12-17 07:19:55 +00:00
Sam Lantinga
5d10dfeab6 * Implemented X11 fullscreen input grab
* Progress towards being able to toggle in and out of fullscreen mode
2008-12-17 07:17:54 +00:00
Sam Lantinga
1e0de4517d indent 2008-12-16 17:44:10 +00:00
Sam Lantinga
e983f2162d Progress on fullscreen mode switching on X11 2008-12-16 17:41:03 +00:00
Sam Lantinga
9ad4a87532 Use the desktop format instead of an arbitrary one. 2008-12-16 17:40:30 +00:00
Sam Lantinga
e7f3d9dc3e The X11 window and all pixmaps and images share the same visual and depth. 2008-12-14 04:36:32 +00:00
Sam Lantinga
b0a80e17f6 Whoops, the X11 driver doesn't support fullscreen modes (yet) 2008-12-13 13:30:11 +00:00
Sam Lantinga
d46fe961f6 Fixed BadMatch error in X11 renderer 2008-12-13 13:10:53 +00:00
Sam Lantinga
c5a8886195 Fixed SDL 1.2 compatibility problem.
The API specifies that SDL_OpenAudio() will fill out the 'desired' audio spec
with the correct samples and size set by the driver.  This value is important
since it may be used by applications that size audio buffers, etc.

However, we want to allow advanced applications to call SDL_OpenAudioDevice()
which gets passed a const 'desired' parameter, and have the correct data filled
into the 'obtained' parameter, possibly allowing or not allowing format changes.

So... 'obtained' becomes the audio format the user callback is expected to use,
and we add flags to allow the application to specify which format changes are
allowed.

Note: We really need to add a way to query the 'obtained' audio spec.
2008-12-13 06:36:47 +00:00
Sam Lantinga
b252c87d35 indent 2008-12-13 06:27:58 +00:00
Edgar Simo
409cae2c08 Some error checking when destroying the HelperWindow. 2008-12-12 15:51:57 +00:00
Sam Lantinga
369350caa0 Added current_w and current_h to SDL_VideoInfo for SDL 1.2 compatibility 2008-12-12 06:46:20 +00:00
Sam Lantinga
57af796d2c Date: Sun, 07 Dec 2008 13:35:23 +0100
From: Couriersud
Subject: SDL: Mouse last_x, last_y into SDL_Mouse

the attached diff moves the static vars last_x and last_y into
SDL_Mouse. These, as far as I understand it, should be tied to the
individual mouse.

The patch also makes the code check for out of window conditions of
mouse->x,y when relative movements are passed to MouseSendMotion.

Also attached is the latest DirectFB code (dfb20081208) supporting
multiple mice and keyboards. This works quite well with sdlmame now. It
however needs more testing with different directfb configurations.
2008-12-08 00:52:12 +00:00
Sam Lantinga
befb0f7f42 Updated copyright date 2008-12-08 00:27:32 +00:00
Sam Lantinga
8d3aa51736 A little cleanup for SDL snapshot release 2008-12-08 00:24:15 +00:00
Sam Lantinga
15b9112374 Fixed updating the video surface when the palette changes 2008-12-07 22:48:06 +00:00
Sam Lantinga
fa3ec5263d Fixed picking blit function when RLE fails 2008-12-07 22:37:40 +00:00
Sam Lantinga
6b0a2a6894 Better default format for Mac OS X 2008-12-07 22:29:58 +00:00
Sam Lantinga
7e9c50dc26 Fixed crash in testpalette and potential crash in SDL_LoadBMP_RW() 2008-12-07 22:25:16 +00:00
Sam Lantinga
f29cdbb9b7 Whoops, fixed pitch bug after resizing a surface 2008-12-07 22:04:24 +00:00
Sam Lantinga
d7b138d966 There's no reason to add extra code to notify the mice of window size changes.
Just query the window size when we care about it. :)
2008-12-07 21:53:28 +00:00
Ryan C. Gordon
327d037f8c Comment cleanup. 2008-12-07 07:16:40 +00:00
Ryan C. Gordon
d47e969767 Don't hardcode RECT for fragment program texture targets.
Now we can generate what a given system needs when compiling the shader.
2008-12-07 07:06:34 +00:00
Sam Lantinga
90c895f436 Slight optimization of the shader, no need to scale into 0..255 2008-12-07 04:38:32 +00:00
Sam Lantinga
41b4da57d8 Added official support for GL_APPLE_ycbcr_422 and GL_MESA_ycbcr_texture 2008-12-07 04:02:23 +00:00
Sam Lantinga
7013fda70a The YCbCr texture extension works now that bytes_per_pixel() returns the
correct value for YUV textures.  Yay!

I'm still cheering for Ryan's pixel shader instead, since once it works
different shaders can handle all the YUV formats.
2008-12-06 18:37:06 +00:00
Sam Lantinga
928e9517fe Fixed the shader fragment problems using 2 byte YUV data in a 4 byte RGB
texture.  This is a total hack though.  Maybe we should be using a different
texture format?
2008-12-06 18:22:28 +00:00
Sam Lantinga
6d0e8c4900 Date: Sat, 06 Dec 2008 15:27:00 +0100
From: Couriersud
Subject: SDL: Relative mouse movements

The patch below will reenable processing of relative mouse movements.
The DirectFB drivers generates those in "grabbed" mode. These ensure,
that even in fullscreen mode relative movements are reported. SDLMAME
depends on this for games with trackballs.

Looking at the code I ask myself whether relative movements should be
handled in the drivers (x11, directfb). Both x11 and directfb are able
to report relative movements. This would leave it to the driver to use
the most appropriate method for relative movements when at the border of
a fullscreen window or being "grabbed".
2008-12-06 17:50:50 +00:00
Sam Lantinga
c1ecc11ba7 Date: Sat, 06 Dec 2008 14:54:10 +0100
From: Couriersud
Subject: SDL: DirectFB mouse patch

the attached patch (again) properly registers the mouse in the DirectFB
driver.
2008-12-06 17:46:55 +00:00
Sam Lantinga
5cd4fdcf44 The previous checkin fixes the crash, so at least we're not overrunning
the texture pixel data anymore...
2008-12-06 17:43:10 +00:00
Sam Lantinga
4bad3c66c1 Progress, maybe. :) 2008-12-06 17:41:01 +00:00
Sam Lantinga
b89eada0b9 Fixed SDL_SetAlpha compatibility function to match the documentation 2008-12-06 05:49:53 +00:00
Sam Lantinga
3d4a455ae4 Fixed bug picking blitters 2008-12-06 05:49:08 +00:00
Sam Lantinga
076b869c51 Rebind the context to the window area and update matrices when the window size changes 2008-12-06 05:23:35 +00:00
Ryan C. Gordon
30e93bfd64 Initial pixel shader support for YUV textures in the GL renderer.
This work is not complete yet!
2008-12-06 00:56:47 +00:00
Sam Lantinga
438661db5e Whoops, can't call glOrtho() repeatedly 2008-12-05 07:00:58 +00:00
Sam Lantinga
2e83d0061e The matrices have already been set, so you don't have to re-set them.
You always need to reset the viewport when activating the renderer in
case the context had been set to a different window previously.
2008-12-05 06:22:19 +00:00
Sam Lantinga
40c1f1f0df Fixed crashes when resizing video modes 2008-12-05 06:19:49 +00:00
Sam Lantinga
70b01e3704 fixed formatting 2008-12-05 06:19:09 +00:00
Sam Lantinga
18d317f4bf Allow resizing of SDL 1.2 compatibility video mode 2008-12-04 16:54:22 +00:00
Sam Lantinga
766c1e1e93 Added very slow software scaling to the X11 renderer 2008-12-03 12:10:51 +00:00
Sam Lantinga
4888e23002 If scaling isn't supported, do an unscaled copy instead of not showing anything. 2008-12-03 11:09:58 +00:00
Sam Lantinga
36bf69e934 Fixed crash on 64-bit systems 2008-12-03 06:32:04 +00:00
Sam Lantinga
e2acc39b94 Date: Tue, 02 Dec 2008 23:38:26 +0100
From: Couriersud
Subject: Re: SDL: Keyboard layout unknown

I have attached a diff which will add an additional keyboard layout to
the x11 driver. The issue arose, when I moved to ubuntu intrepid. I was
only able to map the keys available on my keyboard. The differences to
the existing keyboard was the mapping of HOME,UP,DOWN and some other
keys.

Now only one issue remains. Dead keys (e.g. ^, ` ') on european
keyboards do not generate a "scancode" event. Just a text event when the
key is composed (e.g. ?? ?? ??).
2008-12-03 04:32:24 +00:00
Sam Lantinga
f3e580a6f1 Added slow but complete blit fallback
Don't try to RLE encode surfaces that have alpha channel and alpha modulation
Don't turn on blending when converting an RGB surface to RGBA format
Do turn on blending when converting colorkey to alpha channel
2008-12-02 17:14:04 +00:00
Sam Lantinga
d100725b2c Added missing header 2008-12-02 17:10:05 +00:00
Sam Lantinga
8b0834d09f Save opaque alpha in the destination, fixes white spotlight in testalpha on Mac OS X. 2008-12-01 00:41:19 +00:00
Sam Lantinga
a4640955b9 Date: Mon, 01 Dec 2008 00:57:15 +0100
From: Couriersud
Subject: SDL : Diff for directfb driver

please find attached a diff against SVN containing the following:

- Updated README.DirectFB a bit
- Fix compile issue with debug output
- Fix display mode setting/switching for directfb >= 1.2.2
2008-12-01 00:10:49 +00:00
Sam Lantinga
fc797e6326 indent 2008-12-01 00:07:45 +00:00
Sam Lantinga
a39d3dd3dc Removed the hacky stuff for YUV OpenGL textures, since Ryan's pixel shader code
will be far superior. :)
2008-12-01 00:05:31 +00:00
Sam Lantinga
785842dc11 Finally got the right mojo for Apple's YUV texture format. 2008-12-01 00:03:51 +00:00
Sam Lantinga
2e620cd578 Fixed the list of supported YUV formats 2008-11-30 23:42:33 +00:00
Sam Lantinga
106af10068 Implemented the X11 (non-OpenGL) renderer, no alpha or scaling available. 2008-11-30 21:58:23 +00:00
Sam Lantinga
e2c90af939 Temporary fix for Mac OS X crash in textoverlay 2008-11-29 21:48:14 +00:00
Sam Lantinga
f374de5ac9 Whoops, we need this for subrect updates (testsprite) 2008-11-29 15:32:14 +00:00
Sam Lantinga
69c1e59e91 The SDL_RLEACCEL flag is respected in SDL_ConvertSurface(), per the docs.
Fixed saving BMP files of surfaces with an alpha channel.
2008-11-29 11:26:01 +00:00
Sam Lantinga
48b5552ec0 Preserve the desire for RLE acceleration 2008-11-29 10:43:50 +00:00
Sam Lantinga
09a0bb1e39 Fixed crash in glTexSubImage2D() with testoverlay on Mac OS X. 2008-11-29 06:29:33 +00:00
Sam Lantinga
3b8ca814f6 Fixed the texture format for the software fallback 2008-11-29 06:27:26 +00:00
Sam Lantinga
3d494863ce Fixed SW_SetTextureScaleMode()
Use RLE acceleration for static textures in the software renderer.
2008-11-29 00:11:35 +00:00
Sam Lantinga
83837765bd Fixed copy blit detection 2008-11-29 00:10:59 +00:00
Sam Lantinga
5dbc9e73be Added ARGB8888 destination format (used on Mac OS X) 2008-11-29 00:08:29 +00:00
Sam Lantinga
d00a2380b8 Fixed crash in testalpha. I think this was supposed to clear those bits. :) 2008-11-28 19:59:46 +00:00
Sam Lantinga
8164eb0e82 Clear the screen to actual black based on the format of the screen.
Use a better texture format for YUV overlay software fallbacks
2008-11-28 17:42:40 +00:00
Sam Lantinga
7ace780a57 Set the alpha mask fixing software rendering in OpenGL 2008-11-27 22:11:01 +00:00
Sam Lantinga
a3207b851b Fixed mouse coordinate range on Mac OS X 2008-11-27 21:53:18 +00:00
Sam Lantinga
74a727cda7 Date: Wed, 26 Nov 2008 19:50:31 +0100
From: Couriersud
Subject: LPGL and closed-source license / Re: [Bug 607] Texture palette not up

Permission granted to release code under both LPGL and closed-source
commercial license.

Please find attached a minor patch fixing vsync handling in the directfb
driver and containing a small update to README.directfb
2008-11-26 21:59:35 +00:00
Sam Lantinga
ef12a03dba Fixed bug #605, per Martin's suggestion 2008-11-25 20:06:27 +00:00
Sam Lantinga
eb7a0d4ec7 Updated with latest glext.h 2008-11-25 08:40:52 +00:00
Sam Lantinga
868d2ced9e It turns out both the software and the OpenGL renderer had the same problem.
According to the spec, when SDL_SRCALPHA is set, the colorkey is ignored, so
we just need to convert the colorkey into the alpha channel.
2008-11-25 05:29:14 +00:00
Sam Lantinga
8f182d2156 indent 2008-11-25 02:21:53 +00:00
Sam Lantinga
5445c3f318 Fixed bug with converting colorkey surface to texture 2008-11-25 02:12:19 +00:00
Sam Lantinga
b0b75884f3 Fixed Direct3D rendering 2008-11-25 00:29:44 +00:00
Sam Lantinga
6a2047e7ea Added software fallback for YUV overlay code when YUV textures aren't available. 2008-11-24 23:25:36 +00:00
Sam Lantinga
1e813b5f4d Disable spurious warning 2008-11-24 21:43:02 +00:00
Sam Lantinga
825b0b08f1 Fixed Bugzilla bug #205
Removed SDL_KillThread() from the API, as it isn't safe on many platforms.
2008-11-24 00:18:42 +00:00
Sam Lantinga
93b7d9e6f8 Preliminary support for YUV textures 2008-11-22 06:59:22 +00:00
Sam Lantinga
5ea99603f1 Sort by HID usage, which makes more sense and is more cross-platform 2008-11-08 07:34:21 +00:00
Sam Lantinga
3cd42cfe35 2008-10-18 03:21:32 +00:00
Edgar Simo
ada44e87d4 Fixed compilation on mingw32. 2008-10-14 18:28:28 +00:00
Sam Lantinga
ab3c4fb876 Added missing math.h functionality for SDL_audiocvt.c 2008-10-12 16:30:42 +00:00
Sam Lantinga
24fa5e3a47 Don't include <math.h> when HAVE_MATH_H isn't defined 2008-10-12 16:21:36 +00:00
Sam Lantinga
45df39c52c This can be static 2008-10-12 16:15:43 +00:00
Sam Lantinga
94879f84f3 Fixed memory leak in raw mouse input processing.
Corrected the mouse button indices.
2008-10-12 16:05:34 +00:00
Sam Lantinga
92c3984118 Final merge of Google Summer of Code 2008 work...
Bring SDL to iPhone and iPod Touch
by Holmes Futrell, mentored by Sam Lantinga
2008-10-04 06:46:59 +00:00
Ryan C. Gordon
5b27f96366 Some cleanups on the new XInput code.
One or two things got moved around, but largely this is hooked up correctly
 in the Unix configure system now: it can be dynamically loaded and fallback
 gracefully if not available, or libXi can be directly linked to libSDL.

XInput support can be --disable'd from the configure script, too (defaults to
 enabled).

Please note that while the framework is in place to gracefully fallback, the
 current state of the source requires XInput. We'll need to adjust a few
 things still to correct this.
2008-09-17 08:20:57 +00:00
Ryan C. Gordon
83e289b238 Removed zap_ptr hack from Bugzilla #602...it was incorrect.
(The actual bug was in SDL code removed from the 1.3 codebase.)
2008-09-15 20:48:51 +00:00
Sam Lantinga
258a2014c7 Almost got this compiling on Cygwin32, just needs DirectInput 7 2008-09-15 08:41:03 +00:00
Sam Lantinga
e6e45a547d Updated Visual C++ build 2008-09-15 07:34:36 +00:00
Sam Lantinga
6dfa39cc32 more more! 2008-09-15 06:49:23 +00:00
Sam Lantinga
e384f9cb8e Yet more math... 2008-09-15 06:48:41 +00:00
Sam Lantinga
80988b9d30 Whoops, missed a file... 2008-09-15 06:46:23 +00:00
Sam Lantinga
6e802db3f0 Expanded the libm support and put it into a separate directory. 2008-09-15 06:33:23 +00:00
Sam Lantinga
b94b3e7baa 2008-09-15 05:14:11 +00:00
Ryan C. Gordon
539aad42ea Merged r4087:4088 from branches/SDL-1.2: missing semicolon. 2008-09-15 05:09:45 +00:00
Sam Lantinga
458f7b5b0c indent 2008-09-15 04:32:36 +00:00
Sam Lantinga
c5c81ebf59 http://sources.redhat.com/ml/newlib/2002/msg00230.html
Stephen L Moshier wrote:
>
> pow(x,y) returns 0 when x is very close to -1.0 and y is very large.
> The following test program prints
>
> pow(1.0000000000000002e+00 4.5035996273704970e+15) = 2.7182818284590455e+00
> pow(-1.0000000000000002e+00 4.5035996273704970e+15) =0.0000000000000000e+00
> pow(9.9999999999999978e-01 4.5035996273704970e+15) = 3.6787944117144222e-01
> pow(-9.9999999999999978e-01 4.5035996273704970e+15) = 0.0000000000000000e+00
>
> which is incorrect for the negative arguments raised to an odd integer
> power.
>
> -----
> double pow (double, double);
>
> int
> main ()
> {
>   double x, y, z;
>
>   x = 1.0 + pow (2.0, -52.0);
>   y = 1.0 + pow (2.0, 52.0);
>   z = pow (x, y);
>   printf ("pow(%.16e %.16e) = %.16e\n", x, y, z);
>   x = -x;
>   z = pow (x, y);
>   printf ("pow(%.16e %.16e) = %.16e\n", x, y, z);
>   x = 1.0 - pow (2.0, -52.0);
>   z = pow (x, y);
>   printf ("pow(%.16e %.16e) = %.16e\n", x, y, z);
>   x = -x;
>   z = pow (x, y);
>   printf ("pow(%.16e %.16e) = %.16e\n", x, y, z);
> }
> -----
>
> Here is a patch for newlib/libm/math/epow.c:

Patch checked in and duplicated for ef_pow.c.  Thanks.

-- Jeff J.
2008-09-15 04:31:30 +00:00
Ryan C. Gordon
3b3a1b8cdf Merged r4082:4083 from branches/SDL-1.2: sparc64 crash fix. 2008-09-08 07:38:41 +00:00
Darren Alton
242cd3897b Fixes to the NDS sprite2 test. Illustrates partially working texture-as-sprite functionality. 2008-09-06 04:31:34 +00:00
Darren Alton
6fb0102145 Initial work for NDS haptic support. 2008-09-06 00:10:16 +00:00
Holmes Futrell
916349a04f Added support for OpenGL ES renderer 2008-09-02 20:19:45 +00:00
Holmes Futrell
0de9882579 Ran GNU indent on file 2008-09-02 20:11:06 +00:00
Holmes Futrell
32c4f213db Rolling back changes to revision 4071 ... made some mistakes, will try merging work again. 2008-09-02 20:05:33 +00:00
Holmes Futrell
f69769dfa3 Added retained backing attribute, reference to UIKit renderer 2008-09-02 19:53:56 +00:00
Holmes Futrell
449f371859 This file serves a similar purpose as SDL_glfuncs.h, but for the OpenGL ES renderer. 2008-09-02 02:44:45 +00:00
Holmes Futrell
850aff64b6 Added OpenGL ES support 2008-09-02 02:27:06 +00:00
Holmes Futrell
7aae720160 These files are similar in purpose and structure as SDL_renderer_gl.c and SDL_renderer_gl.h, except they use OpenGL ES 1.1 for rendering. 2008-09-02 00:37:04 +00:00
Sam Lantinga
72d3929fca Fixed a bunch of compile warnings on Mac OS X 2008-09-01 16:04:20 +00:00
Sam Lantinga
0ddab56d41 Date: Sun, 31 Aug 2008 17:53:59 +0200
From: Couriersud
Subject: Re: Updated DirectFB driver for SDL1.3

attached is a patch which brings the directfb driver in line with
current svn. In addition:

* driver now is in line with the structure of the X11 driver.
  This adds a couple of files.
* driver now supports relative mouse movements
2008-08-31 16:04:32 +00:00
Sam Lantinga
9c4b835e49 Final merge of Google Summer of Code 2008 work...
Port SDL 1.3 to the Nintendo DS
by Darren Alton, mentored by Sam Lantinga
2008-08-27 15:10:03 +00:00
Edgar Simo
2ba47a0dc2 Fix for mingw compilation by Alam. 2008-08-26 11:50:37 +00:00
Edgar Simo
37efd9020c Missing an include. 2008-08-26 11:17:16 +00:00
Sam Lantinga
a7f2971180 Fixed Visual Studio compilation problems 2008-08-26 07:34:49 +00:00
Sam Lantinga
9c7284cdda Fixed crash when tablet isn't detected properly 2008-08-26 07:34:23 +00:00
Sam Lantinga
3b22c14a63 Dynamically load wintab32.dll 2008-08-26 06:03:48 +00:00
Sam Lantinga
ea7abca18f indent 2008-08-26 05:57:41 +00:00
Sam Lantinga
19d99d4cfc Added Wacom API headers.
FIXME: Dynamically load the Wacom API functions from wintab32.dll
2008-08-26 05:26:28 +00:00
Sam Lantinga
bfe61733da Couriersud fixed bug #603
Using the following sequence

SDL_Init(..:)
SDL_CreateWindow(..., SDL_WINDOW_OPENGL)
SDL_DestroyWindow
SDL_CreateWindow(..., SDL_WINDOW_OPENGL)

SDL will crash in X11_GL_GetVisual. This is due to the fact that
during SDL_DestroyWindow X11_GL_Shutdown was called because the last window
has been closed.

On the next call to SDL_CreateWindow the library is still loaded and only the
memory is reinitialized. Function pointers such as gl_data->glXChooseVisual
will not be reinitialized.

Consequently, SDL will crash due to a NULL pointer access.

The attached patch corrects the behaviour.
2008-08-26 02:47:26 +00:00
Sam Lantinga
38b73b01d9 indent. *sigh* 2008-08-26 02:40:24 +00:00
Sam Lantinga
0cc551f0cd Date: Sun, 20 Jul 2008 22:34:37 +0200
From: Couriersud
Subject: Updated DirectFB driver for SDL1.3

please find attached a patch for an updated directfb driver for SDL1.3.
It does now
- properly supported the new input api.
- send unicode text events
- support directfb windows
- support multiple screens
- support hardware YUV scaling for the first YUV texture created.
- support hardware scaling for textures.
- properly interpret streaming access
- support software opengl if one manages to install the mesa directfb
driver (broken/not broken in mesa svn)

Within bugzilla (http://bugzilla.libsdl.org/show_bug.cgi?id=603) there
is another patch which fixes a crash due to GL context creation.

Kind regards,

couriersud
2008-08-26 02:32:45 +00:00
Edgar Simo
f8a242d31e Merged force_feedback_branch r4042: unbuildability of dummy haptic driver with some configurations. 2008-08-25 20:51:03 +00:00
Szymon Wilczek
92d9759a5f Removed unneccesary code lines. Fixed mousename bug. Added lacking code in mousebutton 2008-08-25 18:02:14 +00:00
Edgar Simo
14e01ef127 Merge of force feedback branch r4039. 2008-08-25 17:34:58 +00:00
Sam Lantinga
a13381a54a Final merge of Google Summer of Code 2008 work...
Audio Ideas - Resampling and Pitch Shifting
by Aaron Wishnick, mentored by Ryan C. Gordon
2008-08-25 15:08:59 +00:00
Edgar Simo
4220687185 Merging another last minute fix from force feedback branch (r4036) 2008-08-25 10:14:21 +00:00
Sam Lantinga
b5ce7cc37d Merged last minute fixes from force feedback branch (r4031, r4033, r4034) 2008-08-25 10:04:06 +00:00
Sam Lantinga
a6fa308712 Final merge of Google Summer of Code 2008 work...
Force Feedback for SDL
by Edgar Simo, mentored by Ryan C. Gordon
2008-08-25 09:55:03 +00:00
Sam Lantinga
f24330df2a Fixed compile errors introduced during the merge refactoring 2008-08-25 08:50:37 +00:00
Sam Lantinga
6d8889d8e9 Added missing X1/X2 button support 2008-08-25 06:58:34 +00:00
Sam Lantinga
474cfaad1e Final merge of Google Summer of Code 2008 work...
Many-mouse and tablet support
by Szymon Wilczek, mentored by Ryan C. Gordon

Everything concerning the project is noted on the wiki:
http://wilku.ravenlord.ws/doku.php?id=start
2008-08-25 06:33:00 +00:00
Sam Lantinga
9816457898 Fixed compiler warning 2008-05-26 12:56:10 +00:00
Sam Lantinga
1a2cd9be5c Reverted revision 3416, fixing bug #589
http://bugzilla.libsdl.org/show_bug.cgi?id=589

I was going to add the current window to the OpenGL context info, but that
doesn't fix the case where you set the current context to NULL and then set
the current context to the same window it had before.

This also doesn't take into account changes to the window that might affect
the context, such as viewport changing or fullscreen/windowed mode changing.

Any ideas?
2008-05-26 12:43:37 +00:00
Bob Pendleton
97f034bc79 ran make indent 2008-03-14 20:43:44 +00:00
Bob Pendleton
b6e476a69b re: bug#563. checking in some commented out trace code and a fix so that the in testalpha.c the background only flashes when alpha == 255. The problem that is being
fixed is caused by clearing SDL_COPY_RLE_COLORKEY without setting SDL_COPY_RLE_DESIRED in SDL_UnRELSurface.
2008-03-14 18:17:49 +00:00
Bob Pendleton
98acd1149c In testdyngl.c the event type was being anded (&) with SDL_KEYDOWN and if the result was none zero the program was quiting. This is very weird because it was
working earlier this week.

I added some more trace code to SDL_x11events.c

In SDL_X11opengl.c I modified SDL_GL_GetSwapInterval() so that it returns a pretty good value even if you have the SGI swap extension instead of the MESA swap
extension. I just saved the value you set and return it too you.
2008-03-07 23:57:15 +00:00
Bob Pendleton
1f0470ba8c oops, need to comment out some debug code. 2008-03-07 21:01:54 +00:00
Bob Pendleton
4534dabb7e Next version of internationalized input for X11. On my machine (famous last words :-) with a US English keyboard and locale I can compose ` and e and get a text
input event with the character è. You still get the keypress keyrelease events for the individual keys that go into composing the character.
2008-03-07 20:54:11 +00:00
Bob Pendleton
617e50c933 more valgrind errors fixed. Plus I ran make indent which changed a few files. 2008-03-07 17:20:37 +00:00
Bob Pendleton
2a40813ab2 Fixed many valgrind errors. But, I broke testdyngl. 2008-03-06 23:07:02 +00:00
Bob Pendleton
692da065af Fixing valgrind errors.
One of the error was the result of an unitended recursive call to X11_GL_LoadLibrary which was also fixed.
2008-03-06 17:08:10 +00:00
Bob Pendleton
95efd075f2 SetupWindowData in SDL_X11window.c was realloc()ing the display window list and incrementing numwindows even though those are being updated in functions that call
this function. The result is that it is possible to get the same window added to the list twice.
2008-03-04 23:09:28 +00:00
Bob Pendleton
1db7dfa3d2 Deleted a call to X__PumpEvents at the end of X11_GL_InitExtensions(). This function is being called from SDL_RecreateWindow at a point when the numwindows value in
is incorrect. The result is that an illegal access is being made in X_PumpEvents when it tries to look up the windows ID of the source of an event. Taking out that
call does not seem to have any effect on the testgl. But, I would be happy if someone else took a look at this problem and found a fix higher up the stack.
2008-03-01 20:34:36 +00:00
Sam Lantinga
990676f5c4 Windows also remaps the numeric keypad... grrr 2008-02-11 21:06:32 +00:00
Sam Lantinga
03eda66f37 Added support for keypad enter 2008-02-10 05:34:33 +00:00
Sam Lantinga
d4c23af239 Updated Visual C++ project 2008-02-10 05:14:28 +00:00
Sam Lantinga
8df4fc4ae5 Friggin' Windows remaps alphabetic keys based on keyboard layout.
We try to figure out what the actual layout independent values are.
2008-02-09 22:28:27 +00:00
Sam Lantinga
dc6eb861a5 Undo keyboard layout based alphabetic key mapping. Grr.... HACK HACK HACK... 2008-02-09 07:18:38 +00:00
Sam Lantinga
7c23e86a0d Implemented text input event for Win32 2008-02-09 06:47:46 +00:00
Sam Lantinga
d92958c0e5 Untested Win32 keyboard scancode code. 2008-02-08 08:35:49 +00:00
Sam Lantinga
27fce8ebae Fixed array overrun 2008-02-07 16:14:43 +00:00
Sam Lantinga
0e59c9db53 Fixed compile errors 2008-02-07 16:00:29 +00:00
Sam Lantinga
37131333be First pass of new SDL scancode concept for X11. 2008-02-07 15:31:09 +00:00
Sam Lantinga
80a950c3db Christian's comment:
/* Actually returns a UInt32 containing two character codes (and two 'reserved' bytes), but we're only interested in the second (or only) one */
2008-02-05 07:30:50 +00:00
Sam Lantinga
0f9d544f5e First pass implementation of new SDL scancode concept, as discussed with
Christian Walther.  Currently only implemented on Mac OS X for sanity
checking purposes.
2008-02-05 07:19:23 +00:00
Bob Pendleton
16c4fcc95c Minimal implementation of textinput events for x11. It only works for latin-1. 2008-01-15 22:37:17 +00:00
Bob Pendleton
4a1d83aef7 Enabled key board auto repeat in X11_InitKeyboard.c. Had to add a couple of new Xlib symbols. 2008-01-12 18:07:06 +00:00
Bob Pendleton
06920df50f one more time... I must be brain dead... 2008-01-12 16:56:42 +00:00
Bob Pendleton
1129c73ed3 More typos 2008-01-12 16:53:30 +00:00
Bob Pendleton
bd12ee97bd Fixed some typos in SDL_x11keyboard.c 2008-01-09 23:40:56 +00:00
Bob Pendleton
e065abc334 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob. 2008-01-08 00:10:46 +00:00
Sam Lantinga
2f7fd42403 Christian Walther fixed bug #529 2007-12-29 22:15:39 +00:00
Sam Lantinga
9e2c55b30c Merged fix for bug #508 from SDL 1.2 revision 3495 2007-12-29 21:36:17 +00:00
Sam Lantinga
67aa85911e Fixed bug #478
Take the min and max values into account.
2007-12-29 19:45:09 +00:00
Sam Lantinga
4a989076f7 Merged fix for bug #503 from SDL 1.2 revision 3487 2007-12-29 19:29:20 +00:00
Sam Lantinga
6ca8994f51 Fixed bug #497
Check all joysticks instead of stopping if one has been removed.
2007-12-29 06:17:31 +00:00
Sam Lantinga
a4fa98c9b0 Fixed bug #464
Added X1/X2 button constants
2007-12-29 06:09:25 +00:00
Sam Lantinga
fef51d48dc Date: Wed, 14 Nov 2007 22:20:27 -0500
From: Calvin Vette
Subject: Fix to compile SDL-1.2 SVN on OS X Leopard

I found I needed to add a conditional check for Leopard to compile
cleanly on 1.2-SVN (20071114):

#include <AudioUnit/AudioUnit.h>
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
#include <AudioUnit/AUNTComponent.h>
#endif

where there is now just:
#include <AudioUnit/AudioUnit.h>
2007-12-28 18:16:42 +00:00
Sam Lantinga
a594a0739d Merged changeset 3463 from SDL 1.2, fixed compile error with Intel compiler. 2007-12-28 18:08:43 +00:00
Sam Lantinga
4f2f07efff Split out the SDL_rect and SDL_surface functions into their own headers.
Removed unused count from the dirty rect list.
2007-09-10 12:20:02 +00:00
Sam Lantinga
1e891ee4f2 indent 2007-09-10 12:11:40 +00:00
Sam Lantinga
6b567a2fb0 Fixed bug #471 2007-08-21 06:54:07 +00:00
Ryan C. Gordon
8446fb5976 Minor PulseAudio fixes: corrected OpenDevice return code, human-readable
error messages if connction to daemon fails.
2007-08-20 02:08:37 +00:00
Ryan C. Gordon
76eb0e6b90 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Fixes Bugzilla #439.
2007-08-20 01:02:37 +00:00
Sam Lantinga
bd3f5173f5 Date: Sun, 19 Aug 2007 18:29:28 +0200
From: Christian Walther
Subject: Re: SDL 1.3 keyboard plan

> 2007-08-18 19:15:51.454 checkkeys[5795] *** _NSAutoreleaseNoPool():
> Object 0x532750 of class NSSelectionArray autoreleased with no pool
> in place - just leaking

This is fixed by the attached patch.
2007-08-19 16:36:51 +00:00
Sam Lantinga
c84ff85475 Whoops, missing file... 2007-08-19 16:35:44 +00:00
Sam Lantinga
7b145f5ad0 Date: Thu, 05 Jul 2007 14:02:33 -0700
From: Sam Lantinga
Subject: SDL 1.3 keyboard plan

After lots of discussion with Christian, this is what we came up with:

> So, to sum up...
> SDLK_* become the physical keys, starting at > (1<<21)
> We create a macro SDLK_INDEX(X)
> We have two functions SDL_GetLayoutKey(SDLKey) and SDL_GetKeyName()
> SDL_GetLayoutKey maps to UCS4 for printable characters, and SDLK* for
  non-printable characters
> and does so based on the OS's current keyboard layout
> SDL_GetKeyName() handles both SDLK_* and UCS4, converting UCS4 to UTF-8 and
  converting SDLK_* into our names, which are UTF-8 for printable characters.
> WASD folks use SDLK_*, and 'I' folks use SDL_GetLayoutKey(SDLK_*)

Here is the patch he came up with, and his e-mail about it:

Date: Fri, 17 Aug 2007 19:50:28 +0200
From: Christian Walther
Subject: Re: SDL 1.3 keyboard plan

> Sounds great, go ahead and send me a patch.

Here goes! Thanks for having a look. Don't hesitate to comment if
anything does not conform to your ideas.

One caveat: Committing this now may break compilability of some video
drivers - specifically, if they use any of the SDLK_* codes that were
obsoleted and moved into SDL_compat.h. I only tried Cocoa (which did
break, but is already fixed) and X11 (which didn't, but then its key
handling is #iffed out). If that's a problem, it may need to go into
a branch.

  -Christian
2007-08-19 14:52:52 +00:00
Sam Lantinga
b9d3d66bfb Okay, still some bugs, but everything builds again... 2007-08-18 05:39:09 +00:00
Sam Lantinga
73cc09fedb More work in progress integrating SDL_Surface and the new SDL_Texture API 2007-08-18 01:44:21 +00:00
Sam Lantinga
59d6059cae More work in progress... 2007-08-17 06:58:20 +00:00
Sam Lantinga
7f03398faa More work in progress, still doesn't compile... 2007-08-17 06:40:12 +00:00
Sam Lantinga
82908c483c Work in progress: merging new texture features into SDL blit system 2007-08-17 06:21:58 +00:00
Sam Lantinga
d5d655cc43 Enabled 3DNow! intrinsic support 2007-08-17 03:22:03 +00:00
Sam Lantinga
c120eaf9e4 indent 2007-08-17 02:55:21 +00:00
Sam Lantinga
a4e5bc25cc Date: Fri, 17 Aug 2007 01:12:31 +0200
From: Couriersud
Subject: fix for audio dsp exit crash / various dfb issues

improved cursor handling
fixes some mouse and event related bugs
2007-08-17 02:54:50 +00:00
Sam Lantinga
785b4a61c3 Date: Fri, 17 Aug 2007 01:12:31 +0200
From: Couriersud
Subject: fix for audio dsp exit crash / various dfb issues

The current code will crash on exiting an application. The attached diff
fixes the issue.
2007-08-17 02:54:12 +00:00
Sam Lantinga
65b59716be Moved the colorkey and per-surface alpha into the blit info,
in preparation for support for general color channel modulation.

Removed and consolidated some data in the blit info.
2007-08-17 00:54:53 +00:00
Sam Lantinga
367092a182 Getting ready to add slow blitters. Everyone will love me. :) 2007-08-16 22:56:18 +00:00
Sam Lantinga
a35d8c5da8 Use MMX intrinsics over GCC inline assembly 2007-08-16 22:18:53 +00:00
Sam Lantinga
47dfad08cc Oops, didn't want to rename those files... 2007-08-16 21:54:26 +00:00
Sam Lantinga
bcce9c56b0 Added notes on the next steps for SDL 1.3
Moved fill and copy routines to their own files.
2007-08-16 21:43:19 +00:00
Sam Lantinga
16c1080593 Removed unnecessary header (SDL_blit.h has SDL_cpuinfo.h) 2007-08-16 06:40:34 +00:00
Sam Lantinga
fd5ae1f46d SSE and MMX intrinsics work with Visual Studio now... 2007-08-16 06:37:22 +00:00
Sam Lantinga
b886cc3b5c Fixed a few compiler warnings.
Added SDL_blit_copy.c to the Visual C++ project

The SSE and MMX intrinsics don't compile on Visual Studio yet...
2007-08-16 06:20:51 +00:00
Sam Lantinga
65d361b41b Added SSE and MMX optimization for SDL_FillRect() 2007-08-16 05:56:24 +00:00
Sam Lantinga
f1b05ff63b Okay, I figured out the intrinsics for SIMD memcpy 2007-08-16 02:14:13 +00:00
Sam Lantinga
fc16af50b2 Removed hermes since it's LGPL and not compatible with a commercial license.
Prepping for using MMX and SSE intrinsics instead of inline assembly.
.. except for memcpy equivalents which only get faster if they can
   exploit the parallelism of loading into multiple SIMD registers. :)
2007-08-15 08:21:10 +00:00
Sam Lantinga
377c3990ba Added code to enable multi-threaded OpenGL on Mac OS X, pending Ryan's PBO/VBO
changes.
2007-08-15 04:04:17 +00:00
Sam Lantinga
45891d1d50 Optimization suggested by Ryan:
Don't set the same OpenGL context multiple times
2007-08-15 03:52:31 +00:00
Sam Lantinga
47455281fd indent 2007-08-15 03:50:49 +00:00
Sam Lantinga
1b7386279e Date: Wed, 15 Aug 2007 01:08:38 +0200
From: Couriersud
Subject: Some SDL1.3 patches

LoadLibrary will call X11_GL_Initialize. If LoadLibrary is called before
a window is created, it will crash since structures are not properly set
up.
2007-08-15 03:34:14 +00:00
Sam Lantinga
0fe1784459 Date: Wed, 15 Aug 2007 01:08:38 +0200
From: Couriersud
Subject: Some SDL1.3 patches

Modified UpdateTexture to lock and unlock DirectFB-Surface.
2007-08-15 03:19:21 +00:00
Sam Lantinga
74a291769a Fixed crash setting 0 bpp video mode. 2007-08-15 03:18:24 +00:00
Sam Lantinga
0c2f549390 Added SSE version of SDL_FillRect() for 32-bit ARGB surfaces 2007-08-13 06:24:56 +00:00
Sam Lantinga
cfd7794fec Advertise the most efficient format for the screen. Of course SDL code needs
to be fixed to handle framebuffers with alpha...
2007-08-13 02:38:59 +00:00
Sam Lantinga
2d2be66919 This is byte order dependent. 2007-08-12 18:53:51 +00:00
Sam Lantinga
1de747845b indent 2007-08-12 18:44:49 +00:00
Sam Lantinga
f2c7446b24 Gained 5 FPS in testsprite because Mac OS X memset is highly optimized 2007-08-12 18:27:44 +00:00
Sam Lantinga
6d8a22e975 Test using glTextureRangeAPPLE
This actually ends up being quite a bit slower on my MacBook, but I'm
checking it in to test on a PPC iMac.

Maybe someone knows why it's slower?
2007-08-12 16:53:58 +00:00
Sam Lantinga
49204a8cdd indent 2007-08-12 16:26:10 +00:00
Sam Lantinga
61ed776db3 Fixed compiling the Altivec blit code 2007-08-12 15:41:36 +00:00
Sam Lantinga
dbb114bdf1 Optimized OpenGL renderer for Mac OS X.
The SDL 1.2 API version of testsprite went from 120 FPS to 320 FPS. :)
2007-08-12 07:02:28 +00:00
Sam Lantinga
6a45ac924c Fixed crash if conversion fails. Use ISO name for Latin-1 2007-08-12 05:48:51 +00:00
Sam Lantinga
e9aa9188bf Fixed compile warnings with Visual C++ 2007-08-12 00:01:41 +00:00
Sam Lantinga
ed767d84cc Exported the software renderer texture functions to make easier to create
a renderer based on a framebuffer.

Fixed an initialization bug with the dummy video display mode.
2007-08-11 23:26:03 +00:00
Sam Lantinga
0693d77922 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
From: couriersud arcor.de
To: slouken@libsdl.org
Subject: Directfb driver for SDL1.3

Hi,

the attachment contains a patch for a SDL1.3 directfb driver. It supports:

- Renderer "directfb":

Hardware acceleration as supported by the underlying directfb driver. With a
radeon X850, testsprite2 runs at 50% to 70% of OpenGL (X11, dri) performance.

Also supports hardware accelerated yuv overlays. This must be enabled by sett
ing:

export SDL_DIRECTFB_YUV_DIRECT=1

- Renderer "opengl"

Supports software opengl using mesa opengl (make linux-directfb).

Some more information may be found in README.DirectFB

There will certainly still be some bugs, and there is some debug code around.
 When I find some time, I will compile against directfb-0.9.25 as distributed
 with ubuntu 7.04.

The diff also contains a fix for SDL_LockYUVOverlay fixing a bug in  *pixels
and pitches initialization.

Kind regards,

couriersud
2007-08-11 21:51:19 +00:00
Sam Lantinga
8a6126e90d Whoops, it's not quite that easy - fixed bug in SDL_ClearDirtyRects() 2007-08-11 21:42:36 +00:00
Sam Lantinga
ebe7769ae3 Optimized dirty rect code 2007-08-11 21:34:08 +00:00
Sam Lantinga
16792e5ed3 Emphasized the separation between SDL_Surface and SDL_Texture
- SDL_Surface is a system memory representation of pixel data
 - SDL_Texture is a video memory representation of pixel data

The concept of SDL_Surface with SDL_HWSURFACE is no longer used.

Separated SDL_Texture types by usage rather than memory type
 - SDL_TEXTUREACCESS_STATIC is for rarely changed pixel data,
   can be placed in video memory.
 - SDL_TEXTUREACCESS_STREAMING is for frequently changing pixel
   data, usually placed in system memory or AGP memory.

Optimized the SDL_compat usage of the OpenGL renderer by only
using one copy of the framebuffer instead of two.
2007-08-11 20:54:31 +00:00
Sam Lantinga
ecf8db2e86 indent 2007-08-11 20:46:24 +00:00
Bob Pendleton
45238ff004 changed to use SDL_realloc() 2007-07-26 17:58:17 +00:00
Bob Pendleton
5f14f00c25 Added gamma table support to X11. Also now supports DirectColor visuals. 2007-07-25 21:22:55 +00:00
Bob Pendleton
624a1851eb make indent 2007-07-24 18:46:45 +00:00
Sam Lantinga
686b4969d1 Switched afxres.h to winresrc.h 2007-07-23 18:46:09 +00:00
Bob Pendleton
3d7eee3429 Oops, meant PsuedoColor not TrueColor 2007-07-23 16:55:38 +00:00
Sam Lantinga
958f927c3d indent 2007-07-23 01:17:38 +00:00
Sam Lantinga
4c2ff36986 Added support for building version.rc in Windows build. 2007-07-16 03:28:48 +00:00