Ghassan Al-Mashareqa
The SDL_ceil function is implemented incorrectly when HAVE_CEIL is not defined (HAVE_LIBC not defined).
The following code:
double val = SDL_ceil(2.3);
printf("%g", val);
prints "2.0", as STD_ceil is defined as:
double
SDL_ceil(double x)
{
#ifdef HAVE_CEIL
return ceil(x);
#else
return (double)(int)((x)+0.5);
#endif /* HAVE_CEIL */
}
This functions is used in the SDL_BuildAudioResampleCVT function of the audio subsystem (SDL_audiocvt.c), and causes a bug in that function.
Lets Android take care of which is the primary pointer (the one acting as the
mouse in SDL), reorganized the Java side code as well to make it easier to
understand.
If your application wants to have access to the full resolution even when the system has DPI scaling enabled, call SetProcessDPIAware() before calling SDL_Init()
e.g.
typedef BOOL (WINAPI *SetProcessDPIAware_t)(void);
HMODULE hMod = LoadLibrary("user32.dll");
if ( hMod ) {
SetProcessDPIAware_t pSetProcessDPIAware = GetProcAddress( hMod, "SetProcessDPIAware" );
if ( pSetProcessDPIAware ) {
pSetProcessDPIAware();
}
FreeLibrary( hMod );
}
To enable this, set the environment variable SDL_MOUSE_RELATIVE_MODE_WARP to "1"
When mouse relative mode is disabled, put the cursor back where the application expects it to be, instead of where it was when relative mode was enabled.
Based on the original port to Wayland by: Joel Teichroeb, Benjamin Franzke, Scott Moreau, et al.
Additional changes in this commit, done by me:
* Wayland uses the common EGL framework
* EGL can now create a desktop OpenGL context
* testgl2 loads GL functions dynamically, no need to link to libGL anymore
* Assorted fixes to the Wayland backend
Tested on the Weston Compositor (v1.0.5) that ships with Ubuntu 13.10,
running Weston under X. Tests ran: testrendercopyex (all backends), testgl2, testgles2,testintersections
pjz
SDL_ltoa(-2147483648,s,10) only returns "-" because there is a bug in the code:
if ( value < 0 ) {
*bufp++ = '-';
value = -value;
}
but -(-2147483648) is still -2147483648 (0x80000000) as signed int (or long), so the following loop doesn't run at all. Similar bug are also in SDL_lltoa.
BTW, there is no sanity check for radix.
Brandon Schaefer
This means everything will render black if the software rendering backend selects a pixel format that supports alpha. So it seems best to at lease assume alpha is supported.