SDL_CreateWindow() has been simplified and no longer takes a window position.
This commit is contained in:
@@ -265,9 +265,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Set 640x480 video mode */
|
||||
window = SDL_CreateWindow("CheckKeys Test",
|
||||
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
||||
640, 480, 0);
|
||||
window = SDL_CreateWindow("CheckKeys Test", 640, 480, 0);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create 640x480 window: %s\n",
|
||||
SDL_GetError());
|
||||
|
||||
@@ -251,9 +251,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Set 640x480 video mode */
|
||||
window = SDL_CreateWindow("CheckKeys Test",
|
||||
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
||||
640, 480, 0);
|
||||
window = SDL_CreateWindow("CheckKeys Test", 640, 480, 0);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create 640x480 window: %s\n",
|
||||
SDL_GetError());
|
||||
|
||||
@@ -746,9 +746,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Create a window to display joystick axis position */
|
||||
window = SDL_CreateWindow("Game Controller Map", SDL_WINDOWPOS_CENTERED,
|
||||
SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT, 0);
|
||||
window = SDL_CreateWindow("Game Controller Map", SCREEN_WIDTH, SCREEN_HEIGHT, 0);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
||||
return 2;
|
||||
|
||||
@@ -41,7 +41,7 @@ Code
|
||||
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
|
||||
win = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, 0);
|
||||
win = SDL_CreateWindow("Test", 800, 600, 0);
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
|
||||
while (1)
|
||||
|
||||
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
window = SDL_CreateWindow("testaudiocapture", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, 0);
|
||||
window = SDL_CreateWindow("testaudiocapture", 320, 240, 0);
|
||||
renderer = SDL_CreateRenderer(window, NULL, 0);
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Some targets (Mac CoreAudio) need an event queue for audio hotplug, so make and immediately hide a window. */
|
||||
SDL_MinimizeWindow(SDL_CreateWindow("testaudiohotplug", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0));
|
||||
SDL_MinimizeWindow(SDL_CreateWindow("testaudiohotplug", 640, 480, 0));
|
||||
|
||||
filename = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav");
|
||||
|
||||
|
||||
@@ -404,9 +404,9 @@ int mouse_getSetRelativeMouseMode(void *arg)
|
||||
*/
|
||||
static SDL_Window *createMouseSuiteTestWindow()
|
||||
{
|
||||
int posX = 100, posY = 100, width = MOUSE_TESTWINDOW_WIDTH, height = MOUSE_TESTWINDOW_HEIGHT;
|
||||
int width = MOUSE_TESTWINDOW_WIDTH, height = MOUSE_TESTWINDOW_HEIGHT;
|
||||
SDL_Window *window;
|
||||
window = SDL_CreateWindow("mousecreateMouseSuiteTestWindow", posX, posY, width, height, 0);
|
||||
window = SDL_CreateWindow("mousecreateMouseSuiteTestWindow", width, height, 0);
|
||||
SDLTest_AssertPass("SDL_CreateWindow()");
|
||||
SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result");
|
||||
return window;
|
||||
|
||||
@@ -47,9 +47,9 @@ static int isSupported(int code);
|
||||
*/
|
||||
void InitCreateRenderer(void *arg)
|
||||
{
|
||||
int posX = 100, posY = 100, width = 320, height = 240;
|
||||
int width = 320, height = 240;
|
||||
renderer = NULL;
|
||||
window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, 0);
|
||||
window = SDL_CreateWindow("render_testCreateRenderer", width, height, 0);
|
||||
SDLTest_AssertPass("SDL_CreateWindow()");
|
||||
SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result");
|
||||
if (window == NULL) {
|
||||
|
||||
@@ -16,7 +16,7 @@ int syswm_getWindowWMInfo(void *arg)
|
||||
SDL_Window *window;
|
||||
SDL_SysWMinfo info;
|
||||
|
||||
window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
|
||||
window = SDL_CreateWindow("", 0, 0, SDL_WINDOW_HIDDEN);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow()");
|
||||
SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
|
||||
if (window == NULL) {
|
||||
|
||||
@@ -12,18 +12,16 @@
|
||||
static SDL_Window *createVideoSuiteTestWindow(const char *title)
|
||||
{
|
||||
SDL_Window *window;
|
||||
int x, y, w, h;
|
||||
int w, h;
|
||||
SDL_WindowFlags flags;
|
||||
|
||||
/* Standard window */
|
||||
x = SDLTest_RandomIntegerInRange(1, 100);
|
||||
y = SDLTest_RandomIntegerInRange(1, 100);
|
||||
w = SDLTest_RandomIntegerInRange(320, 1024);
|
||||
h = SDLTest_RandomIntegerInRange(320, 768);
|
||||
flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS;
|
||||
|
||||
window = SDL_CreateWindow(title, x, y, w, h, flags);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags);
|
||||
window = SDL_CreateWindow(title, w, h, flags);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d)", w, h, flags);
|
||||
SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL");
|
||||
|
||||
return window;
|
||||
@@ -94,88 +92,6 @@ int video_enableDisableScreensaver(void *arg)
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Tests the functionality of the SDL_CreateWindow function using different positions
|
||||
*/
|
||||
int video_createWindowVariousPositions(void *arg)
|
||||
{
|
||||
SDL_Window *window;
|
||||
const char *title = "video_createWindowVariousPositions Test Window";
|
||||
int x, y, w, h;
|
||||
int xVariation, yVariation;
|
||||
|
||||
for (xVariation = 0; xVariation < 6; xVariation++) {
|
||||
for (yVariation = 0; yVariation < 6; yVariation++) {
|
||||
switch (xVariation) {
|
||||
default:
|
||||
case 0:
|
||||
/* Zero X Position */
|
||||
x = 0;
|
||||
break;
|
||||
case 1:
|
||||
/* Random X position inside screen */
|
||||
x = SDLTest_RandomIntegerInRange(1, 100);
|
||||
break;
|
||||
case 2:
|
||||
/* Random X position outside screen (positive) */
|
||||
x = SDLTest_RandomIntegerInRange(10000, 11000);
|
||||
break;
|
||||
case 3:
|
||||
/* Random X position outside screen (negative) */
|
||||
x = SDLTest_RandomIntegerInRange(-1000, -100);
|
||||
break;
|
||||
case 4:
|
||||
/* Centered X position */
|
||||
x = SDL_WINDOWPOS_CENTERED;
|
||||
break;
|
||||
case 5:
|
||||
/* Undefined X position */
|
||||
x = SDL_WINDOWPOS_UNDEFINED;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (yVariation) {
|
||||
default:
|
||||
case 0:
|
||||
/* Zero X Position */
|
||||
y = 0;
|
||||
break;
|
||||
case 1:
|
||||
/* Random X position inside screen */
|
||||
y = SDLTest_RandomIntegerInRange(1, 100);
|
||||
break;
|
||||
case 2:
|
||||
/* Random X position outside screen (positive) */
|
||||
y = SDLTest_RandomIntegerInRange(10000, 11000);
|
||||
break;
|
||||
case 3:
|
||||
/* Random Y position outside screen (negative) */
|
||||
y = SDLTest_RandomIntegerInRange(-1000, -100);
|
||||
break;
|
||||
case 4:
|
||||
/* Centered Y position */
|
||||
y = SDL_WINDOWPOS_CENTERED;
|
||||
break;
|
||||
case 5:
|
||||
/* Undefined Y position */
|
||||
y = SDL_WINDOWPOS_UNDEFINED;
|
||||
break;
|
||||
}
|
||||
|
||||
w = SDLTest_RandomIntegerInRange(32, 96);
|
||||
h = SDLTest_RandomIntegerInRange(32, 96);
|
||||
window = SDL_CreateWindow(title, x, y, w, h, 0);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h);
|
||||
SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL");
|
||||
|
||||
/* Clean up */
|
||||
destroyVideoSuiteTestWindow(window);
|
||||
}
|
||||
}
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Tests the functionality of the SDL_CreateWindow function using different sizes
|
||||
*/
|
||||
@@ -183,11 +99,9 @@ int video_createWindowVariousSizes(void *arg)
|
||||
{
|
||||
SDL_Window *window;
|
||||
const char *title = "video_createWindowVariousSizes Test Window";
|
||||
int x, y, w, h;
|
||||
int w, h;
|
||||
int wVariation, hVariation;
|
||||
|
||||
x = SDLTest_RandomIntegerInRange(1, 100);
|
||||
y = SDLTest_RandomIntegerInRange(1, 100);
|
||||
for (wVariation = 0; wVariation < 3; wVariation++) {
|
||||
for (hVariation = 0; hVariation < 3; hVariation++) {
|
||||
switch (wVariation) {
|
||||
@@ -220,8 +134,8 @@ int video_createWindowVariousSizes(void *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
window = SDL_CreateWindow(title, x, y, w, h, 0);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h);
|
||||
window = SDL_CreateWindow(title, w, h, 0);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,SHOWN)", w, h);
|
||||
SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL");
|
||||
|
||||
/* Clean up */
|
||||
@@ -239,13 +153,11 @@ int video_createWindowVariousFlags(void *arg)
|
||||
{
|
||||
SDL_Window *window;
|
||||
const char *title = "video_createWindowVariousFlags Test Window";
|
||||
int x, y, w, h;
|
||||
int w, h;
|
||||
int fVariation;
|
||||
SDL_WindowFlags flags;
|
||||
|
||||
/* Standard window */
|
||||
x = SDLTest_RandomIntegerInRange(1, 100);
|
||||
y = SDLTest_RandomIntegerInRange(1, 100);
|
||||
w = SDLTest_RandomIntegerInRange(320, 1024);
|
||||
h = SDLTest_RandomIntegerInRange(320, 768);
|
||||
|
||||
@@ -295,8 +207,8 @@ int video_createWindowVariousFlags(void *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
window = SDL_CreateWindow(title, x, y, w, h, flags);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags);
|
||||
window = SDL_CreateWindow(title, w, h, flags);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d)", w, h, flags);
|
||||
SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL");
|
||||
|
||||
/* Clean up */
|
||||
@@ -1678,10 +1590,14 @@ int video_setWindowCenteredOnDisplay(void *arg)
|
||||
expectedX = (expectedDisplayRect.x + ((expectedDisplayRect.w - w) / 2));
|
||||
expectedY = (expectedDisplayRect.y + ((expectedDisplayRect.h - h) / 2));
|
||||
|
||||
window = SDL_CreateWindow(title, x, y, w, h, 0);
|
||||
window = SDL_CreateWindow(title, w, h, SDL_WINDOW_HIDDEN);
|
||||
SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h);
|
||||
SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL");
|
||||
|
||||
/* Set the desired position */
|
||||
SDL_SetWindowPosition(window, x, y);
|
||||
SDL_ShowWindow(window);
|
||||
|
||||
/* Check the window is centered on the requested display */
|
||||
currentDisplay = SDL_GetDisplayForWindow(window);
|
||||
SDL_GetWindowSize(window, ¤tW, ¤tH);
|
||||
@@ -1762,74 +1678,70 @@ static const SDLTest_TestCaseReference videoTest1 = {
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest2 = {
|
||||
(SDLTest_TestCaseFp)video_createWindowVariousPositions, "video_createWindowVariousPositions", "Create windows at various locations", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest3 = {
|
||||
(SDLTest_TestCaseFp)video_createWindowVariousSizes, "video_createWindowVariousSizes", "Create windows with various sizes", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest4 = {
|
||||
static const SDLTest_TestCaseReference videoTest3 = {
|
||||
(SDLTest_TestCaseFp)video_createWindowVariousFlags, "video_createWindowVariousFlags", "Create windows using various flags", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest5 = {
|
||||
static const SDLTest_TestCaseReference videoTest4 = {
|
||||
(SDLTest_TestCaseFp)video_getWindowFlags, "video_getWindowFlags", "Get window flags set during SDL_CreateWindow", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest6 = {
|
||||
static const SDLTest_TestCaseReference videoTest5 = {
|
||||
(SDLTest_TestCaseFp)video_getFullscreenDisplayModes, "video_getFullscreenDisplayModes", "Use SDL_GetFullscreenDisplayModes function to get number of display modes", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest7 = {
|
||||
static const SDLTest_TestCaseReference videoTest6 = {
|
||||
(SDLTest_TestCaseFp)video_getClosestDisplayModeCurrentResolution, "video_getClosestDisplayModeCurrentResolution", "Use function to get closes match to requested display mode for current resolution", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest8 = {
|
||||
static const SDLTest_TestCaseReference videoTest7 = {
|
||||
(SDLTest_TestCaseFp)video_getClosestDisplayModeRandomResolution, "video_getClosestDisplayModeRandomResolution", "Use function to get closes match to requested display mode for random resolution", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest9 = {
|
||||
static const SDLTest_TestCaseReference videoTest8 = {
|
||||
(SDLTest_TestCaseFp)video_getWindowDisplayMode, "video_getWindowDisplayMode", "Get window display mode", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest10 = {
|
||||
static const SDLTest_TestCaseReference videoTest9 = {
|
||||
(SDLTest_TestCaseFp)video_getWindowDisplayModeNegative, "video_getWindowDisplayModeNegative", "Get window display mode with invalid input", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest11 = {
|
||||
static const SDLTest_TestCaseReference videoTest10 = {
|
||||
(SDLTest_TestCaseFp)video_getSetWindowGrab, "video_getSetWindowGrab", "Checks SDL_GetWindowGrab and SDL_SetWindowGrab positive and negative cases", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest12 = {
|
||||
static const SDLTest_TestCaseReference videoTest11 = {
|
||||
(SDLTest_TestCaseFp)video_getWindowId, "video_getWindowId", "Checks SDL_GetWindowID and SDL_GetWindowFromID", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest13 = {
|
||||
static const SDLTest_TestCaseReference videoTest12 = {
|
||||
(SDLTest_TestCaseFp)video_getWindowPixelFormat, "video_getWindowPixelFormat", "Checks SDL_GetWindowPixelFormat", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest14 = {
|
||||
static const SDLTest_TestCaseReference videoTest13 = {
|
||||
(SDLTest_TestCaseFp)video_getSetWindowPosition, "video_getSetWindowPosition", "Checks SDL_GetWindowPosition and SDL_SetWindowPosition positive and negative cases", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest15 = {
|
||||
static const SDLTest_TestCaseReference videoTest14 = {
|
||||
(SDLTest_TestCaseFp)video_getSetWindowSize, "video_getSetWindowSize", "Checks SDL_GetWindowSize and SDL_SetWindowSize positive and negative cases", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest16 = {
|
||||
static const SDLTest_TestCaseReference videoTest15 = {
|
||||
(SDLTest_TestCaseFp)video_getSetWindowMinimumSize, "video_getSetWindowMinimumSize", "Checks SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize positive and negative cases", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest17 = {
|
||||
static const SDLTest_TestCaseReference videoTest16 = {
|
||||
(SDLTest_TestCaseFp)video_getSetWindowMaximumSize, "video_getSetWindowMaximumSize", "Checks SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize positive and negative cases", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest18 = {
|
||||
static const SDLTest_TestCaseReference videoTest17 = {
|
||||
(SDLTest_TestCaseFp)video_getSetWindowData, "video_getSetWindowData", "Checks SDL_SetWindowData and SDL_GetWindowData positive and negative cases", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference videoTest19 = {
|
||||
static const SDLTest_TestCaseReference videoTest18 = {
|
||||
(SDLTest_TestCaseFp)video_setWindowCenteredOnDisplay, "video_setWindowCenteredOnDisplay", "Checks using SDL_WINDOWPOS_CENTERED_DISPLAY centers the window on a display", TEST_ENABLED
|
||||
};
|
||||
|
||||
@@ -1838,7 +1750,7 @@ static const SDLTest_TestCaseReference *videoTests[] = {
|
||||
&videoTest1, &videoTest2, &videoTest3, &videoTest4, &videoTest5, &videoTest6,
|
||||
&videoTest7, &videoTest8, &videoTest9, &videoTest10, &videoTest11, &videoTest12,
|
||||
&videoTest13, &videoTest14, &videoTest15, &videoTest16, &videoTest17,
|
||||
&videoTest18, &videoTest19, NULL
|
||||
&videoTest18, NULL
|
||||
};
|
||||
|
||||
/* Video test suite (global) */
|
||||
|
||||
@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Create window and renderer for given surface */
|
||||
window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_RESIZABLE);
|
||||
window = SDL_CreateWindow("Chess Board", 640, 480, SDL_WINDOW_RESIZABLE);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n", SDL_GetError());
|
||||
return 1;
|
||||
|
||||
@@ -897,9 +897,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Create a window to display gamepad state */
|
||||
window = SDL_CreateWindow("Gamepad Test", SDL_WINDOWPOS_CENTERED,
|
||||
SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT, 0);
|
||||
window = SDL_CreateWindow("Gamepad Test", SCREEN_WIDTH, SCREEN_HEIGHT, 0);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
||||
return 2;
|
||||
|
||||
@@ -81,7 +81,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/* !!! FIXME: check for errors. */
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
window = SDL_CreateWindow("Drag the red boxes", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE);
|
||||
window = SDL_CreateWindow("Drag the red boxes", 640, 480, SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE);
|
||||
renderer = SDL_CreateRenderer(window, NULL, 0);
|
||||
|
||||
if (SDL_SetWindowHitTest(window, hitTest, NULL) == -1) {
|
||||
|
||||
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/*
|
||||
//SDL_CreateWindow("Dummy", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 128, 128, 0);
|
||||
//SDL_CreateWindow("Dummy", 128, 128, 0);
|
||||
*/
|
||||
|
||||
SDL_free(SDL_GetJoysticks(&num_joysticks));
|
||||
|
||||
@@ -299,9 +299,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Create a window to display joystick axis position */
|
||||
window = SDL_CreateWindow("Joystick Test", SDL_WINDOWPOS_CENTERED,
|
||||
SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT, 0);
|
||||
window = SDL_CreateWindow("Joystick Test", SCREEN_WIDTH, SCREEN_HEIGHT, 0);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
|
||||
@@ -183,7 +183,7 @@ int main(int argc, char *argv[])
|
||||
/* Test showing a message box with a parent window */
|
||||
{
|
||||
SDL_Event event;
|
||||
SDL_Window *window = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0);
|
||||
SDL_Window *window = SDL_CreateWindow("Test", 640, 480, 0);
|
||||
|
||||
/* On wayland, no window will actually show until something has
|
||||
actually been displayed.
|
||||
|
||||
@@ -261,9 +261,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Create a window to display joystick axis position */
|
||||
window = SDL_CreateWindow("Mouse Test", SDL_WINDOWPOS_CENTERED,
|
||||
SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT, 0);
|
||||
window = SDL_CreateWindow("Mouse Test", SCREEN_WIDTH, SCREEN_HEIGHT, 0);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
|
||||
@@ -77,7 +77,7 @@ test_multi_audio(int devcount)
|
||||
SDL_Event event;
|
||||
|
||||
/* Create a Window to get fully initialized event processing for testing pause on Android. */
|
||||
SDL_CreateWindow("testmultiaudio", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, 0);
|
||||
SDL_CreateWindow("testmultiaudio", 320, 240, 0);
|
||||
#endif
|
||||
|
||||
if (devcount > 64) {
|
||||
|
||||
@@ -110,9 +110,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* If OPENGL fails to init it will fallback to using a framebuffer for rendering */
|
||||
window = SDL_CreateWindow("Offscreen Test",
|
||||
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
|
||||
width, height, 0);
|
||||
window = SDL_CreateWindow("Offscreen Test", width, height, 0);
|
||||
|
||||
if (window == NULL) {
|
||||
SDL_Log("Couldn't create window: %s\n",
|
||||
|
||||
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
|
||||
SDL_bool done = SDL_FALSE;
|
||||
SDL_Event event;
|
||||
|
||||
SDL_CreateWindow("Sensor Test", 0, 0, 0, 0, SDL_WINDOW_FULLSCREEN);
|
||||
SDL_CreateWindow("Sensor Test", 0, 0, SDL_WINDOW_FULLSCREEN);
|
||||
while (!done) {
|
||||
/* Update to get the current event state */
|
||||
SDL_PumpEvents();
|
||||
|
||||
@@ -456,7 +456,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Create a 640x480 OpenGL screen */
|
||||
window = SDL_CreateWindow("Shader Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL);
|
||||
window = SDL_CreateWindow("Shader Demo", 640, 480, SDL_WINDOW_OPENGL);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create OpenGL window: %s\n", SDL_GetError());
|
||||
SDL_Quit();
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
#define SHAPED_WINDOW_X 150
|
||||
#define SHAPED_WINDOW_Y 150
|
||||
#define SHAPED_WINDOW_DIMENSION 640
|
||||
|
||||
typedef struct LoadedPicture
|
||||
@@ -106,9 +104,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
window = SDL_CreateShapedWindow("SDL_Shape test",
|
||||
SHAPED_WINDOW_X, SHAPED_WINDOW_Y,
|
||||
SHAPED_WINDOW_DIMENSION, SHAPED_WINDOW_DIMENSION,
|
||||
0);
|
||||
SHAPED_WINDOW_DIMENSION, SHAPED_WINDOW_DIMENSION, 0);
|
||||
if (window == NULL) {
|
||||
for (i = 0; i < num_pictures; i++) {
|
||||
SDL_DestroySurface(pictures[i].surface);
|
||||
|
||||
@@ -155,11 +155,7 @@ int main(int argc, char **argv)
|
||||
SDL_RWclose(handle);
|
||||
|
||||
/* Create the window and renderer */
|
||||
window = SDL_CreateWindow("Happy Moose",
|
||||
SDL_WINDOWPOS_UNDEFINED,
|
||||
SDL_WINDOWPOS_UNDEFINED,
|
||||
MOOSEPIC_W * 4, MOOSEPIC_H * 4,
|
||||
SDL_WINDOW_RESIZABLE);
|
||||
window = SDL_CreateWindow("Happy Moose", MOOSEPIC_W * 4, MOOSEPIC_H * 4, SDL_WINDOW_RESIZABLE);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create window: %s\n", SDL_GetError());
|
||||
quit(3);
|
||||
|
||||
@@ -349,11 +349,7 @@ int main(int argc, char **argv)
|
||||
now = SDL_GetTicks();
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "%" SDL_PRIu32 " iterations in %" SDL_PRIu64 " ms, %.2fms each\n", iterations, (now - then), (float)(now - then) / iterations);
|
||||
|
||||
window = SDL_CreateWindow("YUV test",
|
||||
SDL_WINDOWPOS_UNDEFINED,
|
||||
SDL_WINDOWPOS_UNDEFINED,
|
||||
original->w, original->h,
|
||||
0);
|
||||
window = SDL_CreateWindow("YUV test", original->w, original->h, 0);
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
||||
return 4;
|
||||
|
||||
Reference in New Issue
Block a user