Template
move to sdl3 and add sublime project files
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
CC := gcc
|
CC := gcc
|
||||||
LIBS := `pkg-config --libs sdl2`
|
LIBS := `pkg-config --libs sdl3`
|
||||||
INC := `pkg-config --cflags sdl2`
|
INC := `pkg-config --cflags sdl3`
|
||||||
SRC := src/main.c
|
SRC := src/main.c
|
||||||
OUT := build/main
|
OUT := build/main
|
||||||
|
|
||||||
build: $(SRC)
|
build:
|
||||||
$(CC) -o $(OUT) $< $(INC) $(LIBS)
|
$(CC) -o $(OUT) $(SRC) $(INC) $(LIBS)
|
||||||
|
|
||||||
run: build
|
run:
|
||||||
$(OUT)
|
$(OUT)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"folders":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,489 @@
|
|||||||
|
{
|
||||||
|
"auto_complete":
|
||||||
|
{
|
||||||
|
"selected_items":
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"SLD",
|
||||||
|
"SDL_Init"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"target",
|
||||||
|
"target_frame"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"buffers":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"file": "src/main.c",
|
||||||
|
"redo_stack":
|
||||||
|
[
|
||||||
|
[
|
||||||
|
112,
|
||||||
|
1,
|
||||||
|
"duplicate_line",
|
||||||
|
null,
|
||||||
|
"AQAAAN4CAAAAAAAA3gIAAAAAAAAVAAAACVNETF9XaW5kb3cgKndpbmRvdzsK",
|
||||||
|
"AQAAAAAAAAABAAAA5AIAAAAAAADkAgAAAAAAAAAAAAAAAPC/"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"settings":
|
||||||
|
{
|
||||||
|
"buffer_size": 2910,
|
||||||
|
"encoding": "UTF-8",
|
||||||
|
"line_ending": "Unix"
|
||||||
|
},
|
||||||
|
"undo_stack":
|
||||||
|
[
|
||||||
|
[
|
||||||
|
5,
|
||||||
|
1,
|
||||||
|
"insert",
|
||||||
|
{
|
||||||
|
"characters": "\n\n"
|
||||||
|
},
|
||||||
|
"AgAAABQCAAAAAAAAFQIAAAAAAAAAAAAAFQIAAAAAAAAWAgAAAAAAAAAAAAA",
|
||||||
|
"AwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAQAAABQCAAAAAAAAFAIAAAAAAAAAAAAAAADwvw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
11,
|
||||||
|
1,
|
||||||
|
"insert",
|
||||||
|
{
|
||||||
|
"characters": "SDL"
|
||||||
|
},
|
||||||
|
"AwAAABUCAAAAAAAAFgIAAAAAAAAAAAAAFgIAAAAAAAAXAgAAAAAAAAAAAAAXAgAAAAAAABgCAAAAAAAAAAAAAA",
|
||||||
|
"AwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAQAAABUCAAAAAAAAFQIAAAAAAAAAAAAAAADwvw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
12,
|
||||||
|
3,
|
||||||
|
"left_delete",
|
||||||
|
null,
|
||||||
|
"AwAAABcCAAAAAAAAFwIAAAAAAAABAAAATBYCAAAAAAAAFgIAAAAAAAABAAAARBUCAAAAAAAAFQIAAAAAAAABAAAAUw",
|
||||||
|
"AwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAQAAABgCAAAAAAAAGAIAAAAAAAAAAAAAAADwvw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
13,
|
||||||
|
1,
|
||||||
|
"insert",
|
||||||
|
{
|
||||||
|
"characters": "S"
|
||||||
|
},
|
||||||
|
"AQAAABUCAAAAAAAAFgIAAAAAAAAAAAAA",
|
||||||
|
"AwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAQAAABUCAAAAAAAAFQIAAAAAAAAAAAAAAADwvw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
14,
|
||||||
|
3,
|
||||||
|
"left_delete",
|
||||||
|
null,
|
||||||
|
"AwAAABUCAAAAAAAAFQIAAAAAAAABAAAAUxQCAAAAAAAAFAIAAAAAAAABAAAAChMCAAAAAAAAEwIAAAAAAAABAAAACg",
|
||||||
|
"AwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAQAAABYCAAAAAAAAFgIAAAAAAAAAAAAAAADwvw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
15,
|
||||||
|
1,
|
||||||
|
"insert",
|
||||||
|
{
|
||||||
|
"characters": " \t"
|
||||||
|
},
|
||||||
|
"AgAAABMCAAAAAAAAFAIAAAAAAAAAAAAAFAIAAAAAAAAVAgAAAAAAAAAAAAA",
|
||||||
|
"AwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAQAAABMCAAAAAAAAEwIAAAAAAAAAAAAAAADwvw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
16,
|
||||||
|
2,
|
||||||
|
"left_delete",
|
||||||
|
null,
|
||||||
|
"AgAAABQCAAAAAAAAFAIAAAAAAAABAAAACRMCAAAAAAAAEwIAAAAAAAABAAAAIA",
|
||||||
|
"AwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAQAAABUCAAAAAAAAFQIAAAAAAAAAAAAAAADwvw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
4,
|
||||||
|
1,
|
||||||
|
"insert",
|
||||||
|
{
|
||||||
|
"characters": "z"
|
||||||
|
},
|
||||||
|
"AQAAANICAAAAAAAA0wIAAAAAAAAAAAAA",
|
||||||
|
"AQAAAAAAAAABAAAA0gIAAAAAAADSAgAAAAAAAAAAAAAAAPC/"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
6,
|
||||||
|
1,
|
||||||
|
"left_delete",
|
||||||
|
null,
|
||||||
|
"AQAAANICAAAAAAAA0gIAAAAAAAABAAAAeg",
|
||||||
|
"AQAAAAAAAAABAAAA0wIAAAAAAADTAgAAAAAAAAAAAAAAAPC/"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
7,
|
||||||
|
1,
|
||||||
|
"insert",
|
||||||
|
{
|
||||||
|
"characters": "d"
|
||||||
|
},
|
||||||
|
"AQAAANICAAAAAAAA0wIAAAAAAAAAAAAA",
|
||||||
|
"AQAAAAAAAAABAAAA0gIAAAAAAADSAgAAAAAAAAAAAAAAAPC/"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
9,
|
||||||
|
1,
|
||||||
|
"left_delete",
|
||||||
|
null,
|
||||||
|
"AQAAANICAAAAAAAA0gIAAAAAAAABAAAAZA",
|
||||||
|
"AQAAAAAAAAABAAAA0wIAAAAAAADTAgAAAAAAAAAAAAAAAPC/"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
64,
|
||||||
|
2,
|
||||||
|
"toggle_comment",
|
||||||
|
{
|
||||||
|
"block": false
|
||||||
|
},
|
||||||
|
"AgAAAMoCAAAAAAAAzQIAAAAAAAAAAAAAygIAAAAAAADKAgAAAAAAAAMAAAAvLyA",
|
||||||
|
"AQAAAAAAAAABAAAAzwIAAAAAAADPAgAAAAAAAAAAAAAAAPC/"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"build_system": "",
|
||||||
|
"build_system_choices":
|
||||||
|
[
|
||||||
|
[
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"Packages/Makefile/Make.sublime-build",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Packages/Makefile/Make.sublime-build",
|
||||||
|
"Clean"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Packages/Makefile/Make.sublime-build",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"Packages/User/Custom Make.sublime-build",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Packages/User/Custom Make.sublime-build",
|
||||||
|
"Run"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Packages/User/Custom Make.sublime-build",
|
||||||
|
"Clean"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Packages/User/Custom Make.sublime-build",
|
||||||
|
"Run"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"build_varint": "",
|
||||||
|
"command_palette":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"last_filter": "",
|
||||||
|
"selected_items":
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"Package Control: insta",
|
||||||
|
"Package Control: Install Package"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Package Control: remove",
|
||||||
|
"Package Control: Remove Package"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"zeal:",
|
||||||
|
"Zeal: Search"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"zeal",
|
||||||
|
"Zeal: Search"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"install",
|
||||||
|
"Package Control: Install Package"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Package Control: ",
|
||||||
|
"Package Control: Remove Package"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"clangd",
|
||||||
|
"Preferences: LSP-clangd Settings"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"install package",
|
||||||
|
"Package Control: Install Package"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"package",
|
||||||
|
"Install Package Control"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"width": 0.0
|
||||||
|
},
|
||||||
|
"console":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"history":
|
||||||
|
[
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"distraction_free":
|
||||||
|
{
|
||||||
|
"menu_visible": true,
|
||||||
|
"show_minimap": false,
|
||||||
|
"show_open_files": false,
|
||||||
|
"show_tabs": false,
|
||||||
|
"side_bar_visible": false,
|
||||||
|
"status_bar_visible": false
|
||||||
|
},
|
||||||
|
"expanded_folders":
|
||||||
|
[
|
||||||
|
"/home/imp/Code/c_sdl_playground",
|
||||||
|
"/home/imp/Code/c_sdl_playground/build",
|
||||||
|
"/home/imp/Code/c_sdl_playground/src"
|
||||||
|
],
|
||||||
|
"file_history":
|
||||||
|
[
|
||||||
|
"/home/imp/.config/sublime-text/Packages/User/zeal_unfiltered.py",
|
||||||
|
"/home/imp/Dokumenty/sdlwiki/SDL3/SDL_Window.html",
|
||||||
|
"/home/imp/.config/sublime-text/Packages/User/open-offline-doc.py",
|
||||||
|
"/home/imp/.config/sublime-text/Packages/User/open-url.py",
|
||||||
|
"/home/imp/.local/share/Zeal/Zeal/docsets/import_docset.py",
|
||||||
|
"/home/imp/.local/share/Zeal/Zeal/docsets/SDL3.docset/Contents/Info.plist",
|
||||||
|
"/home/imp/.local/share/Zeal/Zeal/docsets/SDL.docset/Contents/Resources/docSet.dsidx",
|
||||||
|
"/home/imp/.config/sublime-text/Packages/User/LSP-clangd.sublime-settings",
|
||||||
|
"/home/imp/.config/sublime-text/Packages/LSP-clangd/LSP-clangd.sublime-settings",
|
||||||
|
"/home/imp/Code/c_sdl_playground/compile_options.txt",
|
||||||
|
"/home/imp/Code/c_sdl_playground/Makefile",
|
||||||
|
"/home/imp/Code/c_sdl_playground/src/main.c",
|
||||||
|
"/home/imp/Code/c_sdl_playground/src/compile_options.txt",
|
||||||
|
"/home/imp/sdl-builder/SDL/build/build.sh",
|
||||||
|
"/home/imp/sdl-builder/Dockerfile",
|
||||||
|
"/home/imp/sdl-builder/build-sdl.sh",
|
||||||
|
"/home/imp/.config/sublime-text/Packages/User/Custom Make.sublime-build",
|
||||||
|
"/home/imp/Code/c_sdl_playground/build/main",
|
||||||
|
"/home/imp/.config/sublime-text/Packages/User/Make.sublime-build",
|
||||||
|
"/home/imp/.config/sublime-text/Packages/User/make.sublime-build",
|
||||||
|
"/home/imp/xzlevor/s1/d_2048.py"
|
||||||
|
],
|
||||||
|
"find":
|
||||||
|
{
|
||||||
|
"height": 0.0
|
||||||
|
},
|
||||||
|
"find_in_files":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"where_history":
|
||||||
|
[
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"find_state":
|
||||||
|
{
|
||||||
|
"case_sensitive": false,
|
||||||
|
"find_history":
|
||||||
|
[
|
||||||
|
],
|
||||||
|
"highlight": true,
|
||||||
|
"in_selection": false,
|
||||||
|
"preserve_case": false,
|
||||||
|
"regex": false,
|
||||||
|
"replace_history":
|
||||||
|
[
|
||||||
|
],
|
||||||
|
"reverse": false,
|
||||||
|
"scrollbar_highlights": true,
|
||||||
|
"show_context": true,
|
||||||
|
"use_buffer2": true,
|
||||||
|
"use_gitignore": true,
|
||||||
|
"whole_word": false,
|
||||||
|
"wrap": true
|
||||||
|
},
|
||||||
|
"groups":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"sheets":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"buffer": 0,
|
||||||
|
"file": "src/main.c",
|
||||||
|
"selected": true,
|
||||||
|
"semi_transient": false,
|
||||||
|
"settings":
|
||||||
|
{
|
||||||
|
"buffer_size": 2910,
|
||||||
|
"regions":
|
||||||
|
{
|
||||||
|
},
|
||||||
|
"selection":
|
||||||
|
[
|
||||||
|
[
|
||||||
|
781,
|
||||||
|
781
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"settings":
|
||||||
|
{
|
||||||
|
"auto_complete_triggers":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"characters": "<",
|
||||||
|
"selector": "text.html, text.xml"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"rhs_empty": true,
|
||||||
|
"selector": "punctuation.accessor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"characters": ".<>:\"/*",
|
||||||
|
"selector": "punctuation.accessor | (meta.preprocessor.include string - punctuation.definition.string.end)",
|
||||||
|
"server": "LSP-clangd"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"lsp_active": true,
|
||||||
|
"lsp_uri": "file:///home/imp/Code/c_sdl_playground/src/main.c",
|
||||||
|
"show_definitions": false,
|
||||||
|
"syntax": "Packages/C++/C.sublime-syntax",
|
||||||
|
"tab_size": 4,
|
||||||
|
"translate_tabs_to_spaces": false
|
||||||
|
},
|
||||||
|
"translation.x": 0.0,
|
||||||
|
"translation.y": 0.0,
|
||||||
|
"zoom_level": 1.0
|
||||||
|
},
|
||||||
|
"stack_index": 0,
|
||||||
|
"stack_multiselect": false,
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"incremental_find":
|
||||||
|
{
|
||||||
|
"height": 0.0
|
||||||
|
},
|
||||||
|
"input":
|
||||||
|
{
|
||||||
|
"height": 0.0
|
||||||
|
},
|
||||||
|
"layout":
|
||||||
|
{
|
||||||
|
"cells":
|
||||||
|
[
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"cols":
|
||||||
|
[
|
||||||
|
0.0,
|
||||||
|
1.0
|
||||||
|
],
|
||||||
|
"rows":
|
||||||
|
[
|
||||||
|
0.0,
|
||||||
|
1.0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"menu_visible": true,
|
||||||
|
"output.LSP Log Panel":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"history":
|
||||||
|
[
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"output.diagnostics":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"history":
|
||||||
|
[
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"output.exec":
|
||||||
|
{
|
||||||
|
"height": 151.0,
|
||||||
|
"history":
|
||||||
|
[
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"output.find_results":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"history":
|
||||||
|
[
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"output.mdpopups":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"history":
|
||||||
|
[
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pinned_build_system": "Packages/User/Custom Make.sublime-build",
|
||||||
|
"project": "c-sdl-playground.sublime-project",
|
||||||
|
"replace":
|
||||||
|
{
|
||||||
|
"height": 0.0
|
||||||
|
},
|
||||||
|
"save_all_on_build": true,
|
||||||
|
"select_file":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"last_filter": "",
|
||||||
|
"selected_items":
|
||||||
|
[
|
||||||
|
],
|
||||||
|
"width": 0.0
|
||||||
|
},
|
||||||
|
"select_project":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"last_filter": "",
|
||||||
|
"selected_items":
|
||||||
|
[
|
||||||
|
],
|
||||||
|
"width": 0.0
|
||||||
|
},
|
||||||
|
"select_symbol":
|
||||||
|
{
|
||||||
|
"height": 0.0,
|
||||||
|
"last_filter": "",
|
||||||
|
"selected_items":
|
||||||
|
[
|
||||||
|
],
|
||||||
|
"width": 0.0
|
||||||
|
},
|
||||||
|
"selected_group": 0,
|
||||||
|
"settings":
|
||||||
|
{
|
||||||
|
"lsp_show_inlay_hints": false
|
||||||
|
},
|
||||||
|
"show_minimap": true,
|
||||||
|
"show_open_files": false,
|
||||||
|
"show_tabs": true,
|
||||||
|
"side_bar_visible": true,
|
||||||
|
"side_bar_width": 199.0,
|
||||||
|
"status_bar_visible": true,
|
||||||
|
"template_settings":
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-std=c11
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Iinclude
|
||||||
+7
-7
@@ -2,8 +2,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <SDL2/SDL_events.h>
|
#include <SDL3/SDL_events.h>
|
||||||
|
|
||||||
#define WIDTH 320
|
#define WIDTH 320
|
||||||
#define HEIGHT 200
|
#define HEIGHT 200
|
||||||
@@ -37,13 +37,13 @@ int main() {
|
|||||||
|
|
||||||
const double target_frame = 1.0 / 60.0;
|
const double target_frame = 1.0 / 60.0;
|
||||||
|
|
||||||
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
|
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||||
fprintf(stderr, "SDL_Init failed! %s\n", SDL_GetError());
|
fprintf(stderr, "SDL_Init failed! %s\n", SDL_GetError());
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
window = SDL_CreateWindow(
|
window = SDL_CreateWindow(
|
||||||
"SDL Framebuffer", 0, 0,
|
"SDL Framebuffer",
|
||||||
WIDTH, HEIGHT, 0
|
WIDTH, HEIGHT, 0
|
||||||
);
|
);
|
||||||
if (window == NULL) {
|
if (window == NULL) {
|
||||||
@@ -52,7 +52,7 @@ int main() {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer = SDL_CreateRenderer(window, 0, 0);
|
renderer = SDL_CreateRenderer(window, NULL);
|
||||||
if (renderer == NULL) {
|
if (renderer == NULL) {
|
||||||
fprintf(stderr, "SDL_CreateRenderer failed! %s\n", SDL_GetError());
|
fprintf(stderr, "SDL_CreateRenderer failed! %s\n", SDL_GetError());
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
@@ -79,7 +79,7 @@ int main() {
|
|||||||
uint64_t start = SDL_GetPerformanceCounter();
|
uint64_t start = SDL_GetPerformanceCounter();
|
||||||
|
|
||||||
while (SDL_PollEvent(&event)) {
|
while (SDL_PollEvent(&event)) {
|
||||||
if (event.type == SDL_QUIT) {
|
if (event.type == SDL_EVENT_QUIT) {
|
||||||
is_running = false;
|
is_running = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ int main() {
|
|||||||
SDL_UpdateTexture(texture, NULL, framebuffer, WIDTH * sizeof(uint32_t));
|
SDL_UpdateTexture(texture, NULL, framebuffer, WIDTH * sizeof(uint32_t));
|
||||||
|
|
||||||
SDL_RenderClear(renderer);
|
SDL_RenderClear(renderer);
|
||||||
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
SDL_RenderTexture(renderer, texture, NULL, NULL);
|
||||||
SDL_RenderPresent(renderer);
|
SDL_RenderPresent(renderer);
|
||||||
|
|
||||||
uint64_t end = SDL_GetPerformanceCounter();
|
uint64_t end = SDL_GetPerformanceCounter();
|
||||||
|
|||||||
Reference in New Issue
Block a user