Environment: SDL3 , MINGW64 installed using msys2, also installed image and ttf, windows 11, DLL present.
IDE: Dev C++
Compiler Call: -O2 -std=c++17
Linker Call: -lSDL3
Binaries:
\bin, \mingw32\bin
Libraries:
\lib, \mingw32\lib
C include:
\include
C++ include:
\include, \include\c++
Please help me, new to SDL3
Code:
#include <SDL3/SDL.h>
#include<bits/stdc++.h>
#include <windows.h>
using namespace std;
int main() {
// Initialize SDL
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
printf(“SDL could not initialize! SDL_Error: |%s|\n”, SDL_GetError());
return 1;
}
// // Create window
SDL_Window* window = SDL_CreateWindow(
“SDL3 Test”,
640, // width
480, // height
SDL_WINDOW_RESIZABLE
);
// if (window == NULL) {
// printf(“Window could not be created! SDL_Error: %s\n”, SDL_GetError());
// SDL_Quit();
// return 1;
// }
//
// // Main loop
// int quit = 0;
// SDL_Event event;
//
// while (!quit) {
// while (SDL_PollEvent(&event)) {
// if (event.type == SDL_EVENT_QUIT) {
// quit = 1;
// }
// }
// // Small delay to prevent high CPU usage
// SDL_Delay(16);
// }
//
// SDL_DestroyWindow(window);
// SDL_Quit();
return 0;
}