-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
35 lines (27 loc) · 813 Bytes
/
Main.cpp
File metadata and controls
35 lines (27 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "SDL.h"
#include <stdio.h>
int main(int argc, char* argv[]) {
SDL_Window* window;
SDL_Init(SDL_INIT_VIDEO);
// Create an application window with the following settings:
window = SDL_CreateWindow(
"2D Game",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
1280,
720,
SDL_WINDOW_OPENGL
);
// Check that the window was successfully created
if (window == NULL) {
printf("Could not create window: %s\n", SDL_GetError());
return 1;
}
// The window is open: could enter program loop here (see SDL_PollEvent())
SDL_Delay(3000); // Pause execution for 3000 milliseconds, for example
// Close and destroy the window
SDL_DestroyWindow(window);
// Clean up
SDL_Quit();
return 0;
}