Fixed swizzle of SDL_FillRect() on 24-bit surface (thanks, "nagydavid91"!).
Fixes Bugzilla #2986.
1 /* See COPYING.txt for the full license governing this code. */
3 * \file SDL_visualtest_process.h
5 * Provides cross-platfrom process launching and termination functionality.
8 #include <SDL_platform.h>
10 #if defined(__WIN32__)
13 #elif defined(__LINUX__)
16 #error "Unsupported platform."
19 #ifndef _SDL_visualtest_process_h
20 #define _SDL_visualtest_process_h
22 /* Set up for C function definitions, even when using C++ */
28 * Struct to store a platform specific handle to a process.
30 typedef struct SDL_ProcessInfo
32 //#if defined(_WIN32) || defined(__WIN32__)
33 #if defined(__WIN32__)
34 PROCESS_INFORMATION pi;
35 //#elif defined(__linux__)
36 #elif defined(__LINUX__)
42 * This structure stores the exit status (value returned by main()) and
43 * whether the process exited sucessfully or not.
45 typedef struct SDL_ProcessExitStatus
47 int exit_success; /*!< Zero if the process exited successfully */
48 int exit_status; /*!< The exit status of the process. 8-bit value. */
49 } SDL_ProcessExitStatus;
52 * Launches a process with the given commandline arguments.
54 * \param file The path to the executable to be launched.
55 * \param args The command line arguments to be passed to the process.
56 * \param pinfo Pointer to an SDL_ProcessInfo object to be populated with
57 * platform specific information about the launched process.
59 * \return Non-zero on success, zero on failure.
61 int SDL_LaunchProcess(char* file, char* args, SDL_ProcessInfo* pinfo);
64 * Checks if a process is running or not.
66 * \param pinfo Pointer to SDL_ProcessInfo object of the process that needs to be
69 * \return 1 if the process is still running; zero if it is not and -1 if the
70 * status could not be retrieved.
72 int SDL_IsProcessRunning(SDL_ProcessInfo* pinfo);
75 * Kills a currently running process.
77 * \param pinfo Pointer to a SDL_ProcessInfo object of the process to be terminated.
78 * \param ps Pointer to a SDL_ProcessExitStatus object which will be populated
79 * with the exit status.
81 * \return 1 on success, 0 on failure.
83 int SDL_KillProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps);
86 * Cleanly exits the process represented by \c pinfo and stores the exit status
87 * in the exit status object pointed to by \c ps.
89 * \return 1 on success, 0 on failure.
91 int SDL_QuitProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps);
94 * Gets the exit status of a process. If the exit status is -1, the process is
97 * \param pinfo Pointer to a SDL_ProcessInfo object of the process to be checked.
98 * \param ps Pointer to a SDL_ProcessExitStatus object which will be populated
99 * with the exit status.
101 * \return 1 on success, 0 on failure.
103 int SDL_GetProcessExitStatus(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps);
105 /* Ends C function definitions when using C++ */
110 #endif /* _SDL_visualtest_process_h */