Skip to content
Drawing application made with SDL2
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images
.gitignore
Draw.exe
README-SDL.txt
README.md
SDL2.dll
build.bat
main.c

README.md

sdl2-draw-demo

A simple drawing application made with SDL2. Run Draw.exe with SDL2.dll in the same folder (64-bit Windows). build.bat builds the executable for 64-bit Windows, but the project can be built for 32-bit and 64-bit Windows/Linux/macOS with an appropriate compiler and SDL2 distribution.

Use the mouse to draw. The color drifts randomly. The drawing drifts randomly in a dither pattern when you hold the mouse button without moving the mouse.

The window defaults to 512x512 pixels and is resizable. Resizing the window clears the drawing.

Feel free to ask a question by opening an issue.

infinity

wander

DRAW

Development

This covers building on Windows 64-bit and 32-bit. On Linux and macOS, use your favorite C/C++ compiler and the appropriate SDL2 distribution. This project uses the current stable SDL version 2.0.9.

  • Download and install Build Tools for Visual Studio 2017 to get the CL C/C++ compiler and x64 Native Tools Command Prompt. Use x86 Native Tools Command Prompt for 32-bit Windows. More information on these command prompts here.
  • Download the Visual C++ SDL2 development libraries.
  • Create a symbolic link named SDL2-2.0.9 targeting the location of the downloaded SDL2-2.0.9 folder. Likely use mklink /D SDL2-2.0.9 C:\path\to\SDL2-2.0.9. The /D argument is for directory symbolic link as opposed to the default file symbolic link.
  • Switch x64 to x86 for libpathsdl in build.bat for 32-bit.
  • Run build.bat in the command prompt from above to build. Run build.bat dev to get a console when the program runs.
You can’t perform that action at this time.