Skip to content

csalmeida/c-sdl2-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C SDL2 Example

A setup of SDL2 with all the libraries available in the project folder.

Setup

To compile the program use:

make

To run it:

./bin/main

To clear compiled files:

make clean

Tip

If VS Code is not detecting the path to SDL add them to the path by adding "${workspaceFolder}/include" in the Microsoft C/C++ Extension.

Examples

main.c

main.c

blank_window.c

blank_window.c

Troubleshooting

The Zed Editor does not find SDL2

The Zed editor might have difficulties finding SDL2 in the include folder. To fix this, you'll need to use absolute paths in your .clangd file. To get the absolute path:

  1. Change directory to your project folder
  2. Use pwd to get the absolute path
  3. Create a .clangd file in your project root that looks similar to this:
CompileFlags:
  Add:
    - "-I/Users/username/Projects/my-project"
    - "-I/Users/username/Projects/my-project/include"
    - "-I/Users/username/Projects/my-project/include/SDL2"

Replace /Users/username/Projects/my-project with the output from your pwd command.

About

SDL2 Example project written in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages