Commit graph

4209 commits

Author SHA1 Message Date
Sam Lantinga
e5f6375640 Removed old test 2011-03-07 09:35:01 -08:00
Sam Lantinga
0469477aa9 Fixed compile error 2011-03-07 09:25:42 -08:00
Sam Lantinga
1c83266beb Removed the NDS hack for ARGB1555 surfaces, since it's a general problem; added full color expansion for 16 bpp packed pixels. 2011-03-07 01:34:38 -08:00
Sam Lantinga
e43f8d8003 Fixed bitmap order interpretation; SDL defaults to MSB ordering so a bitstream corresponds to a pixel stream.
The bitmap ordering is defined such that the numbering refers to the pixel index from left to right, and the number position refers to the bit position in the byte.

SDL_BITMAPORDER_4321 is the fourth pixel at the high bit and the first pixel at the low bit (LSBFirst)

SDL_BITMAPORDER_1234 is the first pixel at the high bit and the fourth pixel at the low bit (MSBFirst)
2011-03-07 00:30:05 -08:00
Sam Lantinga
2bea0e636f We explicitly don't know how to handle 1 and 4 bpp pixel formats. 2011-03-07 00:08:23 -08:00
Sam Lantinga
2d5640cc96 Fixed memory corruption with invalid pixel values. 2011-03-06 23:56:23 -08:00
Sam Lantinga
b2ad2a405c Fixed up structure to match header, added missing Aloss 2011-03-06 23:54:50 -08:00
Sam Lantinga
4c1a08f150 Added padding for better aligned access to *shift/*loss members 2011-03-06 23:54:20 -08:00
Sam Lantinga
d8392622bb Better error reporting in allocating a pixel format. 2011-03-06 21:49:52 -08:00
Sam Lantinga
a1ac5f42e0 Fixed garbage trying to create a FourCC pixel format. 2011-03-06 21:47:48 -08:00
Sam Lantinga
61b11f87da Fixed initializing pixel format for indexed formats 2011-03-06 21:34:45 -08:00
Sam Lantinga
d60c96a568 You need libfat for the filesystem code. 2011-03-06 21:19:53 -08:00
Sam Lantinga
387ca6c6cb Only compile the NDS renderer if specified in the config file. 2011-03-06 21:19:02 -08:00
Sam Lantinga
f0d94b59fb A better way of setting the fullscreen flag for windows on Nintendo DS 2011-03-06 21:18:36 -08:00
Sam Lantinga
ac662b8421 Fixed compiler warning 2011-03-06 21:17:44 -08:00
Sam Lantinga
924f55eebe Fixed compiler warnings 2011-03-06 21:17:09 -08:00
Sam Lantinga
253835bdd2 Fixed compiler warning 2011-03-06 21:15:46 -08:00
Sam Lantinga
a1dfcdb79d Fixed compiler warning 2011-03-06 21:15:28 -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
0a92449744 The Xext directory no longer exists 2011-03-05 10:03:57 -08:00
Sam Lantinga
2368a3301a Added support for Windows cursors 2011-02-28 23:50:32 -08:00
Sam Lantinga
4b86de315f Fixed warning on Windows 2011-02-28 23:50:07 -08:00
Sam Lantinga
0f59f2fdbb Fixed memory leak freeing cursors 2011-02-28 22:21:32 -08:00
Sam Lantinga
8457ab1e62 You can use SDL_ConvertSurfaceFormat() now
Also, icon is guaranteed not to be NULL going into this function.
2011-02-28 21:58:37 -08:00
Sam Lantinga
5b710cfee4 Oh yeah, we're using extern 2011-02-28 21:48:02 -08:00
Sam Lantinga
10c875b184 Fullscreen doesn't automatically grab the cursor. 2011-02-28 20:19:28 -08:00
Sam Lantinga
9053cfa4cc Removed extra NoStdio configuration 2011-02-28 20:16:12 -08:00
Sam Lantinga
ddb28aeb49 Removed duplicate assignment 2011-02-28 18:03:14 -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
05b0c40ffa Fixed setting draw color for clear 2011-02-28 09:26:35 -08:00
Sam Lantinga
6053ae5234 OSF isn't supported anymore. 2011-02-28 09:09:13 -08:00
Sam Lantinga
303287a180 IRIX is not supported anymore. :) 2011-02-28 09:06:29 -08:00
Sam Lantinga
8706244c39 SDL_revision.h is always updated as part of the build process now. 2011-02-28 09:06:15 -08:00
Sam Lantinga
73b501d88c Dynamically load the Xinerama and xf86vmode extensions
This fixes a few bugs with different distributions:
http://bugs.freedesktop.org/show_bug.cgi?id=17431
http://bugs.gentoo.org/show_bug.cgi?id=246177
2011-02-28 09:01:53 -08:00
Sam Lantinga
e32b25be9e Fixed compiling AltiVec blitters 2011-02-27 22:22:58 -08:00
Sam Lantinga
cde0d1bc03 Implemented mouse relative mode on Mac OS X. 2011-02-27 22:06:46 -08:00
Sam Lantinga
9959455aee Added a cleaner way to set the default cursor.
Added a way to cycle through the default cursor in testcursor.c
2011-02-27 21:36:23 -08:00
Sam Lantinga
99de5726b1 Fixed minimizing fullscreen windows.
Removed misleading hide/unhide Cocoa notifications.
We have no way of knowing when a Cocoa window is maximized and then restored (right?)
Disabled spamy mouse motion events by default.
2011-02-27 21:17:06 -08:00
Sam Lantinga
ade868c17f Use boolean value for input grab mode, like we do for fullscreen mode. 2011-02-27 20:06:45 -08:00
Sam Lantinga
ce2aa2ee1d Zero streaming textures at the driver level 2011-02-26 21:39:34 -08:00
Sam Lantinga
c506aacb3a Fix fullscreen origin on Mac OS X 10.4 2011-02-26 11:59:33 -08:00
Sam Lantinga
3f465b7523 Fixed bug 1141
Rebuild the window with the new style on older versions of Mac OS X.
2011-02-26 11:29:23 -08:00
Sam Lantinga
9c8d95eab0 Restore the window title when the title bar is re-added to the window. 2011-02-26 10:15:13 -08:00
Sam Lantinga
fbdf7429d5 Restore the windowed position and size when coming back from fullscreen.
Also fixed problem where Cocoa would move the windows in response to the fullscreen mode change.
2011-02-26 10:11:09 -08:00
Sam Lantinga
0dd9ad216f Hopefully fixed crashes when creating multiple streaming textures of different sizes. 2011-02-24 23:42:58 -08:00
Sam Lantinga
82a00575e9 Tracking rectangles had some problems, it's easier to track things directly. (fixes bug 1149, 1147, 1146) 2011-02-24 18:11:29 -08:00
Sam Lantinga
1a2a914b33 Fixed bug 1145 (GL Context creation fails for OpenGL 3.2 + Alpha buffer with X11 BadMatch)
Matthias      2011-02-23 09:37:51 PST

Please view the attached source file. Using this minimal program (as attached),
it creates an OpenGL 2.0 context with a cleared color buffer. If I set the
OpenGL version to 3.2, the function SDL_GL_CreateContext fails (or more
specifically, glXMakeCurrent fails) with an X11 BadMatch error:


X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  128 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  153
  Current serial number in output stream:  153


Also note that if I do not specify the alpha buffer size, the program works for
OpenGL 2.0 and OpenGL 3.2.

After some further analysis, I believe I have found the problem. The specific
issue is in:

SDL_x11opengl.c::X11_GL_CreateContext.

Note that for OpenGL 3.2 contexts, the GLXFBConfig to use is chosen as the best
match from glXChooseFBConfig. However, opengl attributes originally set with
SDL_GL_SetAttribute are not mapped to GLX attributes and then passed to the
glXChooseFBConfig function. According to the GLX 1.4 specification, if the
attributes are not specified, the function falls back to defaults (which, in
this particular case, prefer alpha channel size == 0).

For testing purposes, I modified the call to glXChooseFBConfig to look
something like this:


int glxAttribs[] =
{
 GLX_RED_SIZE,8,
 GLX_GREEN_SIZE,8,
 GLX_BLUE_SIZE,8,
 GLX_ALPHA_SIZE,8,
 None
};

if (!glXChooseFBConfig ||
 !(framebuffer_config = glXChooseFBConfig(display, DefaultScreen(display),
glxAttribs, &fbcount)))
{
 ...
}


The best match GLXFBConfig then supports 8 bit alpha channel. The program then
works as intended.


Hope this helps!
2011-02-24 17:52:47 -08:00
Sam Lantinga
65af7584bf SDL 1.3 doesn't use nasm anymore. :) 2011-02-24 09:41:04 -08:00
Sam Lantinga
2f682c9d08 Fixed compile error on some versions of Mac OS X. 2011-02-23 15:06:14 -08:00
Sam Lantinga
d79f7ed02d Fixed altivec.h include on Mac OS X 2011-02-22 22:17:44 -08:00