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

This commit is contained in:
Sam Lantinga
2023-03-05 14:44:38 -08:00
parent 7905254087
commit 698dbd8464
51 changed files with 106 additions and 326 deletions

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);