mirror of
https://github.com/yawut/SDL.git
synced 2026-10-01 12:46:41 -05:00
12
src/SDL.c
12
src/SDL.c
@@ -39,7 +39,7 @@ extern void SDL_StartTicks(void);
|
||||
extern int SDL_TimerInit(void);
|
||||
extern void SDL_TimerQuit(void);
|
||||
#endif
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__WINDOWS__)
|
||||
extern int SDL_HelperWindowCreate(void);
|
||||
extern int SDL_HelperWindowDestroy(void);
|
||||
#endif
|
||||
@@ -147,7 +147,7 @@ SDL_Init(Uint32 flags)
|
||||
/* Clear the error message */
|
||||
SDL_ClearError();
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__WINDOWS__)
|
||||
if (SDL_HelperWindowCreate() < 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -220,7 +220,7 @@ SDL_Quit(void)
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__WINDOWS__)
|
||||
SDL_HelperWindowDestroy();
|
||||
#endif
|
||||
SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
|
||||
@@ -312,7 +312,7 @@ SDL_GetPlatform()
|
||||
return "RISC OS";
|
||||
#elif __SOLARIS__
|
||||
return "Solaris";
|
||||
#elif __WIN32__
|
||||
#elif __WINDOWS__
|
||||
#ifdef _WIN32_WCE
|
||||
return "Windows CE";
|
||||
#else
|
||||
@@ -325,7 +325,7 @@ SDL_GetPlatform()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__WINDOWS__)
|
||||
|
||||
#if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL))
|
||||
/* Need to include DllMain() on Watcom C for some reason.. */
|
||||
@@ -347,6 +347,6 @@ _DllMainCRTStartup(HANDLE hModule,
|
||||
}
|
||||
#endif /* building DLL with Watcom C */
|
||||
|
||||
#endif /* __WIN32__ */
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -971,7 +971,7 @@ open_audio_device(const char *devname, int iscapture,
|
||||
if (!current_audio.impl.ProvidesOwnCallbackThread) {
|
||||
/* Start the audio thread */
|
||||
/* !!! FIXME: this is nasty. */
|
||||
#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
|
||||
#if (defined(__WINDOWS__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
|
||||
#undef SDL_CreateThread
|
||||
device->thread = SDL_CreateThread(SDL_RunAudio, device, NULL, NULL);
|
||||
#else
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
#endif
|
||||
#ifdef __WIN32__
|
||||
#ifdef __WINDOWS__
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
@@ -319,7 +319,7 @@ SDL_GetCPUCount()
|
||||
sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0);
|
||||
}
|
||||
#endif
|
||||
#ifdef __WIN32__
|
||||
#ifdef __WINDOWS__
|
||||
if (SDL_CPUCount <= 0) {
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo(&info);
|
||||
|
||||
@@ -170,7 +170,7 @@ SDL_StartEventThread(Uint32 flags)
|
||||
|
||||
/* The event thread will handle timers too */
|
||||
SDL_SetTimerThreaded(2);
|
||||
#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
|
||||
#if (defined(__WINDOWS__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
|
||||
#undef SDL_CreateThread
|
||||
SDL_EventThread =
|
||||
SDL_CreateThread(SDL_GobbleEvents, NULL, NULL, NULL);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#define MUST_THREAD_EVENTS
|
||||
#endif
|
||||
|
||||
#ifdef __WIN32__ /* Win32 doesn't allow a separate event thread */
|
||||
#ifdef __WINDOWS__ /* Windows doesn't allow a separate event thread */
|
||||
#define CANT_THREAD_EVENTS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
- msdn.microsoft.com
|
||||
*/
|
||||
/* *INDENT-OFF* */
|
||||
static const SDL_scancode win32_scancode_table[] = {
|
||||
static const SDL_scancode windows_scancode_table[] = {
|
||||
/* 0, 0x00 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 1, 0x01 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 2, 0x02 */ SDL_SCANCODE_UNKNOWN,
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <fat.h>
|
||||
#endif /* __NDS__ */
|
||||
|
||||
#ifdef __WIN32__
|
||||
#ifdef __WINDOWS__
|
||||
|
||||
/* Functions to read/write Win32 API file pointers */
|
||||
/* Will not use it on WinCE because stdio is buffered, it means
|
||||
@@ -54,7 +54,7 @@
|
||||
#define READAHEAD_BUFFER_SIZE 1024
|
||||
|
||||
static int SDLCALL
|
||||
win32_file_open(SDL_RWops * context, const char *filename, const char *mode)
|
||||
windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
|
||||
{
|
||||
#ifndef _WIN32_WCE
|
||||
UINT old_error_mode;
|
||||
@@ -67,10 +67,10 @@ win32_file_open(SDL_RWops * context, const char *filename, const char *mode)
|
||||
if (!context)
|
||||
return -1; /* failed (invalid call) */
|
||||
|
||||
context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* mark this as unusable */
|
||||
context->hidden.win32io.buffer.data = NULL;
|
||||
context->hidden.win32io.buffer.size = 0;
|
||||
context->hidden.win32io.buffer.left = 0;
|
||||
context->hidden.windowsio.h = INVALID_HANDLE_VALUE; /* mark this as unusable */
|
||||
context->hidden.windowsio.buffer.data = NULL;
|
||||
context->hidden.windowsio.buffer.size = 0;
|
||||
context->hidden.windowsio.buffer.left = 0;
|
||||
|
||||
/* "r" = reading, file must exist */
|
||||
/* "w" = writing, truncate existing, file may not exist */
|
||||
@@ -90,9 +90,9 @@ win32_file_open(SDL_RWops * context, const char *filename, const char *mode)
|
||||
if (!r_right && !w_right) /* inconsistent mode */
|
||||
return -1; /* failed (invalid call) */
|
||||
|
||||
context->hidden.win32io.buffer.data =
|
||||
context->hidden.windowsio.buffer.data =
|
||||
(char *) SDL_malloc(READAHEAD_BUFFER_SIZE);
|
||||
if (!context->hidden.win32io.buffer.data) {
|
||||
if (!context->hidden.windowsio.buffer.data) {
|
||||
SDL_OutOfMemory();
|
||||
return -1;
|
||||
}
|
||||
@@ -104,8 +104,8 @@ win32_file_open(SDL_RWops * context, const char *filename, const char *mode)
|
||||
if (MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, size) ==
|
||||
0) {
|
||||
SDL_stack_free(filenameW);
|
||||
SDL_free(context->hidden.win32io.buffer.data);
|
||||
context->hidden.win32io.buffer.data = NULL;
|
||||
SDL_free(context->hidden.windowsio.buffer.data);
|
||||
context->hidden.windowsio.buffer.data = NULL;
|
||||
SDL_SetError("Unable to convert filename to Unicode");
|
||||
return -1;
|
||||
}
|
||||
@@ -130,51 +130,51 @@ win32_file_open(SDL_RWops * context, const char *filename, const char *mode)
|
||||
#endif /* _WIN32_WCE */
|
||||
|
||||
if (h == INVALID_HANDLE_VALUE) {
|
||||
SDL_free(context->hidden.win32io.buffer.data);
|
||||
context->hidden.win32io.buffer.data = NULL;
|
||||
SDL_free(context->hidden.windowsio.buffer.data);
|
||||
context->hidden.windowsio.buffer.data = NULL;
|
||||
SDL_SetError("Couldn't open %s", filename);
|
||||
return -2; /* failed (CreateFile) */
|
||||
}
|
||||
context->hidden.win32io.h = h;
|
||||
context->hidden.win32io.append = a_mode ? SDL_TRUE : SDL_FALSE;
|
||||
context->hidden.windowsio.h = h;
|
||||
context->hidden.windowsio.append = a_mode ? SDL_TRUE : SDL_FALSE;
|
||||
|
||||
return 0; /* ok */
|
||||
}
|
||||
|
||||
static long SDLCALL
|
||||
win32_file_seek(SDL_RWops * context, long offset, int whence)
|
||||
windows_file_seek(SDL_RWops * context, long offset, int whence)
|
||||
{
|
||||
DWORD win32whence;
|
||||
DWORD windowswhence;
|
||||
long file_pos;
|
||||
|
||||
if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE) {
|
||||
SDL_SetError("win32_file_seek: invalid context/file not opened");
|
||||
if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) {
|
||||
SDL_SetError("windows_file_seek: invalid context/file not opened");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* FIXME: We may be able to satisfy the seek within buffered data */
|
||||
if (whence == RW_SEEK_CUR && context->hidden.win32io.buffer.left) {
|
||||
offset -= (long)context->hidden.win32io.buffer.left;
|
||||
if (whence == RW_SEEK_CUR && context->hidden.windowsio.buffer.left) {
|
||||
offset -= (long)context->hidden.windowsio.buffer.left;
|
||||
}
|
||||
context->hidden.win32io.buffer.left = 0;
|
||||
context->hidden.windowsio.buffer.left = 0;
|
||||
|
||||
switch (whence) {
|
||||
case RW_SEEK_SET:
|
||||
win32whence = FILE_BEGIN;
|
||||
windowswhence = FILE_BEGIN;
|
||||
break;
|
||||
case RW_SEEK_CUR:
|
||||
win32whence = FILE_CURRENT;
|
||||
windowswhence = FILE_CURRENT;
|
||||
break;
|
||||
case RW_SEEK_END:
|
||||
win32whence = FILE_END;
|
||||
windowswhence = FILE_END;
|
||||
break;
|
||||
default:
|
||||
SDL_SetError("win32_file_seek: Unknown value for 'whence'");
|
||||
SDL_SetError("windows_file_seek: Unknown value for 'whence'");
|
||||
return -1;
|
||||
}
|
||||
|
||||
file_pos =
|
||||
SetFilePointer(context->hidden.win32io.h, offset, NULL, win32whence);
|
||||
SetFilePointer(context->hidden.windowsio.h, offset, NULL, windowswhence);
|
||||
|
||||
if (file_pos != INVALID_SET_FILE_POINTER)
|
||||
return file_pos; /* success */
|
||||
@@ -184,7 +184,7 @@ win32_file_seek(SDL_RWops * context, long offset, int whence)
|
||||
}
|
||||
|
||||
static size_t SDLCALL
|
||||
win32_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
|
||||
windows_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
|
||||
{
|
||||
size_t total_need;
|
||||
size_t total_read = 0;
|
||||
@@ -193,18 +193,18 @@ win32_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
|
||||
|
||||
total_need = size * maxnum;
|
||||
|
||||
if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE
|
||||
if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE
|
||||
|| !total_need)
|
||||
return 0;
|
||||
|
||||
if (context->hidden.win32io.buffer.left > 0) {
|
||||
void *data = (char *) context->hidden.win32io.buffer.data +
|
||||
context->hidden.win32io.buffer.size -
|
||||
context->hidden.win32io.buffer.left;
|
||||
if (context->hidden.windowsio.buffer.left > 0) {
|
||||
void *data = (char *) context->hidden.windowsio.buffer.data +
|
||||
context->hidden.windowsio.buffer.size -
|
||||
context->hidden.windowsio.buffer.left;
|
||||
read_ahead =
|
||||
SDL_min(total_need, context->hidden.win32io.buffer.left);
|
||||
SDL_min(total_need, context->hidden.windowsio.buffer.left);
|
||||
SDL_memcpy(ptr, data, read_ahead);
|
||||
context->hidden.win32io.buffer.left -= read_ahead;
|
||||
context->hidden.windowsio.buffer.left -= read_ahead;
|
||||
|
||||
if (read_ahead == total_need) {
|
||||
return maxnum;
|
||||
@@ -216,19 +216,19 @@ win32_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
|
||||
|
||||
if (total_need < READAHEAD_BUFFER_SIZE) {
|
||||
if (!ReadFile
|
||||
(context->hidden.win32io.h, context->hidden.win32io.buffer.data,
|
||||
(context->hidden.windowsio.h, context->hidden.windowsio.buffer.data,
|
||||
READAHEAD_BUFFER_SIZE, &byte_read, NULL)) {
|
||||
SDL_Error(SDL_EFREAD);
|
||||
return 0;
|
||||
}
|
||||
read_ahead = SDL_min(total_need, (int) byte_read);
|
||||
SDL_memcpy(ptr, context->hidden.win32io.buffer.data, read_ahead);
|
||||
context->hidden.win32io.buffer.size = byte_read;
|
||||
context->hidden.win32io.buffer.left = byte_read - read_ahead;
|
||||
SDL_memcpy(ptr, context->hidden.windowsio.buffer.data, read_ahead);
|
||||
context->hidden.windowsio.buffer.size = byte_read;
|
||||
context->hidden.windowsio.buffer.left = byte_read - read_ahead;
|
||||
total_read += read_ahead;
|
||||
} else {
|
||||
if (!ReadFile
|
||||
(context->hidden.win32io.h, ptr, (DWORD)total_need, &byte_read, NULL)) {
|
||||
(context->hidden.windowsio.h, ptr, (DWORD)total_need, &byte_read, NULL)) {
|
||||
SDL_Error(SDL_EFREAD);
|
||||
return 0;
|
||||
}
|
||||
@@ -238,7 +238,7 @@ win32_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
|
||||
}
|
||||
|
||||
static size_t SDLCALL
|
||||
win32_file_write(SDL_RWops * context, const void *ptr, size_t size,
|
||||
windows_file_write(SDL_RWops * context, const void *ptr, size_t size,
|
||||
size_t num)
|
||||
{
|
||||
|
||||
@@ -248,20 +248,20 @@ win32_file_write(SDL_RWops * context, const void *ptr, size_t size,
|
||||
|
||||
total_bytes = size * num;
|
||||
|
||||
if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE
|
||||
if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE
|
||||
|| total_bytes <= 0 || !size)
|
||||
return 0;
|
||||
|
||||
if (context->hidden.win32io.buffer.left) {
|
||||
SetFilePointer(context->hidden.win32io.h,
|
||||
-(LONG)context->hidden.win32io.buffer.left, NULL,
|
||||
if (context->hidden.windowsio.buffer.left) {
|
||||
SetFilePointer(context->hidden.windowsio.h,
|
||||
-(LONG)context->hidden.windowsio.buffer.left, NULL,
|
||||
FILE_CURRENT);
|
||||
context->hidden.win32io.buffer.left = 0;
|
||||
context->hidden.windowsio.buffer.left = 0;
|
||||
}
|
||||
|
||||
/* if in append mode, we must go to the EOF before write */
|
||||
if (context->hidden.win32io.append) {
|
||||
if (SetFilePointer(context->hidden.win32io.h, 0L, NULL, FILE_END) ==
|
||||
if (context->hidden.windowsio.append) {
|
||||
if (SetFilePointer(context->hidden.windowsio.h, 0L, NULL, FILE_END) ==
|
||||
INVALID_SET_FILE_POINTER) {
|
||||
SDL_Error(SDL_EFWRITE);
|
||||
return 0;
|
||||
@@ -269,7 +269,7 @@ win32_file_write(SDL_RWops * context, const void *ptr, size_t size,
|
||||
}
|
||||
|
||||
if (!WriteFile
|
||||
(context->hidden.win32io.h, ptr, (DWORD)total_bytes, &byte_written, NULL)) {
|
||||
(context->hidden.windowsio.h, ptr, (DWORD)total_bytes, &byte_written, NULL)) {
|
||||
SDL_Error(SDL_EFWRITE);
|
||||
return 0;
|
||||
}
|
||||
@@ -279,23 +279,23 @@ win32_file_write(SDL_RWops * context, const void *ptr, size_t size,
|
||||
}
|
||||
|
||||
static int SDLCALL
|
||||
win32_file_close(SDL_RWops * context)
|
||||
windows_file_close(SDL_RWops * context)
|
||||
{
|
||||
|
||||
if (context) {
|
||||
if (context->hidden.win32io.h != INVALID_HANDLE_VALUE) {
|
||||
CloseHandle(context->hidden.win32io.h);
|
||||
context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* to be sure */
|
||||
if (context->hidden.windowsio.h != INVALID_HANDLE_VALUE) {
|
||||
CloseHandle(context->hidden.windowsio.h);
|
||||
context->hidden.windowsio.h = INVALID_HANDLE_VALUE; /* to be sure */
|
||||
}
|
||||
if (context->hidden.win32io.buffer.data) {
|
||||
SDL_free(context->hidden.win32io.buffer.data);
|
||||
context->hidden.win32io.buffer.data = NULL;
|
||||
if (context->hidden.windowsio.buffer.data) {
|
||||
SDL_free(context->hidden.windowsio.buffer.data);
|
||||
context->hidden.windowsio.buffer.data = NULL;
|
||||
}
|
||||
SDL_FreeRW(context);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
#endif /* __WIN32__ */
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
#ifdef HAVE_STDIO_H
|
||||
|
||||
@@ -449,18 +449,18 @@ SDL_RWFromFile(const char *file, const char *mode)
|
||||
SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
|
||||
return NULL;
|
||||
}
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__WINDOWS__)
|
||||
rwops = SDL_AllocRW();
|
||||
if (!rwops)
|
||||
return NULL; /* SDL_SetError already setup by SDL_AllocRW() */
|
||||
if (win32_file_open(rwops, file, mode) < 0) {
|
||||
if (windows_file_open(rwops, file, mode) < 0) {
|
||||
SDL_FreeRW(rwops);
|
||||
return NULL;
|
||||
}
|
||||
rwops->seek = win32_file_seek;
|
||||
rwops->read = win32_file_read;
|
||||
rwops->write = win32_file_write;
|
||||
rwops->close = win32_file_close;
|
||||
rwops->seek = windows_file_seek;
|
||||
rwops->read = windows_file_read;
|
||||
rwops->write = windows_file_write;
|
||||
rwops->close = windows_file_close;
|
||||
|
||||
#elif HAVE_STDIO_H
|
||||
#ifdef __APPLE__
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "../SDL_syshaptic.h"
|
||||
#include "SDL_joystick.h"
|
||||
#include "../../joystick/SDL_sysjoystick.h" /* For the real SDL_Joystick */
|
||||
#include "../../joystick/win32/SDL_dxjoystick_c.h" /* For joystick hwdata */
|
||||
#include "../../joystick/windows/SDL_dxjoystick_c.h" /* For joystick hwdata */
|
||||
|
||||
|
||||
#define MAX_HAPTICS 32
|
||||
@@ -65,7 +65,7 @@ struct joystick_hwdata
|
||||
} transaxis[6];
|
||||
};
|
||||
|
||||
/* Convert a win32 Multimedia API return code to a text message */
|
||||
/* Convert a Windows Multimedia API return code to a text message */
|
||||
static void SetMMerror(char *function, int code);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef SDL_LOADSO_WIN32
|
||||
#ifdef SDL_LOADSO_WINDOWS
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* System dependent library loading routines */
|
||||
@@ -61,7 +61,7 @@ SDL_LoadObject(const char *sofile)
|
||||
SDL_free(sofile_t);
|
||||
SDL_free(errbuf_t);
|
||||
|
||||
#else /*if defined(__WIN32__) */
|
||||
#else /*if defined(__WINDOWS__) */
|
||||
char errbuf[512];
|
||||
|
||||
handle = (void *) LoadLibrary(sofile);
|
||||
@@ -140,6 +140,6 @@ SDL_UnloadObject(void *handle)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_LOADSO_WIN32 */
|
||||
#endif /* SDL_LOADSO_WINDOWS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#ifndef HAVE_GETENV
|
||||
|
||||
#if defined(__WIN32__) && !defined(_WIN32_WCE)
|
||||
#if defined(__WINDOWS__) && !defined(_WIN32_WCE)
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
@@ -163,7 +163,7 @@ SDL_getenv(const char *name)
|
||||
return value;
|
||||
}
|
||||
|
||||
#endif /* __WIN32__ */
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
#endif /* !HAVE_GETENV */
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
#include "pthread/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_SPROC
|
||||
#include "irix/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_WIN32
|
||||
#include "win32/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_WINDOWS
|
||||
#include "windows/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_NDS
|
||||
#include "nds/SDL_systhread_c.h"
|
||||
#else
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef SDL_TIMER_WIN32
|
||||
#ifdef SDL_TIMER_WINDOWS
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
@@ -161,5 +161,6 @@ SDL_SYS_StopTimer(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* SDL_TIMER_WIN32 */
|
||||
#endif /* SDL_TIMER_WINDOWS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1181,7 +1181,7 @@ GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points,
|
||||
}
|
||||
data->glEnd();
|
||||
} else {
|
||||
#if defined(__APPLE__) || defined(__WIN32__)
|
||||
#if defined(__APPLE__) || defined(__WINDOWS__)
|
||||
#else
|
||||
int x1, y1, x2, y2;
|
||||
#endif
|
||||
@@ -1200,7 +1200,7 @@ GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points,
|
||||
* least it would be pixel perfect.
|
||||
*/
|
||||
data->glBegin(GL_POINTS);
|
||||
#if defined(__APPLE__) || defined(__WIN32__)
|
||||
#if defined(__APPLE__) || defined(__WINDOWS__)
|
||||
/* Mac OS X and Windows seem to always leave the second point open */
|
||||
data->glVertex2f(0.5f + points[count-1].x, 0.5f + points[count-1].y);
|
||||
#else
|
||||
|
||||
@@ -411,8 +411,8 @@ extern VideoBootStrap X11_bootstrap;
|
||||
#if SDL_VIDEO_DRIVER_DIRECTFB
|
||||
extern VideoBootStrap DirectFB_bootstrap;
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_WIN32
|
||||
extern VideoBootStrap WIN32_bootstrap;
|
||||
#if SDL_VIDEO_DRIVER_WINDOWS
|
||||
extern VideoBootStrap WINDOWS_bootstrap;
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
extern VideoBootStrap BWINDOW_bootstrap;
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
#include "../events/SDL_sysevents.h"
|
||||
#include "../events/SDL_events_c.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_WIN32
|
||||
#include "win32/SDL_win32video.h"
|
||||
#if SDL_VIDEO_DRIVER_WINDOWS
|
||||
#include "windows/SDL_windowsvideo.h"
|
||||
extern void IME_Present(SDL_VideoData *videodata);
|
||||
#endif
|
||||
|
||||
@@ -65,8 +65,8 @@ static VideoBootStrap *bootstrap[] = {
|
||||
#if SDL_VIDEO_DRIVER_DIRECTFB
|
||||
&DirectFB_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_WIN32
|
||||
&WIN32_bootstrap,
|
||||
#if SDL_VIDEO_DRIVER_WINDOWS
|
||||
&WINDOWS_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
&BWINDOW_bootstrap,
|
||||
@@ -2708,7 +2708,7 @@ SDL_RenderPresent(void)
|
||||
if (!renderer || !renderer->RenderPresent) {
|
||||
return;
|
||||
}
|
||||
#if SDL_VIDEO_DRIVER_WIN32
|
||||
#if SDL_VIDEO_DRIVER_WINDOWS
|
||||
IME_Present((SDL_VideoData *)_this->driverdata);
|
||||
#endif
|
||||
renderer->RenderPresent(renderer);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#if SDL_VIDEO_RENDER_DDRAW
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "../SDL_yuv_sw_c.h"
|
||||
|
||||
#if 0
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#if SDL_VIDEO_RENDER_D3D
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "../SDL_yuv_sw_c.h"
|
||||
|
||||
#ifdef ASSEMBLE_SHADER
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
#if SDL_VIDEO_RENDER_GAPI
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_win32window.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "SDL_windowswindow.h"
|
||||
#include "../SDL_yuv_sw_c.h"
|
||||
|
||||
// RawFrameBufferInfo
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#if SDL_VIDEO_RENDER_GDI
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "../SDL_rect_c.h"
|
||||
#include "../SDL_yuv_sw_c.h"
|
||||
#include "../SDL_alphamult.h"
|
||||
@@ -21,8 +21,8 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_win32window.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "SDL_windowswindow.h"
|
||||
#include "../../events/SDL_clipboardevents_c.h"
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32clipboard_h
|
||||
#define _SDL_win32clipboard_h
|
||||
#ifndef _SDL_windowsclipboard_h
|
||||
#define _SDL_windowsclipboard_h
|
||||
|
||||
/* Forward declaration */
|
||||
struct SDL_VideoData;
|
||||
@@ -32,6 +32,6 @@ extern char *WIN_GetClipboardText(_THIS);
|
||||
extern SDL_bool WIN_HasClipboardText(_THIS);
|
||||
extern void WIN_CheckClipboardUpdate(struct SDL_VideoData * data);
|
||||
|
||||
#endif /* _SDL_win32clipboard_h */
|
||||
#endif /* _SDL_windowsclipboard_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_win32shape.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "SDL_windowsshape.h"
|
||||
#include "SDL_syswm.h"
|
||||
#include "SDL_vkeys.h"
|
||||
#include "../../events/SDL_events_c.h"
|
||||
@@ -21,8 +21,8 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32events_h
|
||||
#define _SDL_win32events_h
|
||||
#ifndef _SDL_windowsevents_h
|
||||
#define _SDL_windowsevents_h
|
||||
|
||||
extern LPTSTR SDL_Appname;
|
||||
extern Uint32 SDL_Appstyle;
|
||||
@@ -32,6 +32,6 @@ extern LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
LPARAM lParam);
|
||||
extern void WIN_PumpEvents(_THIS);
|
||||
|
||||
#endif /* _SDL_win32events_h */
|
||||
#endif /* _SDL_windowsevents_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
|
||||
|
||||
int
|
||||
@@ -21,12 +21,12 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32gamma_h
|
||||
#define _SDL_win32gamma_h
|
||||
#ifndef _SDL_windowsgamma_h
|
||||
#define _SDL_windowsgamma_h
|
||||
|
||||
extern int WIN_SetDisplayGammaRamp(_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
|
||||
extern int WIN_GetDisplayGammaRamp(_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
|
||||
|
||||
#endif /* _SDL_win32gamma_h */
|
||||
#endif /* _SDL_windowsgamma_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -21,10 +21,10 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
#include "../../events/scancodes_win32.h"
|
||||
#include "../../events/scancodes_windows.h"
|
||||
|
||||
#include <imm.h>
|
||||
#include <oleauto.h>
|
||||
@@ -87,7 +87,7 @@ WIN_InitKeyboard(_THIS)
|
||||
}
|
||||
}
|
||||
|
||||
data->key_layout = win32_scancode_table;
|
||||
data->key_layout = windows_scancode_table;
|
||||
|
||||
data->ime_com_initialized = SDL_FALSE;
|
||||
data->ime_threadmgr = 0;
|
||||
@@ -150,10 +150,10 @@ WIN_UpdateKeymap()
|
||||
|
||||
SDL_GetDefaultKeymap(keymap);
|
||||
|
||||
for (i = 0; i < SDL_arraysize(win32_scancode_table); i++) {
|
||||
for (i = 0; i < SDL_arraysize(windows_scancode_table); i++) {
|
||||
|
||||
/* Make sure this scancode is a valid character scancode */
|
||||
scancode = win32_scancode_table[i];
|
||||
scancode = windows_scancode_table[i];
|
||||
if (scancode == SDL_SCANCODE_UNKNOWN || keymap[scancode] >= 127) {
|
||||
continue;
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32keyboard_h
|
||||
#define _SDL_win32keyboard_h
|
||||
#ifndef _SDL_windowskeyboard_h
|
||||
#define _SDL_windowskeyboard_h
|
||||
|
||||
extern BYTE alpha_scancodes[26];
|
||||
extern BYTE keypad_scancodes[10];
|
||||
@@ -37,6 +37,6 @@ extern void WIN_SetTextInputRect(_THIS, SDL_Rect *rect);
|
||||
|
||||
extern SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata);
|
||||
|
||||
#endif /* _SDL_win32keyboard_h */
|
||||
#endif /* _SDL_windowskeyboard_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
|
||||
|
||||
static SDL_bool
|
||||
@@ -21,8 +21,8 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32modes_h
|
||||
#define _SDL_win32modes_h
|
||||
#ifndef _SDL_windowsmodes_h
|
||||
#define _SDL_windowsmodes_h
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -40,6 +40,6 @@ extern void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
|
||||
extern int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
|
||||
extern void WIN_QuitModes(_THIS);
|
||||
|
||||
#endif /* _SDL_win32modes_h */
|
||||
#endif /* _SDL_windowsmodes_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
|
||||
void
|
||||
WIN_InitMouse(_THIS)
|
||||
@@ -21,12 +21,12 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32mouse_h
|
||||
#define _SDL_win32mouse_h
|
||||
#ifndef _SDL_windowsmouse_h
|
||||
#define _SDL_windowsmouse_h
|
||||
|
||||
extern void WIN_InitMouse(_THIS);
|
||||
extern void WIN_QuitMouse(_THIS);
|
||||
|
||||
#endif /* _SDL_win32mouse_h */
|
||||
#endif /* _SDL_windowsmouse_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
|
||||
/* WGL implementation of SDL OpenGL support */
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32opengl_h
|
||||
#define _SDL_win32opengl_h
|
||||
#ifndef _SDL_windowsopengl_h
|
||||
#define _SDL_windowsopengl_h
|
||||
|
||||
#if SDL_VIDEO_OPENGL_WGL
|
||||
|
||||
@@ -121,6 +121,6 @@ extern void WIN_GL_DeleteContext(_THIS, SDL_GLContext context);
|
||||
|
||||
#endif /* SDL_VIDEO_OPENGL_WGL */
|
||||
|
||||
#endif /* _SDL_win32opengl_h */
|
||||
#endif /* _SDL_windowsopengl_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include "SDL_assert.h"
|
||||
#include "SDL_win32shape.h"
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_windowsshape.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
|
||||
SDL_WindowShaper*
|
||||
Win32_CreateShaper(SDL_Window * window) {
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32shape_h
|
||||
#define _SDL_win32shape_h
|
||||
#ifndef _SDL_windowsshape_h
|
||||
#define _SDL_windowsshape_h
|
||||
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_shape.h"
|
||||
@@ -38,4 +38,4 @@ extern SDL_WindowShaper* Win32_CreateShaper(SDL_Window * window);
|
||||
extern int Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
|
||||
extern int Win32_ResizeWindowShape(SDL_Window *window);
|
||||
|
||||
#endif /* _SDL_win32shape_h */
|
||||
#endif /* _SDL_windowsshape_h */
|
||||
@@ -27,8 +27,8 @@
|
||||
#include "../SDL_sysvideo.h"
|
||||
#include "../SDL_pixels_c.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_win32shape.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "SDL_windowsshape.h"
|
||||
#include "SDL_d3drender.h"
|
||||
#include "SDL_gdirender.h"
|
||||
#include "SDL_gapirender.h"
|
||||
@@ -51,7 +51,7 @@ WIN_SetError(const char *prefix)
|
||||
}
|
||||
|
||||
|
||||
/* WIN32 driver bootstrap functions */
|
||||
/* Windows driver bootstrap functions */
|
||||
|
||||
static int
|
||||
WIN_Available(void)
|
||||
@@ -221,11 +221,11 @@ WIN_CreateDevice(int devindex)
|
||||
return device;
|
||||
}
|
||||
|
||||
VideoBootStrap WIN32_bootstrap = {
|
||||
VideoBootStrap WINDOWS_bootstrap = {
|
||||
#ifdef _WIN32_WCE
|
||||
"wince", "SDL WinCE video driver", WINCE_Available, WIN_CreateDevice
|
||||
#else
|
||||
"win32", "SDL Win32/64 video driver", WIN_Available, WIN_CreateDevice
|
||||
"windows", "SDL Win32/64 video driver", WIN_Available, WIN_CreateDevice
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32video_h
|
||||
#define _SDL_win32video_h
|
||||
#ifndef _SDL_windowsvideo_h
|
||||
#define _SDL_windowsvideo_h
|
||||
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
@@ -59,14 +59,14 @@
|
||||
#include "ddraw.h"
|
||||
#endif
|
||||
|
||||
#include "SDL_win32clipboard.h"
|
||||
#include "SDL_win32events.h"
|
||||
#include "SDL_win32gamma.h"
|
||||
#include "SDL_win32keyboard.h"
|
||||
#include "SDL_win32modes.h"
|
||||
#include "SDL_win32mouse.h"
|
||||
#include "SDL_win32opengl.h"
|
||||
#include "SDL_win32window.h"
|
||||
#include "SDL_windowsclipboard.h"
|
||||
#include "SDL_windowsevents.h"
|
||||
#include "SDL_windowsgamma.h"
|
||||
#include "SDL_windowskeyboard.h"
|
||||
#include "SDL_windowsmodes.h"
|
||||
#include "SDL_windowsmouse.h"
|
||||
#include "SDL_windowsopengl.h"
|
||||
#include "SDL_windowswindow.h"
|
||||
#include "SDL_events.h"
|
||||
|
||||
#ifdef UNICODE
|
||||
@@ -217,6 +217,6 @@ typedef struct SDL_VideoData
|
||||
TSFSink *ime_ippasink;
|
||||
} SDL_VideoData;
|
||||
|
||||
#endif /* _SDL_win32video_h */
|
||||
#endif /* _SDL_windowsvideo_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -25,10 +25,10 @@
|
||||
#include "../SDL_pixels_c.h"
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
|
||||
#include "SDL_win32video.h"
|
||||
#include "SDL_win32window.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "SDL_windowswindow.h"
|
||||
|
||||
/* This is included after SDL_win32video.h, which includes windows.h */
|
||||
/* This is included after SDL_windowsvideo.h, which includes windows.h */
|
||||
#include "SDL_syswm.h"
|
||||
#include "SDL_gapirender.h"
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_win32window_h
|
||||
#define _SDL_win32window_h
|
||||
#ifndef _SDL_windowswindow_h
|
||||
#define _SDL_windowswindow_h
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#define SHFS_SHOWTASKBAR 0x0001
|
||||
@@ -61,6 +61,6 @@ extern void WIN_DestroyWindow(_THIS, SDL_Window * window);
|
||||
extern SDL_bool WIN_GetWindowWMInfo(_THIS, SDL_Window * window,
|
||||
struct SDL_SysWMinfo *info);
|
||||
|
||||
#endif /* _SDL_win32window_h */
|
||||
#endif /* _SDL_windowswindow_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
Reference in New Issue
Block a user