SDL_CreateWindow() has been simplified and no longer takes a window position.

This commit is contained in:
Sam Lantinga committed 2023-03-06 09:50:12 -08:00
1 parent 7905254087
commit 698dbd8464
51 files changed
+106 -326

No files matched your search

+5 -10
View File
@@ -1,22 +1,17 @@
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
int main(int argc, char *argv[])
{
SDL_Window *window = NULL;
SDL_Surface *screenSurface = NULL;
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError());
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
return 1;
}
window = SDL_CreateWindow(
"Hello SDL",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
640, 480,
0
);
window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
if (window == NULL) {
fprintf(stderr, "could not create window: %s\n", SDL_GetError());
SDL_Log("could not create window: %s\n", SDL_GetError());
return 1;
}
screenSurface = SDL_GetWindowSurface(window);