here is my configuration if you want to see it in practice https://github.com/sioodmy/dotfiles/tree/f881916328fcb13ffaf7c436a7f0fa2c28103273
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; mkShell { | |
nativeBuildInputs = [ | |
pkgconfig | |
clang lld # To use lld linker | |
]; | |
buildInputs = [ | |
udev alsaLib vulkan-loader libGL egl-wayland | |
x11 xorg.libXcursor xorg.libXrandr xorg.libXi # To use x11 feature | |
libxkbcommon wayland # To use wayland feature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SDL2 Hello, World! | |
// This should display a white screen for 2 seconds | |
// compile with: clang++ main.cpp -o hello_sdl2 -lSDL2 | |
// run with: ./hello_sdl2 | |
#include <SDL2/SDL.h> | |
#include <stdio.h> | |
#define SCREEN_WIDTH 640 | |
#define SCREEN_HEIGHT 480 |